From: Alan T. DeKok Date: Wed, 17 Oct 2018 17:51:39 +0000 (-0400) Subject: OpenSSL can die in a fire. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3a985c96108b9d78fda8675722820eaafec4e2c0;p=thirdparty%2Ffreeradius-server.git OpenSSL can die in a fire. They deprecated one API. And then added another one, which does the same thing, but has a different name. --- diff --git a/src/lib/util/hmac_md5.c b/src/lib/util/hmac_md5.c index 8f93f57998b..7aa9fa61a22 100644 --- a/src/lib/util/hmac_md5.c +++ b/src/lib/util/hmac_md5.c @@ -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 diff --git a/src/lib/util/hmac_sha1.c b/src/lib/util/hmac_sha1.c index 24c66bdeb2b..4eaf726b86b 100644 --- a/src/lib/util/hmac_sha1.c +++ b/src/lib/util/hmac_sha1.c @@ -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