auth4: 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:29 +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>
source4/auth/ntlm/auth_sam.c

index 449819329d051293306a27974a2a5f10c699abcf..90eabcaf506968c171c0e3dd2e24d81a5c02e3ba 100644 (file)
@@ -289,7 +289,6 @@ static NTSTATUS authsam_password_check_and_record(struct auth4_context *auth_con
        }
 
        for (i = 1; i < MIN(history_len, 3); i++) {
-               static const struct samr_Password zero_hash;
                struct samr_Password zero_string_hash;
                struct samr_Password zero_string_des_hash;
                struct samr_Password *nt_history_pwd = NULL;
@@ -328,8 +327,8 @@ static NTSTATUS authsam_password_check_and_record(struct auth4_context *auth_con
                }
 
                /* Skip over all-zero hashes in the history */
-               if (memcmp(nt_history_pwd->hash, zero_hash.hash, 
-                          sizeof(zero_hash.hash)) == 0) {
+               if (all_zero(nt_history_pwd->hash,
+                            sizeof(nt_history_pwd->hash))) {
                        continue;
                }