From c791ad4131fb11dc96013abc8e247cbbec5ba8ee Mon Sep 17 00:00:00 2001
From: Simo Sorce <simo@redhat.com>
Date: Thu, 13 Feb 2025 18:16:29 -0500
Subject: [PATCH 39/59] FIPS: PKCS12: PBMAC1 defaults

From-dist-git-commit: 8fc2d4842385584094d57f6f66fcbc2a07865708
---
 apps/pkcs12.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/apps/pkcs12.c b/apps/pkcs12.c
index 9964faf21a..59439a8cc0 100644
--- a/apps/pkcs12.c
+++ b/apps/pkcs12.c
@@ -17,6 +17,7 @@
 #include <openssl/asn1.h>
 #include <openssl/crypto.h>
 #include <openssl/err.h>
+#include <openssl/evp.h>
 #include <openssl/pem.h>
 #include <openssl/pkcs12.h>
 #include <openssl/provider.h>
@@ -709,6 +710,9 @@ int pkcs12_main(int argc, char **argv)
         }
 
         if (maciter != -1) {
+            if (EVP_default_properties_is_fips_enabled(NULL))
+                pbmac1_pbkdf2 = 1;
+
             if (pbmac1_pbkdf2 == 1) {
                 if (!PKCS12_set_pbmac1_pbkdf2(p12, mpass, -1, NULL,
                                               macsaltlen, maciter,
-- 
2.51.0

