Blame SOURCES/0012-Disable-explicit-ec.patch

727bdf
diff -up openssl-3.0.1/crypto/ec/ec_asn1.c.disable_explicit_ec openssl-3.0.1/crypto/ec/ec_asn1.c
727bdf
--- openssl-3.0.1/crypto/ec/ec_asn1.c.disable_explicit_ec	2022-03-22 13:10:45.718077845 +0100
727bdf
+++ openssl-3.0.1/crypto/ec/ec_asn1.c	2022-03-22 13:12:46.626599016 +0100
727bdf
@@ -895,6 +895,12 @@ EC_GROUP *d2i_ECPKParameters(EC_GROUP **
727bdf
     if (params->type == ECPKPARAMETERS_TYPE_EXPLICIT)
727bdf
         group->decoded_from_explicit_params = 1;
bf760f
 
727bdf
+    if (EC_GROUP_check_named_curve(group, 0, NULL) == NID_undef) {
727bdf
+        EC_GROUP_free(group);
727bdf
+        ECPKPARAMETERS_free(params);
727bdf
+        return NULL;
727bdf
+    }
727bdf
+
727bdf
     if (a) {
727bdf
         EC_GROUP_free(*a);
727bdf
         *a = group;
727bdf
@@ -954,6 +959,11 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, con
727bdf
         goto err;
bf760f
     }
bf760f
 
727bdf
+    if (EC_GROUP_check_named_curve(ret->group, 0, NULL) == NID_undef) {
727bdf
+        ERR_raise(ERR_LIB_EC, EC_R_UNKNOWN_GROUP);
727bdf
+        goto err;
bf760f
+    }
727bdf
+
727bdf
     ret->version = priv_key->version;
bf760f
 
727bdf
     if (priv_key->privateKey) {
727bdf
diff -up openssl-3.0.1/test/endecode_test.c.disable_explicit_ec openssl-3.0.1/test/endecode_test.c
727bdf
--- openssl-3.0.1/test/endecode_test.c.disable_explicit_ec	2022-03-21 16:55:46.005558779 +0100
727bdf
+++ openssl-3.0.1/test/endecode_test.c	2022-03-21 16:56:12.636792762 +0100
727bdf
@@ -57,7 +57,7 @@ static BN_CTX *bnctx = NULL;
727bdf
 static OSSL_PARAM_BLD *bld_prime_nc = NULL;
727bdf
 static OSSL_PARAM_BLD *bld_prime = NULL;
727bdf
 static OSSL_PARAM *ec_explicit_prime_params_nc = NULL;
727bdf
-static OSSL_PARAM *ec_explicit_prime_params_explicit = NULL;
727bdf
+/*static OSSL_PARAM *ec_explicit_prime_params_explicit = NULL;*/
bf760f
 
727bdf
 # ifndef OPENSSL_NO_EC2M
727bdf
 static OSSL_PARAM_BLD *bld_tri_nc = NULL;
727bdf
@@ -990,9 +990,9 @@ IMPLEMENT_TEST_SUITE_LEGACY(EC, "EC")
727bdf
 DOMAIN_KEYS(ECExplicitPrimeNamedCurve);
727bdf
 IMPLEMENT_TEST_SUITE(ECExplicitPrimeNamedCurve, "EC")
727bdf
 IMPLEMENT_TEST_SUITE_LEGACY(ECExplicitPrimeNamedCurve, "EC")
727bdf
-DOMAIN_KEYS(ECExplicitPrime2G);
727bdf
-IMPLEMENT_TEST_SUITE(ECExplicitPrime2G, "EC")
727bdf
-IMPLEMENT_TEST_SUITE_LEGACY(ECExplicitPrime2G, "EC")
727bdf
+/*DOMAIN_KEYS(ECExplicitPrime2G);*/
727bdf
+/*IMPLEMENT_TEST_SUITE(ECExplicitPrime2G, "EC")*/
727bdf
+/*IMPLEMENT_TEST_SUITE_LEGACY(ECExplicitPrime2G, "EC")*/
727bdf
 # ifndef OPENSSL_NO_EC2M
727bdf
 DOMAIN_KEYS(ECExplicitTriNamedCurve);
727bdf
 IMPLEMENT_TEST_SUITE(ECExplicitTriNamedCurve, "EC")
727bdf
@@ -1318,7 +1318,7 @@ int setup_tests(void)
727bdf
         || !create_ec_explicit_prime_params_namedcurve(bld_prime_nc)
727bdf
         || !create_ec_explicit_prime_params(bld_prime)
727bdf
         || !TEST_ptr(ec_explicit_prime_params_nc = OSSL_PARAM_BLD_to_param(bld_prime_nc))
727bdf
-        || !TEST_ptr(ec_explicit_prime_params_explicit = OSSL_PARAM_BLD_to_param(bld_prime))
727bdf
+/*        || !TEST_ptr(ec_explicit_prime_params_explicit = OSSL_PARAM_BLD_to_param(bld_prime))*/
727bdf
 # ifndef OPENSSL_NO_EC2M
727bdf
         || !TEST_ptr(bld_tri_nc = OSSL_PARAM_BLD_new())
727bdf
         || !TEST_ptr(bld_tri = OSSL_PARAM_BLD_new())
727bdf
@@ -1346,7 +1346,7 @@ int setup_tests(void)
727bdf
     TEST_info("Generating EC keys...");
727bdf
     MAKE_DOMAIN_KEYS(EC, "EC", EC_params);
727bdf
     MAKE_DOMAIN_KEYS(ECExplicitPrimeNamedCurve, "EC", ec_explicit_prime_params_nc);
727bdf
-    MAKE_DOMAIN_KEYS(ECExplicitPrime2G, "EC", ec_explicit_prime_params_explicit);
727bdf
+/*    MAKE_DOMAIN_KEYS(ECExplicitPrime2G, "EC", ec_explicit_prime_params_explicit);*/
727bdf
 # ifndef OPENSSL_NO_EC2M
727bdf
     MAKE_DOMAIN_KEYS(ECExplicitTriNamedCurve, "EC", ec_explicit_tri_params_nc);
727bdf
     MAKE_DOMAIN_KEYS(ECExplicitTri2G, "EC", ec_explicit_tri_params_explicit);
727bdf
@@ -1389,8 +1389,8 @@ int setup_tests(void)
727bdf
         ADD_TEST_SUITE_LEGACY(EC);
727bdf
         ADD_TEST_SUITE(ECExplicitPrimeNamedCurve);
727bdf
         ADD_TEST_SUITE_LEGACY(ECExplicitPrimeNamedCurve);
727bdf
-        ADD_TEST_SUITE(ECExplicitPrime2G);
727bdf
-        ADD_TEST_SUITE_LEGACY(ECExplicitPrime2G);
727bdf
+/*        ADD_TEST_SUITE(ECExplicitPrime2G);*/
727bdf
+/*        ADD_TEST_SUITE_LEGACY(ECExplicitPrime2G);*/
727bdf
 # ifndef OPENSSL_NO_EC2M
727bdf
         ADD_TEST_SUITE(ECExplicitTriNamedCurve);
727bdf
         ADD_TEST_SUITE_LEGACY(ECExplicitTriNamedCurve);
727bdf
@@ -1427,7 +1427,7 @@ void cleanup_tests(void)
727bdf
 {
727bdf
 #ifndef OPENSSL_NO_EC
727bdf
     OSSL_PARAM_free(ec_explicit_prime_params_nc);
727bdf
-    OSSL_PARAM_free(ec_explicit_prime_params_explicit);
727bdf
+/*    OSSL_PARAM_free(ec_explicit_prime_params_explicit);*/
727bdf
     OSSL_PARAM_BLD_free(bld_prime_nc);
727bdf
     OSSL_PARAM_BLD_free(bld_prime);
727bdf
 # ifndef OPENSSL_NO_EC2M
727bdf
@@ -1449,7 +1449,7 @@ void cleanup_tests(void)
727bdf
 #ifndef OPENSSL_NO_EC
727bdf
     FREE_DOMAIN_KEYS(EC);
727bdf
     FREE_DOMAIN_KEYS(ECExplicitPrimeNamedCurve);
727bdf
-    FREE_DOMAIN_KEYS(ECExplicitPrime2G);
727bdf
+/*    FREE_DOMAIN_KEYS(ECExplicitPrime2G);*/
727bdf
 # ifndef OPENSSL_NO_EC2M
727bdf
     FREE_DOMAIN_KEYS(ECExplicitTriNamedCurve);
727bdf
     FREE_DOMAIN_KEYS(ECExplicitTri2G);
727bdf
diff -up openssl-3.0.1/test/recipes/30-test_evp_data/evppkey_ecdsa.txt.disable_explicit_ec openssl-3.0.1/test/recipes/30-test_evp_data/evppkey_ecdsa.txt
727bdf
--- openssl-3.0.1/test/recipes/30-test_evp_data/evppkey_ecdsa.txt.disable_explicit_ec	2022-03-25 11:20:50.920949208 +0100
727bdf
+++ openssl-3.0.1/test/recipes/30-test_evp_data/evppkey_ecdsa.txt	2022-03-25 11:21:13.177147598 +0100
727bdf
@@ -121,18 +121,6 @@ AAAA//////////+85vqtpxeehPO5ysL8YyVRAgEB
727bdf
 3ev1gTwRBduzqqlwd54AUSgI+pjttW8zrWNitO8H1sf59MPWOESKxNtZ1+Nl
727bdf
 -----END PRIVATE KEY-----
bf760f
 
727bdf
-PrivateKey = EC_EXPLICIT
727bdf
------BEGIN PRIVATE KEY-----
727bdf
-MIIBeQIBADCCAQMGByqGSM49AgEwgfcCAQEwLAYHKoZIzj0BAQIhAP////8AAAAB
727bdf
-AAAAAAAAAAAAAAAA////////////////MFsEIP////8AAAABAAAAAAAAAAAAAAAA
727bdf
-///////////////8BCBaxjXYqjqT57PrvVV2mIa8ZR0GsMxTsPY7zjw+J9JgSwMV
727bdf
-AMSdNgiG5wSTamZ44ROdJreBn36QBEEE5JcIvn36opqjEm/k59Al40rBAxWM2TPG
727bdf
-l0L13Je51zHpfXQ9Z2o7IQicMXP4wSfJ0qCgg2bgydqoxlYrlLGuVQIhAP////8A
727bdf
-AAAA//////////+85vqtpxeehPO5ysL8YyVRAgEBBG0wawIBAQQgec92jwduadCk
727bdf
-OjoNRI+YT5Be5TkzZXzYCyTLkMOikDmhRANCAATtECEhQbLEaiUj/Wu0qjcr81lL
727bdf
-46dx5zYgArz/iaSNJ3W80oO+F7v04jlQ7wxQzg96R0bwKiMeq5CcW9ZFt6xg
727bdf
------END PRIVATE KEY-----
727bdf
-
727bdf
 PrivateKey = B-163
727bdf
 -----BEGIN PRIVATE KEY-----
727bdf
 MGMCAQAwEAYHKoZIzj0CAQYFK4EEAA8ETDBKAgEBBBUDnQW0mLiHVha/jqFznX/K