1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

torture-samlogon: Use "all_zero" where appropriate

... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Volker Lendecke 2016-12-31 12:45:51 +00:00 committed by Ralph Boehme
parent 6eeb3ec3ab
commit b3d5fe9679

View File

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