]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-auth: Add password_schemes_weak_allowed()
authorAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 11 Mar 2025 11:31:57 +0000 (13:31 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 11 Mar 2025 11:32:32 +0000 (13:32 +0200)
Needed by next commit

src/lib-auth/Makefile.am
src/lib-auth/password-scheme-private.h [new file with mode: 0644]
src/lib-auth/password-scheme.c

index a4b1a7a436b1fdd1af0f9bece71c2fc59d19c310..6bd48eb912d8fdb8ef3933d8132cd1735acfe132 100644 (file)
@@ -36,7 +36,8 @@ headers = \
 pkginc_libdir=$(pkgincludedir)
 pkginc_lib_HEADERS = $(headers)
 
-noinst_HEADERS = crypt-blowfish.h
+noinst_HEADERS = crypt-blowfish.h \
+       password-scheme-private.h
 
 test_programs = \
        test-password-scheme \
diff --git a/src/lib-auth/password-scheme-private.h b/src/lib-auth/password-scheme-private.h
new file mode 100644 (file)
index 0000000..c3fb43f
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef PASSWORD_SCHEME_PRIVATE
+#define PASSWORD_SCHEME_PRIVATE 1
+
+bool password_schemes_weak_allowed(void);
+
+#endif
index 46755918e849f197ae2f1f49ed167366bb4439c5..c69bc201bd1f611bd55d911548379fb750e3d9cc 100644 (file)
@@ -16,6 +16,7 @@
 #include "otp.h"
 #include "str.h"
 #include "password-scheme.h"
+#include "password-scheme-private.h"
 
 static const char salt_chars[] =
        "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
@@ -29,6 +30,11 @@ void password_schemes_allow_weak(bool allow)
        g_allow_weak = allow;
 }
 
+bool password_schemes_weak_allowed(void)
+{
+       return g_allow_weak;
+}
+
 static const struct password_scheme *
 password_scheme_lookup_name(const char *name)
 {