summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-01-08 13:37:43 -0700
committerGünther Deschner <gd@samba.org>2010-03-24 17:34:53 +0100
commitfc120dd758277d22c00c3a8b9a1d0e1357fd95bf (patch)
treeff5feae8c873b127624d6dc566206ceca186b6a9
parente0c7d9c8aa10ee0eb927d248b3d46fb0f0a52524 (diff)
downloadsamba-fc120dd758277d22c00c3a8b9a1d0e1357fd95bf.tar.gz
samba-fc120dd758277d22c00c3a8b9a1d0e1357fd95bf.tar.bz2
samba-fc120dd758277d22c00c3a8b9a1d0e1357fd95bf.zip
s4:ntlmssp: add calc_ntlmv2_key() from source3
metze Signed-off-by: Günther Deschner <gd@samba.org>
-rw-r--r--source4/auth/ntlmssp/ntlmssp_sign.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source4/auth/ntlmssp/ntlmssp_sign.c b/source4/auth/ntlmssp/ntlmssp_sign.c
index 56d7cbac59..5466b52d47 100644
--- a/source4/auth/ntlmssp/ntlmssp_sign.c
+++ b/source4/auth/ntlmssp/ntlmssp_sign.c
@@ -53,6 +53,17 @@ static void calc_ntlmv2_key_talloc(TALLOC_CTX *mem_ctx,
MD5Final(subkey->data, &ctx3);
}
+static void calc_ntlmv2_key(uint8_t subkey[16],
+ DATA_BLOB session_key,
+ const char *constant)
+{
+ struct MD5Context ctx3;
+ MD5Init(&ctx3);
+ MD5Update(&ctx3, session_key.data, session_key.length);
+ MD5Update(&ctx3, (const uint8_t *)constant, strlen(constant)+1);
+ MD5Final(subkey, &ctx3);
+}
+
enum ntlmssp_direction {
NTLMSSP_SEND,
NTLMSSP_RECEIVE