r2515: Fixes from smbtorture - these session keys are not individually encrypted.
authorAndrew Bartlett <abartlet@samba.org>
Wed, 22 Sep 2004 12:17:51 +0000 (12:17 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:59:01 +0000 (12:59 -0500)
Andrew Bartlett

source/rpc_server/netlogon/dcerpc_netlogon.c

index b6182d31c6e416d99b586fd0c4dc6abbc9d60d23..1451e174646e768fe9b6f095337eafeac1fd2ca4 100644 (file)
@@ -604,8 +604,10 @@ static NTSTATUS netr_LogonSamLogonWithFlags(struct dcesrv_call_state *dce_call,
        }
        
        /* Don't crypt an all-zero key, it would give away the NETLOGON pipe session key */
-       if (memcmp(sam->key.key, zeros,  
-                  sizeof(sam->key.key)) != 0) {
+       /* It appears that level 6 is not individually encrypted */
+       if ((r->in.validation_level != 6) 
+           && memcmp(sam->key.key, zeros,  
+                     sizeof(sam->key.key)) != 0) {
                creds_arcfour_crypt(pipe_state->creds, 
                                    sam->key.key, 
                                    sizeof(sam->key.key));
@@ -619,8 +621,10 @@ static NTSTATUS netr_LogonSamLogonWithFlags(struct dcesrv_call_state *dce_call,
        }
        
        /* Don't crypt an all-zero key, it would give away the NETLOGON pipe session key */
-       if (memcmp(sam->LMSessKey.key, zeros,  
-                  sizeof(sam->LMSessKey.key)) != 0) {
+       /* It appears that level 6 is not individually encrypted */
+       if ((r->in.validation_level != 6) 
+           && memcmp(sam->LMSessKey.key, zeros,  
+                     sizeof(sam->LMSessKey.key)) != 0) {
                creds_arcfour_crypt(pipe_state->creds, 
                                    sam->LMSessKey.key, 
                                    sizeof(sam->LMSessKey.key));