diff options
-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; } |