From fc120dd758277d22c00c3a8b9a1d0e1357fd95bf Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 8 Jan 2010 13:37:43 -0700 Subject: s4:ntlmssp: add calc_ntlmv2_key() from source3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit metze Signed-off-by: Günther Deschner --- source4/auth/ntlmssp/ntlmssp_sign.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source4/auth/ntlmssp') 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 -- cgit