16 #define NTLMSSP_NEGOTIATE_LM_KEY 0x00000080
20 int address_list_len,
char *challenge_data,
21 uint8_t *lm_response, uint8_t *nt_response,
22 uint8_t *session_key,
unsigned char *ntlmv2_hash)
25 address_list, address_list_len, lm_response,
26 nt_response, session_key);
31 uint8_t *nt_response, uint8_t *session_key,
32 char *challenge_data,
unsigned char *nt_hash)
34 unsigned char lm_hash[16];
39 uchar session_nonce_hash[16];
40 uchar session_nonce[16];
41 uchar user_session_key[16];
44 memset (lm_response + 8, 0, 16);
46 memcpy (session_nonce, challenge_data, 8);
47 memcpy (&session_nonce[8], lm_response, 8);
49 MD5Init (&md5_session_nonce_ctx);
50 MD5Update (&md5_session_nonce_ctx, (
unsigned char const *) challenge_data, 8);
51 MD5Update (&md5_session_nonce_ctx, (
unsigned char const *) lm_response, 8);
52 MD5Final (session_nonce_hash, &md5_session_nonce_ctx);
56 hmac_md5 (user_session_key, session_nonce,
sizeof (session_nonce),
62 uint8_t *nt_response, uint8_t *session_key,
63 char *challenge_data,
unsigned char *nt_hash,
66 unsigned char lm_hash[16];
86 unsigned char *nt_hash, uint8_t *new_sess_key)
89 uint8 client_session_key[16];
91 (void) challenge_data;
94 sizeof (client_session_key));
97 size_t length =
sizeof (client_session_key);
98 uint8_t *encrypted_session_key = g_malloc0 (
length);
100 memcpy (encrypted_session_key, client_session_key,
length);
102 memcpy (new_sess_key, client_session_key, 16);
103 return encrypted_session_key;