From: Stephan Bosch Date: Tue, 14 Oct 2025 14:35:10 +0000 (+0200) Subject: lib-sasl: fuzz-sasl-authentication - Only fuzz Winbind mechanisms when compiled with... X-Git-Tag: 2.4.2~81 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8536634ada5d3ae267b616e572a1b8a4fe9860c5;p=thirdparty%2Fdovecot%2Fcore.git lib-sasl: fuzz-sasl-authentication - Only fuzz Winbind mechanisms when compiled with --enable-local-fuzzer --- diff --git a/m4/dovecot.m4 b/m4/dovecot.m4 index 6e6bdc2101..1b45bc9a4f 100644 --- a/m4/dovecot.m4 +++ b/m4/dovecot.m4 @@ -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],[ diff --git a/src/lib-sasl/fuzz-sasl-authentication.c b/src/lib-sasl/fuzz-sasl-authentication.c index 7bf0150ae9..b75f4ad6e2 100644 --- a/src/lib-sasl/fuzz-sasl-authentication.c +++ b/src/lib-sasl/fuzz-sasl-authentication.c @@ -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