From: Aki Tuomi Date: Wed, 6 May 2020 10:12:33 +0000 (+0300) Subject: auth: mech - Remove redundant NUL checks X-Git-Tag: 2.3.11.2~107 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f6bf02c2558d37847f5cedf7f6efb1b34cff4e0;p=thirdparty%2Fdovecot%2Fcore.git auth: mech - Remove redundant NUL checks Partially reverts ce7a61301cb233647c447dd917d5df1184d02317 The check is moved to higher up in call chain. --- diff --git a/src/auth/mech-external.c b/src/auth/mech-external.c index 512288b743..b9a287b2fc 100644 --- a/src/auth/mech-external.c +++ b/src/auth/mech-external.c @@ -11,9 +11,6 @@ mech_external_auth_continue(struct auth_request *request, { const char *authzid, *error; - if (auth_request_fail_on_nuls(request, data, data_size)) - return; - authzid = t_strndup(data, data_size); if (request->user == NULL) { e_info(request->mech_event, diff --git a/src/auth/mech-login.c b/src/auth/mech-login.c index 4a8a41a166..e4da330b93 100644 --- a/src/auth/mech-login.c +++ b/src/auth/mech-login.c @@ -20,9 +20,6 @@ mech_login_auth_continue(struct auth_request *request, static const char prompt2[] = "Password:"; const char *username, *error; - if (auth_request_fail_on_nuls(request, data, data_size)) - return; - if (request->user == NULL) { username = t_strndup(data, data_size); diff --git a/src/auth/mech-otp.c b/src/auth/mech-otp.c index 16aec961eb..1b7ae8393a 100644 --- a/src/auth/mech-otp.c +++ b/src/auth/mech-otp.c @@ -23,9 +23,6 @@ otp_send_challenge(struct auth_request *auth_request, (struct otp_auth_request *)auth_request; const char *answer; - if (auth_request_fail_on_nuls(auth_request, credentials, size)) - return; - if (otp_parse_dbentry(t_strndup(credentials, size), &request->state) != 0) { e_error(request->auth_request.mech_event, @@ -204,9 +201,6 @@ static void mech_otp_auth_phase2(struct auth_request *auth_request, const unsigned char *data, size_t data_size) { - if (auth_request_fail_on_nuls(auth_request, data, data_size)) - return; - const char *str = t_strndup(data, data_size); if (str_begins(str, "hex:")) { diff --git a/src/auth/mech-scram.c b/src/auth/mech-scram.c index 14f556bb12..35fedc91ab 100644 --- a/src/auth/mech-scram.c +++ b/src/auth/mech-scram.c @@ -361,9 +361,6 @@ void mech_scram_auth_continue(struct auth_request *auth_request, const char *server_final_message; size_t len; - if (auth_request_fail_on_nuls(auth_request, data, data_size)) - return; - if (request->client_first_message_bare == NULL) { /* Received client-first-message */ if (parse_scram_client_first(request, data, diff --git a/src/auth/mech-skey.c b/src/auth/mech-skey.c index 7ba2db8661..d6819a8590 100644 --- a/src/auth/mech-skey.c +++ b/src/auth/mech-skey.c @@ -162,9 +162,6 @@ static void mech_skey_auth_continue(struct auth_request *auth_request, const unsigned char *data, size_t data_size) { - if (auth_request_fail_on_nuls(auth_request, data, data_size)) - return; - if (auth_request->user == NULL) { mech_skey_auth_phase1(auth_request, data, data_size); } else {