From a8db4dcf03bccb2e1b954d097e758d6c7780db9e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 11 Nov 2004 04:32:01 +0000 Subject: r3677: Seperate the SamLogon tests from the main RPC-NETLOGON test into a RPC-SAMLOGON of their own. I have expanded the tests to validate the use of various flags, which change some of the crypto behaviour. Andrew Bartlett (This used to be commit 3a140a3691ce49ebf4d1efcb99cfffd26c68a28f) --- source4/libcli/auth/credentials.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'source4/libcli') diff --git a/source4/libcli/auth/credentials.c b/source4/libcli/auth/credentials.c index a09d767e89..ec41ebf4bd 100644 --- a/source4/libcli/auth/credentials.c +++ b/source4/libcli/auth/credentials.c @@ -25,6 +25,7 @@ #include "system/time.h" #include "auth/auth.h" #include "lib/crypto/crypto.h" +#include "librpc/gen_ndr/ndr_netlogon.h" /* initialise the credentials state for old-style 64 bit session keys @@ -128,6 +129,26 @@ static void creds_step(struct creds_CredentialState *creds) } +/* + DES encrypt a 8 byte LMSessionKey buffer using the Netlogon session key +*/ +void creds_des_encrypt_LMKey(struct creds_CredentialState *creds, struct netr_LMSessionKey *key) +{ + struct netr_LMSessionKey tmp; + des_crypt56(tmp.key, key->key, creds->session_key, 1); + *key = tmp; +} + +/* + DES decrypt a 8 byte LMSessionKey buffer using the Netlogon session key +*/ +void creds_des_decrypt_LMKey(struct creds_CredentialState *creds, struct netr_LMSessionKey *key) +{ + struct netr_LMSessionKey tmp; + des_crypt56(tmp.key, key->key, creds->session_key, 0); + *key = tmp; +} + /* DES encrypt a 16 byte password buffer using the session key */ -- cgit