From: Aki Tuomi Date: Tue, 11 Mar 2025 11:31:57 +0000 (+0200) Subject: lib-auth: Add password_schemes_weak_allowed() X-Git-Tag: 2.4.1~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e8064d4692d3e7f9931c356bec685317864212ac;p=thirdparty%2Fdovecot%2Fcore.git lib-auth: Add password_schemes_weak_allowed() Needed by next commit --- diff --git a/src/lib-auth/Makefile.am b/src/lib-auth/Makefile.am index a4b1a7a436..6bd48eb912 100644 --- a/src/lib-auth/Makefile.am +++ b/src/lib-auth/Makefile.am @@ -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 index 0000000000..c3fb43f446 --- /dev/null +++ b/src/lib-auth/password-scheme-private.h @@ -0,0 +1,6 @@ +#ifndef PASSWORD_SCHEME_PRIVATE +#define PASSWORD_SCHEME_PRIVATE 1 + +bool password_schemes_weak_allowed(void); + +#endif diff --git a/src/lib-auth/password-scheme.c b/src/lib-auth/password-scheme.c index 46755918e8..c69bc201bd 100644 --- a/src/lib-auth/password-scheme.c +++ b/src/lib-auth/password-scheme.c @@ -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) {