summaryrefslogtreecommitdiff
path: root/source4/libcli/auth/credentials.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-11-11 04:32:01 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:43 -0500
commita8db4dcf03bccb2e1b954d097e758d6c7780db9e (patch)
tree6f91b3623b76da1da8194efd04fcce048fcfaf33 /source4/libcli/auth/credentials.c
parent5afda90c95e2e120f1121afb6b9fe7f5222ffa1e (diff)
downloadsamba-a8db4dcf03bccb2e1b954d097e758d6c7780db9e.tar.gz
samba-a8db4dcf03bccb2e1b954d097e758d6c7780db9e.tar.bz2
samba-a8db4dcf03bccb2e1b954d097e758d6c7780db9e.zip
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)
Diffstat (limited to 'source4/libcli/auth/credentials.c')
-rw-r--r--source4/libcli/auth/credentials.c21
1 files changed, 21 insertions, 0 deletions
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
@@ -129,6 +130,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
*/
void creds_des_encrypt(struct creds_CredentialState *creds, struct samr_Password *pass)