summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-06-14 11:33:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:40 -0500
commit19f3bfc0ac317cfd3320187d957972ab3fbd3cad (patch)
tree8aef882682cf56d401c3df4aa30c8842eb570f0b /source4/torture/rpc
parenta384d2f1a1d54ba25e2a78006e260c99bd7362f4 (diff)
downloadsamba-19f3bfc0ac317cfd3320187d957972ab3fbd3cad.tar.gz
samba-19f3bfc0ac317cfd3320187d957972ab3fbd3cad.tar.bz2
samba-19f3bfc0ac317cfd3320187d957972ab3fbd3cad.zip
r1140: added IDL and test code for validation level 6 in sam logon
(This used to be commit c8541098436d2cd83538375889560405ecb50034)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/netlogon.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index 2505868af6..55d60871b6 100644
--- a/source4/torture/rpc/netlogon.c
+++ b/source4/torture/rpc/netlogon.c
@@ -421,14 +421,22 @@ static NTSTATUS check_samlogon(struct samlogon_state *samlogon_state,
if (lm_key) {
memcpy(lm_key, r->out.validation.sam3->LMSessKey.key, 8);
+ }
+ } else if (r->in.validation_level == 6) {
+ /* they aren't encrypted! */
+ if (user_session_key) {
+ memcpy(user_session_key, r->out.validation.sam6->key.key, 16);
+ }
+ if (lm_key) {
+ memcpy(lm_key, r->out.validation.sam6->LMSessKey.key, 8);
}
-
}
}
return status;
}
+
/*
* Test the normal 'LM and NTLM' combination
*/
@@ -888,7 +896,7 @@ static BOOL test_SamLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
{
int i, j;
BOOL ret = True;
-
+ int validation_levels[] = {2,3,6};
struct samlogon_state samlogon_state;
samlogon_state.mem_ctx = mem_ctx;
@@ -918,11 +926,12 @@ static BOOL test_SamLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
samlogon_state.r.in.credential = &samlogon_state.auth;
samlogon_state.r.in.return_authenticator = &samlogon_state.auth2;
- for (i=2;i<=3;i++) {
- samlogon_state.r.in.validation_level = i;
+ for (i=0;i<ARRAY_SIZE(validation_levels);i++) {
+ samlogon_state.r.in.validation_level = validation_levels[i];
for (j=0; test_table[j].fn; j++) {
char *error_string = NULL;
- printf("Testing SamLogon with '%s' at validation level %d\n", test_table[j].name, i);
+ printf("Testing SamLogon with '%s' at validation level %d\n",
+ test_table[j].name, validation_levels[i]);
if (!test_table[j].fn(&samlogon_state, &error_string)) {
if (test_table[j].expect_fail) {