]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
pbkdf2: remove second compiled file
authorPauli <ppzgs1@gmail.com>
Thu, 17 Jul 2025 03:24:21 +0000 (13:24 +1000)
committerTomas Mraz <tomas@openssl.org>
Thu, 31 Jul 2025 18:21:25 +0000 (20:21 +0200)
The main source file now depends on FIPS_MODULE so there is no need to have
a second file with a fips flag defined.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27923)

providers/implementations/kdfs/build.info
providers/implementations/kdfs/pbkdf2.c.in
providers/implementations/kdfs/pbkdf2_fips.c [deleted file]

index 3b7687b8f3a5b5987c495751c5b8342dfe15b9ca..debfad12da1232951f8e12edda63aa65b674f91d 100644 (file)
@@ -27,9 +27,6 @@ SOURCE[$KRB5KDF_GOAL]=krb5kdf.c
 SOURCE[$PBKDF1_GOAL]=pbkdf1.c
 
 SOURCE[$PBKDF2_GOAL]=pbkdf2.c
-# Extra code to satisfy the FIPS and non-FIPS separation.
-# When the PBKDF2 moves to legacy, this can be removed.
-SOURCE[$PBKDF2_GOAL]=pbkdf2_fips.c
 
 SOURCE[$PBKDF1_GOAL]=pvkkdf.c
 
index c40879041fdf92c99ad22e7deeb49a127bede695..e7c5fdc0b53d6d45c72aca45ec4794e037b76912 100644 (file)
@@ -153,7 +153,6 @@ static void kdf_pbkdf2_init(KDF_PBKDF2 *ctx)
 {
     OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
     OSSL_LIB_CTX *provctx = PROV_LIBCTX_OF(ctx->provctx);
-    extern const int ossl_kdf_pbkdf2_default_checks;
 
     params[0] = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_DIGEST,
                                                  SN_sha1, 0);
@@ -161,7 +160,11 @@ static void kdf_pbkdf2_init(KDF_PBKDF2 *ctx)
         /* This is an error, but there is no way to indicate such directly */
         ossl_prov_digest_reset(&ctx->digest);
     ctx->iter = PKCS5_DEFAULT_ITER;
-    ctx->lower_bound_checks = ossl_kdf_pbkdf2_default_checks;
+#ifdef FIPS_MODULE
+    ctx->lower_bound_checks = 1;
+#else
+    ctx->lower_bound_checks = 0;
+#endif
 }
 
 static int pbkdf2_set_membuf(unsigned char **buffer, size_t *buflen,
diff --git a/providers/implementations/kdfs/pbkdf2_fips.c b/providers/implementations/kdfs/pbkdf2_fips.c
deleted file mode 100644 (file)
index fb25f18..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*
- * For backwards compatibility reasons,
- * Extra checks are done by default in fips mode only.
- */
-extern const int ossl_kdf_pbkdf2_default_checks;
-#ifdef FIPS_MODULE
-const int ossl_kdf_pbkdf2_default_checks = 1;
-#else
-const int ossl_kdf_pbkdf2_default_checks = 0;
-#endif /* FIPS_MODULE */