summaryrefslogtreecommitdiff
path: root/source4/torture/auth
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-01-22 12:33:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:43:59 -0500
commit0ee01e6fc24fa63daf292b7f358ea627894c1592 (patch)
tree7b5c39169757a492d931c91b8e96d79589bbeaae /source4/torture/auth
parent69d475223db98d0caa2e235e917e2798067c25ff (diff)
downloadsamba-0ee01e6fc24fa63daf292b7f358ea627894c1592.tar.gz
samba-0ee01e6fc24fa63daf292b7f358ea627894c1592.tar.bz2
samba-0ee01e6fc24fa63daf292b7f358ea627894c1592.zip
r20949: Looking over some lcov output, try and walk some error paths.
Andrew Bartlett (This used to be commit 9ed9a032c249461e69242afc2e0ccdd47524064e)
Diffstat (limited to 'source4/torture/auth')
-rw-r--r--source4/torture/auth/ntlmssp.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source4/torture/auth/ntlmssp.c b/source4/torture/auth/ntlmssp.c
index a7c3b03c39..096640301d 100644
--- a/source4/torture/auth/ntlmssp.c
+++ b/source4/torture/auth/ntlmssp.c
@@ -72,6 +72,18 @@ static bool torture_ntlmssp_self_check(struct torture_context *tctx)
torture_assert(tctx, 0 == memcmp(sig.data, expected_sig.data, sig.length),
"data mismatch");
+ 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 (should fail, wrong end)");
+
+ gensec_ntlmssp_state->session_key = data_blob(NULL, 0);
+
+ torture_assert_ntstatus_equal(tctx,
+ gensec_ntlmssp_check_packet(gensec_security, gensec_security,
+ data.data, data.length, data.data, data.length, &sig),
+ NT_STATUS_NO_USER_SESSION_KEY, "Check of just signed packet without a session key should fail");
+
talloc_free(gensec_security);
torture_assert_ntstatus_ok(tctx,
@@ -114,6 +126,11 @@ static bool torture_ntlmssp_self_check(struct torture_context *tctx)
torture_assert(tctx, 0 == memcmp(sig.data+8, expected_sig.data+8, sig.length-8),
"data mismatch");
+ 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 (should fail, wrong end)");
+
talloc_free(gensec_security);
return true;
}