From: Nikos Mavrogiannopoulos Date: Fri, 22 Nov 2013 15:36:27 +0000 (+0100) Subject: Use the internal API for MD5 hashing in openssl keys. X-Git-Tag: gnutls_3_3_0pre0~520^2~42 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=982f9ccbf3fbcb8d760f3c0b4f9eac369490f7f6;p=thirdparty%2Fgnutls.git Use the internal API for MD5 hashing in openssl keys. --- diff --git a/lib/x509/privkey_openssl.c b/lib/x509/privkey_openssl.c index 03bbd64e96..3c110bc8c3 100644 --- a/lib/x509/privkey_openssl.c +++ b/lib/x509/privkey_openssl.c @@ -39,39 +39,39 @@ openssl_hash_password(const char *pass, gnutls_datum_t * key, gnutls_datum_t * salt) { unsigned char md5[16]; - gnutls_hash_hd_t hash; + digest_hd_st hd; unsigned int count = 0; int err; while (count < key->size) { - err = gnutls_hash_init(&hash, GNUTLS_DIG_MD5); + err = _gnutls_hash_init(&hd, mac_to_entry(GNUTLS_MAC_MD5)); if (err) { gnutls_assert(); return err; } if (count) { - err = gnutls_hash(hash, md5, sizeof(md5)); + err = _gnutls_hash(&hd, md5, sizeof(md5)); if (err) { hash_err: - gnutls_hash_deinit(hash, NULL); + _gnutls_hash_deinit(&hd, NULL); gnutls_assert(); return err; } } if (pass) { - err = gnutls_hash(hash, pass, strlen(pass)); + err = _gnutls_hash(&hd, pass, strlen(pass)); if (err) { gnutls_assert(); goto hash_err; } } - err = gnutls_hash(hash, salt->data, 8); + err = _gnutls_hash(&hd, salt->data, 8); if (err) { gnutls_assert(); goto hash_err; } - gnutls_hash_deinit(hash, md5); + _gnutls_hash_deinit(&hd, md5); if (key->size - count <= sizeof(md5)) { memcpy(&key->data[count], md5, key->size - count);