Blame SOURCES/0045-FIPS-services-minimize.patch

a74baf
diff -up openssl-3.0.0/providers/fips/fipsprov.c.fipsmin openssl-3.0.0/providers/fips/fipsprov.c
a74baf
--- openssl-3.0.0/providers/fips/fipsprov.c.fipsmin	2022-01-12 17:17:42.574377550 +0100
a74baf
+++ openssl-3.0.0/providers/fips/fipsprov.c	2022-01-12 17:19:57.590598279 +0100
a74baf
@@ -37,6 +37,9 @@ static OSSL_FUNC_provider_query_operatio
a74baf
 
a74baf
 #define ALGC(NAMES, FUNC, CHECK) { { NAMES, FIPS_DEFAULT_PROPERTIES, FUNC }, CHECK }
a74baf
 #define ALG(NAMES, FUNC) ALGC(NAMES, FUNC, NULL)
a74baf
+#define ALGCU(NAMES, FUNC, CHECK) { { NAMES, FIPS_UNAPPROVED_PROPERTIES, FUNC }, CHECK }
a74baf
+#define ALGU(NAMES, FUNC) ALGCU(NAMES, FUNC, NULL)
a74baf
+
a74baf
 
a74baf
 extern OSSL_FUNC_core_thread_start_fn *c_thread_start;
a74baf
 int FIPS_security_check_enabled(OSSL_LIB_CTX *libctx);
a74baf
@@ -264,9 +267,9 @@ static const OSSL_ALGORITHM fips_digests
a74baf
      * KECCAK-KMAC-128 and KECCAK-KMAC-256 as hashes are mostly useful for
a74baf
      * KMAC128 and KMAC256.
a74baf
      */
a74baf
-    { PROV_NAMES_KECCAK_KMAC_128, FIPS_DEFAULT_PROPERTIES,
a74baf
+    { PROV_NAMES_KECCAK_KMAC_128, FIPS_UNAPPROVED_PROPERTIES,
a74baf
       ossl_keccak_kmac_128_functions },
a74baf
-    { PROV_NAMES_KECCAK_KMAC_256, FIPS_DEFAULT_PROPERTIES,
a74baf
+    { PROV_NAMES_KECCAK_KMAC_256, FIPS_UNAPPROVED_PROPERTIES,
a74baf
       ossl_keccak_kmac_256_functions },
a74baf
     { NULL, NULL, NULL }
a74baf
 };
a74baf
@@ -326,8 +329,8 @@ static const OSSL_ALGORITHM_CAPABLE fips
a74baf
     ALGC(PROV_NAMES_AES_256_CBC_HMAC_SHA256, ossl_aes256cbc_hmac_sha256_functions,
a74baf
          ossl_cipher_capable_aes_cbc_hmac_sha256),
a74baf
 #ifndef OPENSSL_NO_DES
a74baf
-    ALG(PROV_NAMES_DES_EDE3_ECB, ossl_tdes_ede3_ecb_functions),
a74baf
-    ALG(PROV_NAMES_DES_EDE3_CBC, ossl_tdes_ede3_cbc_functions),
a74baf
+    ALGU(PROV_NAMES_DES_EDE3_ECB, ossl_tdes_ede3_ecb_functions),
a74baf
+    ALGU(PROV_NAMES_DES_EDE3_CBC, ossl_tdes_ede3_cbc_functions),
a74baf
 #endif  /* OPENSSL_NO_DES */
a74baf
     { { NULL, NULL, NULL }, NULL }
a74baf
 };
a74baf
@@ -339,8 +342,8 @@ static const OSSL_ALGORITHM fips_macs[]
a74baf
 #endif
a74baf
     { PROV_NAMES_GMAC, FIPS_DEFAULT_PROPERTIES, ossl_gmac_functions },
a74baf
     { PROV_NAMES_HMAC, FIPS_DEFAULT_PROPERTIES, ossl_hmac_functions },
