diff options
author | Andrew Bartlett <abartlet@samba.org> | 2007-01-28 07:58:39 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:44:23 -0500 |
commit | 0f01aae9145176e54569fc19a5ec4ab61b9031a5 (patch) | |
tree | 7baf93f517ca30d4a2c520947b4366346b0938b4 /source4 | |
parent | 2096b36411ded686cf1c5497eb4ce2ec2bcdf09a (diff) | |
download | samba-0f01aae9145176e54569fc19a5ec4ab61b9031a5.tar.gz samba-0f01aae9145176e54569fc19a5ec4ab61b9031a5.tar.bz2 samba-0f01aae9145176e54569fc19a5ec4ab61b9031a5.zip |
r21039: Test some more failure paths (trying to increase the lcov score).
Andrew Bartlett
(This used to be commit 76812a0337fbfcb19939c6ee7a57975b6d690a4d)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/auth/ntlmssp/ntlmssp_sign.c | 5 | ||||
-rw-r--r-- | source4/torture/auth/ntlmssp.c | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/source4/auth/ntlmssp/ntlmssp_sign.c b/source4/auth/ntlmssp/ntlmssp_sign.c index 52cbf01ea9..e560ad62dd 100644 --- a/source4/auth/ntlmssp/ntlmssp_sign.c +++ b/source4/auth/ntlmssp/ntlmssp_sign.c @@ -167,11 +167,6 @@ NTSTATUS gensec_ntlmssp_check_packet(struct gensec_security *gensec_security, return NT_STATUS_NO_USER_SESSION_KEY; } - if (sig->length < 8) { - DEBUG(1, ("NTLMSSP packet check failed due to short signature (%lu bytes)!\n", - (unsigned long)sig->length)); - } - nt_status = ntlmssp_make_packet_signature(gensec_ntlmssp_state, sig_mem_ctx, data, length, whole_pdu, pdu_length, diff --git a/source4/torture/auth/ntlmssp.c b/source4/torture/auth/ntlmssp.c index 096640301d..1b52b52647 100644 --- a/source4/torture/auth/ntlmssp.c +++ b/source4/torture/auth/ntlmssp.c @@ -131,6 +131,13 @@ static bool torture_ntlmssp_self_check(struct torture_context *tctx) data.data, data.length, data.data, data.length, &sig), NT_STATUS_ACCESS_DENIED, "Check of just signed packet (should fail, wrong end)"); + sig.length /= 2; + + torture_assert_ntstatus_equal(tctx, + gensec_ntlmssp_check_packet(gensec_security, gensec_security, + data.data, data.length, data.data, data.length, &sig), + NT_STATUS_ACCESS_DENIED, "Check of just signed packet with short sig"); + talloc_free(gensec_security); return true; } |