libcli:auth: Use GnuTLS MD5 HMAC in SMBsesskeygen_ntv2()
authorAndreas Schneider <asn@samba.org>
Wed, 15 May 2019 06:25:36 +0000 (08:25 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 21 May 2019 00:03:20 +0000 (00:03 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
libcli/auth/smbencrypt.c

index 1c9c7f82270b95bc1a93a5361875622c686769b2..ded22d3175d8727d32e2e6ff59686cc9b94f2349 100644 (file)
@@ -374,12 +374,12 @@ void SMBsesskeygen_ntv2(const uint8_t kr[16],
                        const uint8_t * nt_resp, uint8_t sess_key[16])
 {
        /* a very nice, 128 bit, variable session key */
-
-       HMACMD5Context ctx;
-
-       hmac_md5_init_limK_to_64(kr, 16, &ctx);
-       hmac_md5_update(nt_resp, 16, &ctx);
-       hmac_md5_final((uint8_t *)sess_key, &ctx);
+       gnutls_hmac_fast(GNUTLS_MAC_MD5,
+                        kr,
+                        16,
+                        nt_resp,
+                        16,
+                        sess_key);
 
 #ifdef DEBUG_PASSWORD
        DEBUG(100, ("SMBsesskeygen_ntv2:\n"));