Net-Dropbear

 view release on metacpan or  search on metacpan

dropbear.patch  view on Meta::CPAN

+		if ( ret == LIBDROPBEAR_HOOK_FAILURE)
+		{
+			return;
+		}
+
+		if ( ret == LIBDROPBEAR_HOOK_COMPLETE)
+		{
+			ses.authstate = auth;
+			return;
+		}
+	}
+
+	if (hooks.on_passwd_fill != NULL)
+	{
+		ret_on_passwd_fill = hooks.on_passwd_fill(&auth, username);
+
+		if (ret_on_passwd_fill == LIBDROPBEAR_HOOK_FAILURE)
+		{
+			m_free(auth.pw_dir);
+			m_free(auth.pw_shell);
+			m_free(auth.pw_name);
+			m_free(auth.pw_passwd);
+			return;
+		}
+
+		if (   !auth.pw_dir  || !auth.pw_shell
+		    || !auth.pw_name || !auth.pw_passwd)
+		{
+			dropbear_exit("hooks.on_passwd_fill returned invalid data");
+		}
+
+	}
+
+	if (hooks.on_shadow_fill != NULL)
+	{
+		ret_on_shadow_fill = hooks.on_shadow_fill(&auth.pw_passwd, auth.pw_name);
+		if (!auth.pw_passwd)
+		{
+			dropbear_exit("hooks.on_passwd_fill returned invalid data");
+		}
+
+	}
+
+	if (ret_on_passwd_fill == LIBDROPBEAR_HOOK_COMPLETE || ret_on_shadow_fill == LIBDROPBEAR_HOOK_COMPLETE)
+	{
+		ses.authstate = auth;
+		return;
+	}
+
+#endif
+
 	pw = getpwnam(username);
 	if (!pw) {
 		return;
diff -uN dropbear-2022.82/configure dropbear/configure
--- dropbear-2022.82/configure	2022-04-01 10:30:00.000000000 -0400
+++ dropbear/configure	2022-04-01 10:30:00.000000000 -0400
@@ -3279,7 +3279,7 @@
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: Checking for available hardened build flags:" >&5
 $as_echo "$as_me: Checking for available hardened build flags:" >&6;}
 	# relocation flags don't make sense for static builds
-	if test "$STATIC" -ne 1; then
+	if false; then
 		# pie
 		{
 		OLDFLAGS="$CFLAGS"
Common subdirectories: dropbear-2022.82/debian and dropbear/debian
diff -uN dropbear-2022.82/dropbear.h dropbear/dropbear.h
--- dropbear-2022.82/dropbear.h	1969-12-31 19:00:00.000000000 -0500
+++ dropbear/dropbear.h	2022-07-06 23:07:07.574753136 -0400
@@ -0,0 +1,16 @@
+
+#ifndef _DROPBEAR_H_
+#define _DROPBEAR_H_
+
+#include "includes.h"
+#include "dbutil.h"
+#include "session.h"
+#include "buffer.h"
+#include "signkey.h"
+#include "runopts.h"
+#include "dbrandom.h"
+#include "crypto_desc.h"
+
+static void main_noinetd(int argc, char ** argv, const char* multipath);
+
+#endif
Common subdirectories: dropbear-2022.82/fuzz and dropbear/fuzz
Common subdirectories: dropbear-2022.82/.github and dropbear/.github
diff -uN dropbear-2022.82/libdropbear.h dropbear/libdropbear.h
--- dropbear-2022.82/libdropbear.h	1969-12-31 19:00:00.000000000 -0500
+++ dropbear/libdropbear.h	2022-07-06 23:07:07.574753136 -0400
@@ -0,0 +1,51 @@
+#ifndef _LIBDROPBEAR_H_
+#define _LIBDROPBEAR_H_
+
+#include "gensignkey.h"
+
+#define LIBDROPBEAR_HOOK_COMPLETE 1 /* Hook completed, don't continue */
+#define LIBDROPBEAR_HOOK_CONTINUE 0 /* Continue on as if the hook was NULL */
+#define LIBDROPBEAR_HOOK_FAILURE -1 /* There was an error with the hook */
+
+struct dropbear_chansess_accept {
+  int channel_index;
+  unsigned char * cmd;
+  pid_t pid;
+
+  int iscmd;
+  int issubsys;
+
+  int writefd;
+  int readfd;
+  int errfd;
+};
+
+struct dropbear_hooks {
+  int _will_run_as_root;
+  int (*on_log)(int priority, const char *message);
+  int (*on_start)();
+  int (*on_connect)();
+  int (*on_username)(const char *username);



( run in 1.479 second using v1.01-cache-2.11-cpan-71847e10f99 )