diff options
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/auth/credentials.c | 21 |
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) |