a74baf
-    { PROV_NAMES_KMAC_128, FIPS_DEFAULT_PROPERTIES, ossl_kmac128_functions },
a74baf
-    { PROV_NAMES_KMAC_256, FIPS_DEFAULT_PROPERTIES, ossl_kmac256_functions },
a74baf
+    { PROV_NAMES_KMAC_128, FIPS_UNAPPROVED_PROPERTIES, ossl_kmac128_functions },
a74baf
+    { PROV_NAMES_KMAC_256, FIPS_UNAPPROVED_PROPERTIES, ossl_kmac256_functions },
a74baf
     { NULL, NULL, NULL }
a74baf
 };
a74baf
 
a74baf
@@ -375,8 +378,8 @@ static const OSSL_ALGORITHM fips_keyexch
a74baf
 #endif
a74baf
 #ifndef OPENSSL_NO_EC
a74baf
     { PROV_NAMES_ECDH, FIPS_DEFAULT_PROPERTIES, ossl_ecdh_keyexch_functions },
a74baf
-    { PROV_NAMES_X25519, FIPS_DEFAULT_PROPERTIES, ossl_x25519_keyexch_functions },
a74baf
-    { PROV_NAMES_X448, FIPS_DEFAULT_PROPERTIES, ossl_x448_keyexch_functions },
a74baf
+    { PROV_NAMES_X25519, FIPS_UNAPPROVED_PROPERTIES, ossl_x25519_keyexch_functions },
a74baf
+    { PROV_NAMES_X448, FIPS_UNAPPROVED_PROPERTIES, ossl_x448_keyexch_functions },
a74baf
 #endif
a74baf
     { PROV_NAMES_TLS1_PRF, FIPS_DEFAULT_PROPERTIES,
a74baf
       ossl_kdf_tls1_prf_keyexch_functions },
a74baf
@@ -386,12 +389,12 @@ static const OSSL_ALGORITHM fips_keyexch
a74baf
 
