]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
torture-samlogon: 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/torture/rpc/samlogon.c

index cefc4f59d0605704020f72920486f271bf8cb8a1..bd42ec98085cad7b252c2316ccee4b36fe5f0f9b 100644 (file)
@@ -921,14 +921,11 @@ static bool test_lmv2_ntlm_broken(struct samlogon_state *samlogon_state,
                                pass = false;
                        }
                } else {
-                       static const uint8_t zeros[8];
-                       if (memcmp(zeros, lm_session_key,
-                                  sizeof(lm_session_key)) != 0) {
+                       if (!all_zero(lm_session_key,
+                                     sizeof(lm_session_key))) {
                                torture_comment(samlogon_state->tctx, "LM Session Key does not match expectations (zeros)!\n");
                                torture_comment(samlogon_state->tctx, "lm_session_key:\n");
                                dump_data(1, lm_session_key, 8);
-                               torture_comment(samlogon_state->tctx, "expected:\n");
-                               dump_data(1, zeros, 8);
                                pass = false;
                        }
                }
@@ -1176,14 +1173,10 @@ static bool test_ntlm2(struct samlogon_state *samlogon_state, char **error_strin
                        pass = false;
                }
        } else {
-               static const uint8_t zeros[8];
-               if (memcmp(zeros, lm_key,
-                          sizeof(lm_key)) != 0) {
+               if (!all_zero(lm_key, sizeof(lm_key))) {
                        torture_comment(samlogon_state->tctx, "LM Session Key does not match expectations (zeros)!\n");
                        torture_comment(samlogon_state->tctx, "lm_key:\n");
                        dump_data(1, lm_key, 8);
-                       torture_comment(samlogon_state->tctx, "expected:\n");
-                       dump_data(1, zeros, 8);
                        pass = false;
                }
        }