libcli: Use "all_zero" where appropriate
authorVolker Lendecke <vl@samba.org>
Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)
committerRalph Boehme <slow@samba.org>
Tue, 3 Jan 2017 15:04:28 +0000 (16:04 +0100)
... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
libcli/auth/ntlm_check.c

index 7f91b52a5fd78982d85a300dc610329a7bd9a801..d7fba34cdba6ad934f591b6d9510528491bf7739 100644 (file)
@@ -293,7 +293,6 @@ NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx,
                             DATA_BLOB *user_sess_key, 
                             DATA_BLOB *lm_sess_key)
 {
-       const static uint8_t zeros[8];
        DATA_BLOB tmp_sess_key;
        const char *upper_client_domain = NULL;
 
@@ -314,8 +313,8 @@ NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx,
 
        /* Check for cleartext netlogon. Used by Exchange 5.5. */
        if ((logon_parameters & MSV1_0_CLEARTEXT_PASSWORD_ALLOWED)
-           && challenge->length == sizeof(zeros) 
-           && (memcmp(challenge->data, zeros, challenge->length) == 0 )) {
+           && challenge->length == 8
+           && (all_zero(challenge->data, challenge->length))) {
                struct samr_Password client_nt;
                struct samr_Password client_lm;
                char *unix_pw = NULL;