a74baf
 static const OSSL_ALGORITHM fips_signature[] = {
a74baf
 #ifndef OPENSSL_NO_DSA
a74baf
-    { PROV_NAMES_DSA, FIPS_DEFAULT_PROPERTIES, ossl_dsa_signature_functions },
a74baf
+    { PROV_NAMES_DSA, FIPS_UNAPPROVED_PROPERTIES, ossl_dsa_signature_functions },
a74baf
 #endif
a74baf
     { PROV_NAMES_RSA, FIPS_DEFAULT_PROPERTIES, ossl_rsa_signature_functions },
a74baf
 #ifndef OPENSSL_NO_EC
a74baf
-    { PROV_NAMES_ED25519, FIPS_DEFAULT_PROPERTIES, ossl_ed25519_signature_functions },
a74baf
-    { PROV_NAMES_ED448, FIPS_DEFAULT_PROPERTIES, ossl_ed448_signature_functions },
a74baf
+    { PROV_NAMES_ED25519, FIPS_UNAPPROVED_PROPERTIES, ossl_ed25519_signature_functions },
a74baf
+    { PROV_NAMES_ED448, FIPS_UNAPPROVED_PROPERTIES, ossl_ed448_signature_functions },
a74baf
     { PROV_NAMES_ECDSA, FIPS_DEFAULT_PROPERTIES, ossl_ecdsa_signature_functions },
a74baf
 #endif
a74baf
     { PROV_NAMES_HMAC, FIPS_DEFAULT_PROPERTIES,
a74baf
@@ -421,7 +424,7 @@ static const OSSL_ALGORITHM fips_keymgmt
a74baf
       PROV_DESCS_DHX },
a74baf
 #endif
a74baf
 #ifndef OPENSSL_NO_DSA
a74baf
-    { PROV_NAMES_DSA, FIPS_DEFAULT_PROPERTIES, ossl_dsa_keymgmt_functions,
a74baf
+    { PROV_NAMES_DSA, FIPS_UNAPPROVED_PROPERTIES, ossl_dsa_keymgmt_functions,
a74baf
       PROV_DESCS_DSA },
a74baf
 #endif
a74baf
     { PROV_NAMES_RSA, FIPS_DEFAULT_PROPERTIES, ossl_rsa_keymgmt_functions,
a74baf
@@ -431,13 +434,13 @@ static const OSSL_ALGORITHM fips_keymgmt
a74baf
 #ifndef OPENSSL_NO_EC
a74baf
     { PROV_NAMES_EC, FIPS_DEFAULT_PROPERTIES, ossl_ec_keymgmt_functions,
a74baf
       PROV_DESCS_EC },
a74baf
-    { PROV_NAMES_X25519, FIPS_DEFAULT_PROPERTIES, ossl_x25519_keymgmt_functions,
a74baf
+    { PROV_NAMES_X25519, FIPS_UNAPPROVED_PROPERTIES, ossl_x25519_keymgmt_functions,
a74baf
       PROV_DESCS_X25519 },
a74baf
-    { PROV_NAMES_X448, FIPS_DEFAULT_PROPERTIES, ossl_x448_keymgmt_functions,
a74baf
+    { PROV_NAMES_X448, FIPS_UNAPPROVED_PROPERTIES, ossl_x448_keymgmt_functions,
a74baf
       PROV_DESCS_X448 },
a74baf
-    { PROV_NAMES_ED25519, FIPS_DEFAULT_PROPERTIES, ossl_ed25519_keymgmt_functions,
a74baf
+    { PROV_NAMES_ED25519, FIPS_UNAPPROVED_PROPERTIES, ossl_ed25519_keymgmt_functions,
a74baf
       PROV_DESCS_ED25519 },
a74baf
-    { PROV_NAMES_ED448, FIPS_DEFAULT_PROPERTIES, ossl_ed448_keymgmt_functions,
a74baf
+    { PROV_NAMES_ED448, FIPS_UNAPPROVED_PROPERTIES, ossl_ed448_keymgmt_functions,
a74baf
       PROV_DESCS_ED448 },
a74baf
 #endif
a74baf
     { PROV_NAMES_TLS1_PRF, FIPS_DEFAULT_PROPERTIES, ossl_kdf_keymgmt_functions,
a74baf
diff -up openssl-3.0.0/test/acvp_test.c.fipsmin openssl-3.0.0/test/acvp_test.c
a74baf
--- openssl-3.0.0/test/acvp_test.c.fipsmin	2022-01-12 18:34:17.283654119 +0100
a74baf
+++ openssl-3.0.0/test/acvp_test.c	2022-01-12 18:35:46.270430676 +0100
a74baf
@@ -1473,6 +1473,7 @@ int setup_tests(void)
a74baf
                   OSSL_NELEM(dh_safe_prime_keyver_data));
a74baf
 #endif /* OPENSSL_NO_DH */
a74baf
 
a74baf
+#if 0 /* Red Hat FIPS provider doesn't have fips=yes property on DSA */
a74baf
 #ifndef OPENSSL_NO_DSA
a74baf
     ADD_ALL_TESTS(dsa_keygen_test, OSSL_NELEM(dsa_keygen_data));
a74baf
     ADD_ALL_TESTS(dsa_paramgen_test, OSSL_NELEM(dsa_paramgen_data));
a74baf
@@ -1480,6 +1481,7 @@ int setup_tests(void)
a74baf
     ADD_ALL_TESTS(dsa_siggen_test, OSSL_NELEM(dsa_siggen_data));
a74baf
     ADD_ALL_TESTS(dsa_sigver_test, OSSL_NELEM(dsa_sigver_data));
a74baf
 #endif /* OPENSSL_NO_DSA */
a74baf
+#endif
a74baf
 
a74baf
 #ifndef OPENSSL_NO_EC
a74baf
     ADD_ALL_TESTS(ecdsa_keygen_test, OSSL_NELEM(ecdsa_keygen_data));