]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
maybe OpenSSL 3.0.1 started caring about the output buffer length?
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 23 Dec 2021 01:46:43 +0000 (19:46 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 23 Dec 2021 01:46:43 +0000 (19:46 -0600)
src/lib/util/hmac_md5.c
src/lib/util/hmac_sha1.c

index 913bceeaa3e46005477f9e134ab36fda12cccb86..61e3d408709b7b6da2e51ec78651a83877e7c647 100644 (file)
@@ -92,7 +92,7 @@ int fr_hmac_md5(uint8_t digest[MD5_DIGEST_LENGTH], uint8_t const *in, size_t inl
        /*
         *      OpenSSL <= 1.1.1 requires a non-null pointer for len
         */
-       if (unlikely(EVP_DigestSignFinal(ctx, digest, &(size_t){ 0 }) != 1)) {
+       if (unlikely(EVP_DigestSignFinal(ctx, digest, &(size_t){ MD5_DIGEST_LENGTH }) != 1)) {
                fr_strerror_const("Failed finalising HMAC-MD5");
                goto error;
        }
index 698d8f63df075791328e46e62bbbfe26d6378e3d..f6566abb069160616d9248f0a225f229a9248405 100644 (file)
@@ -97,7 +97,7 @@ int fr_hmac_sha1(uint8_t digest[SHA1_DIGEST_LENGTH], uint8_t const *in, size_t i
        /*
         *      OpenSSL <= 1.1.1 requires a non-null pointer for len
         */
-       if (unlikely(EVP_DigestSignFinal(ctx, digest, &(size_t){ 0 }) != 1)) {
+       if (unlikely(EVP_DigestSignFinal(ctx, digest, &(size_t){ SHA1_DIGEST_LENGTH }) != 1)) {
                fr_strerror_const("Failed finalising HMAC-SHA1");
                goto error;
        }