]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-sasl: fuzz-sasl-authentication - Only fuzz Winbind mechanisms when compiled with...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 14 Oct 2025 14:35:10 +0000 (16:35 +0200)
committerStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 14 Oct 2025 21:44:25 +0000 (23:44 +0200)
m4/dovecot.m4
src/lib-sasl/fuzz-sasl-authentication.c

index 6e6bdc2101ff8d7ccde48523377691340679cb9a..1b45bc9a4f9bd53e74cb18605b0107e6cf5245a1 100644 (file)
@@ -332,6 +332,16 @@ AC_DEFUN([DC_DOVECOT_FUZZER],[
        AC_SUBST([FUZZER_LDFLAGS])
        AM_CONDITIONAL([USE_FUZZER], [test "x$with_fuzzer" != "xno"])
 
+       AC_ARG_ENABLE(local-fuzzer,
+       AS_HELP_STRING([--enable-local-fuzzer=yes],
+               [Enable fuzzer aspects suitable only for local use (not for e.g. OSS-Fuzz) (default: no)]),
+               enable_local_fuzzer=$enableval,
+               enable_local_fuzzer=no)
+       AC_MSG_CHECKING([Whether to enable fuzzer aspects suitable only for local use (not for e.g. OSS-Fuzz)])
+       AC_MSG_RESULT([$enable_local_fuzzer])
+       AS_IF([test "$enable_local_fuzzer" = "yes"], [
+               AC_DEFINE(HAVE_LOCAL_FUZZER,, [Enable fuzzer aspects suitable only for local use (not for e.g. OSS-Fuzz)])
+       ])
 ])
 
 AC_DEFUN([DC_DOVECOT],[
index 7bf0150ae9ea33461d57fee0b3b6b0e17c545dda..b75f4ad6e2178fc912fb13847508317c7ab1b749 100644 (file)
@@ -631,12 +631,13 @@ static void fuzz_sasl_run(struct istream *input)
        sasl_server_mech_register_xoauth2(server_inst,
                                          &server_oauth2_funcs, &oauth2_set);
 
+#ifdef HAVE_LOCAL_FUZZER
        struct sasl_server_winbind_settings winbind_set;
 
        i_zero(&winbind_set);
        winbind_set.helper_path = TEST_WINBIND_HELPER_PATH;
        sasl_server_mech_register_winbind_ntlm(server_inst, &winbind_set);
-
+#endif
 #ifdef HAVE_GSSAPI
        struct sasl_server_gssapi_settings gssapi_set;
 
@@ -723,7 +724,9 @@ FUZZ_BEGIN_DATA(const unsigned char *data, size_t size)
 
        password_schemes_init();
        dsasl_clients_init();
+#ifdef HAVE_LOCAL_FUZZER
        dsasl_client_mech_ntlm_init_dummy();
+#endif
 #ifdef HAVE_GSSAPI
        dsasl_clients_init_gssapi();
 #endif