]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use OpenSSL versions instead of configure output to check for evp_sha3_512
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 16 May 2019 05:56:57 +0000 (01:56 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 16 May 2019 05:56:57 +0000 (01:56 -0400)
src/modules/rlm_pap/rlm_pap.c

index adc6dbf2e80b29d3a2571c9c382e139d647c5bd0..efb30b541a56dd8c5b7a9a87eb5e993508b1278d 100644 (file)
@@ -160,7 +160,7 @@ static const FR_NAME_NUMBER header_names[] = {
        { "{ssha256}",          FR_SSHA2_256_PASSWORD },
        { "{ssha384}",          FR_SSHA2_384_PASSWORD },
        { "{ssha512}",          FR_SSHA2_512_PASSWORD },
-#  ifdef HAVE_EVP_SHA3_512
+#  if OPENSSL_VERSION_NUMBER >= 0x10101000L
        { "{ssha3-224}",        FR_SSHA3_224_PASSWORD },
        { "{ssha3-256}",        FR_SSHA3_256_PASSWORD },
        { "{ssha3-384}",        FR_SSHA3_384_PASSWORD },
@@ -187,7 +187,7 @@ static const FR_NAME_NUMBER pbkdf2_crypt_names[] = {
        { "HMACSHA2+256",       FR_SSHA2_256_PASSWORD },
        { "HMACSHA2+384",       FR_SSHA2_384_PASSWORD },
        { "HMACSHA2+512",       FR_SSHA2_512_PASSWORD },
-#  ifdef HAVE_EVP_SHA3_512
+#if OPENSSL_VERSION_NUMBER >= 0x10101000L
        { "HMACSHA3+224",       FR_SSHA3_224_PASSWORD },
        { "HMACSHA3+256",       FR_SSHA3_256_PASSWORD },
        { "HMACSHA3+384",       FR_SSHA3_384_PASSWORD },
@@ -552,7 +552,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authorize(void *instance, UNUSED void *t
                        if (inst->normify) normify(request, vp, 64); /* ensure it's in the right format */
                        found_pw = true;
                }
-#  ifdef HAVE_EVP_SHA3_512
+#  if OPENSSL_VERSION_NUMBER >= 0x10101000L
                else if (vp->da == attr_sha3_password) {
                        if (inst->normify) normify(request, vp, 28); /* ensure it's in the right format */
                        found_pw = true;
@@ -825,7 +825,7 @@ static rlm_rcode_t CC_HINT(nonnull) pap_auth_sha_evp(rlm_pap_t const *inst, REQU
                        return RLM_MODULE_INVALID;
                }
        }
-# ifdef HAVE_EVP_SHA3_512
+#  if OPENSSL_VERSION_NUMBER >= 0x10101000L
        else if (vp->da == attr_sha3_password) {
                RDEBUG2("Comparing with \"known-good\" SHA3-Password");
                /*
@@ -913,7 +913,7 @@ static rlm_rcode_t CC_HINT(nonnull) pap_auth_ssha_evp(rlm_pap_t const *inst, REQ
                min_len = SHA512_DIGEST_LENGTH;
                md = EVP_sha512();
        }
-#ifdef HAVE_EVP_SHA3_512
+#if OPENSSL_VERSION_NUMBER >= 0x10101000L
        else if (vp->da == attr_ssha3_224_password) {
                name = "SSHA3-224";
                md = EVP_sha3_224();
@@ -1436,7 +1436,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authenticate(void *instance, UNUSED void
                }
 #ifdef HAVE_OPENSSL_EVP_H
                else if (vp->da == attr_sha2_password
-#  ifdef HAVE_EVP_SHA3_512
+#  if OPENSSL_VERSION_NUMBER >= 0x10101000L
                         || (vp->da == attr_sha3_password)
 #  endif
                        ) {
@@ -1445,7 +1445,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authenticate(void *instance, UNUSED void
                    (vp->da == attr_ssha2_256_password) ||
                    (vp->da == attr_ssha2_384_password) ||
                    (vp->da == attr_ssha2_512_password)
-#  ifdef HAVE_EVP_SHA3_512
+#  if OPENSSL_VERSION_NUMBER >= 0x10101000L
                    || (vp->da == attr_ssha3_224_password) ||
                    (vp->da == attr_ssha3_256_password) ||
                    (vp->da == attr_ssha3_384_password) ||