]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
OpenSSL can die in a fire.
authorAlan T. DeKok <aland@freeradius.org>
Wed, 17 Oct 2018 17:51:39 +0000 (13:51 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 17 Oct 2018 17:51:39 +0000 (13:51 -0400)
They deprecated one API.  And then added another one, which does
the same thing, but has a different name.

src/lib/util/hmac_md5.c
src/lib/util/hmac_sha1.c

index 8f93f57998b22821d79363a2622c2a7130b35bce..7aa9fa61a22495dc706966c9b4f677505eb4c5e0 100644 (file)
@@ -74,7 +74,11 @@ void fr_hmac_md5(uint8_t digest[MD5_DIGEST_LENGTH], uint8_t const *text, size_t
        HMAC_Init_ex(ctx, key, key_len, EVP_md5(), NULL);
        HMAC_Update(ctx, text, text_len);
        HMAC_Final(ctx, digest, NULL);
+#if OPENSSL_VERSION_NUMBER < 0x10001000L
        HMAC_CTX_cleanup(ctx);
+#else
+       HMAC_CTX_reset(ctx);
+#endif
 }
 #else
 /** Calculate HMAC using internal MD5 implementation
index 24c66bdeb2b70533ee0a4628aedf7ca777df0824..4eaf726b86bb69c284ffa413f4c78ce83017eb40 100644 (file)
@@ -74,7 +74,11 @@ void fr_hmac_sha1(uint8_t digest[SHA1_DIGEST_LENGTH], uint8_t const *text, size_
        HMAC_Init_ex(ctx, key, key_len, EVP_sha1(), NULL);
        HMAC_Update(ctx, text, text_len);
        HMAC_Final(ctx, digest, NULL);
+#if OPENSSL_VERSION_NUMBER < 0x10001000L
        HMAC_CTX_cleanup(ctx);
+#else
+       HMAC_CTX_reset(ctx);
+#endif
 }
 
 #else