summaryrefslogtreecommitdiff
path: root/dev-libs/openssl
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2025-03-29 00:32:16 +0000
committerV3n3RiX <venerix@koprulu.sector>2025-03-29 00:32:16 +0000
commitad108e7b751d67723534624b94eb0e04250dd1af (patch)
treeb2c2e47b9c23ac5a70d7170b3ba364b32da31944 /dev-libs/openssl
parentc44ae5c03130467400468d0e9a7f83e723c99f35 (diff)
gentoo auto-resync : 29:03:2025 - 00:32:15
Diffstat (limited to 'dev-libs/openssl')
-rw-r--r--dev-libs/openssl/Manifest5
-rw-r--r--dev-libs/openssl/files/openssl-3.0.15-CVE-2024-9143.patch193
-rw-r--r--dev-libs/openssl/files/openssl-3.1.7-CVE-2024-9143.patch192
-rw-r--r--dev-libs/openssl/files/openssl-3.2.3-CVE-2024-9143.patch193
-rw-r--r--dev-libs/openssl/files/openssl-3.3.2-CVE-2024-9143.patch193
-rw-r--r--dev-libs/openssl/files/openssl-3.3.2-arm64-clobber.patch55
6 files changed, 0 insertions, 831 deletions
diff --git a/dev-libs/openssl/Manifest b/dev-libs/openssl/Manifest
index 35f7c0b64fec..2f4c10bcc957 100644
--- a/dev-libs/openssl/Manifest
+++ b/dev-libs/openssl/Manifest
@@ -2,11 +2,6 @@ AUX gentoo.config-1.0.2 5302 BLAKE2B b699533ed86c48c0d033092b4d901de837a6a495113
AUX gentoo.config-1.0.4 6038 BLAKE2B e2fd6b073cc6be3fa312a73cf031140e3f91eafe432212f8b24795297fdd0a4090d605fcfcbc59df6cc9f659a3dcd0e56df8eb734aa117d5e1f4fe78b4063f8c SHA512 df7c9944b993536df7ff8cd5159ba1534b122fb1db946890e7b25b10596c9259e569e0e3a5fe854726ac8302eb9804edb7af344386b146146d862596175d5ca2
AUX openssl-1.1.0j-parallel_install_fix.patch 515 BLAKE2B a1bcffce4dc9e0566e21e753cf1a18ee6eac92aca5880c50b33966d8ecb391f7430e1db6ea5a30ee4e3a9d77fb9e5542e864508b01c325011e368165e079a96c SHA512 0badd29ec8cffd95b2b69a4b8f8eecfc9ea0c00a812b298a650ee353e3965147fd2da1f9058d2d51744838f38168257b89aaf317287c55a7b76f16a69c781828
AUX openssl-1.1.1i-riscv32.patch 2557 BLAKE2B 97e51303706ee96d3fae46959b91d1021dcbb3efa421866f6e09bbee6287aae95c6f5d9498bd9d8974b0de747ef696242691cfebec90b31dc9e2cc31b41b81ec SHA512 f75ae1034bb9dda7f4959e8a5d6d0dae21200723d82aebfbea58bd1d7775ef4042e49fdf49d5738771d79d764e44a1b6e0da341d210ea51d21516bb3874b626a
-AUX openssl-3.0.15-CVE-2024-9143.patch 7034 BLAKE2B 79963b250e9faa0a9764945d05f0598c0eda64ac87b12e545698d86c299c769b1ff8300f3289e620fe58183db0d1767834d6d146ce6cdacdeb58c137e88d79fa SHA512 6196f8c963c776ae3412ca76da51060d95e4f50cf1a1e4edb89edf9d32a7dd032a7f650445872a68a6f03dab4b75b601cae4c89e2fda9cf414c7ff26961433c2
-AUX openssl-3.1.7-CVE-2024-9143.patch 7033 BLAKE2B 1e2d8ea24fd68e2781808477d60773a3cca5bf122ba3c2a0efba12470126a5768a2f2fa0239a73965bf046644e93d6deecda17e4282243206095c42f3149fb5e SHA512 44185ace09adb75f8124f8a564d1f806fb6fd29e232a6c1f40b1508f510c8b481f86f06d03e169ed6dd2df1e535b723a2f9978199b20225a1e27f499054b7bc7
-AUX openssl-3.2.3-CVE-2024-9143.patch 7034 BLAKE2B 7f438bb531b09154368072f66e03fa4fa1c0f1d461ce8e89e942567e9cf60ce0d1986334cbd9c4d8e9b5ea5dc7c2ca0fa5dc111c965d99ebf6800afdd56820ab SHA512 7699ea05a139a7ddcbf68538cfb4329026d99ffa8eb3622b3f0faca92b287f571c6b76c24acd537a3406f209bf90a48704d11ed70d0e49c118d1591b9bae39d2
-AUX openssl-3.3.2-CVE-2024-9143.patch 7034 BLAKE2B 3800addbe31b551224032736f44b9cce721ad6897edfddc6a1db3599e7c7b94e1e4074db8da5883a4439944eb96511fdecae7634bac8ad9a5c2dd11dc2bdf895 SHA512 55449d68c57abc83295de5c869f5b65472c929a29befec7bf74797a3b902febc001535b3c06fe9792d09bd431e72f4d9a2079879c5766acc6adf1359b7d954aa
-AUX openssl-3.3.2-arm64-clobber.patch 1733 BLAKE2B f0fe162cff941bc9051dea3c0d913fd1ccc8c4587d5c75aea57430f2ad363ac3262d2ef725c80aa2414942d5a10cc19b635c9b931a5299448c8408495e37704a SHA512 9833aecaf084e39208865ddca006cd5e0bb191d05ccf2accffbc158f05aa3d7787b22bca21d1523122ebe69c80d5015915c89840e508749d073d38c519ce4d19
AUX openssl-3.3.2-silence-warning.patch 1078 BLAKE2B 6f7852229a7ac21f217d32efa8075a8612e412444998671c05814c9e581359aa32fd8555abd6d507cd55f4af9aeebb99055c3a376f7f63dc9255090a1fb8d4f5 SHA512 2c91da767be085479e78ee5b20f0c29124da68761157964db67e45e5a3398b3a402837ab611d6e27e4a261912ed08d08387d3b6cdd1168b0da24b808e80fbe52
DIST openssl-1.0.2-patches-1.5.tar.xz 12404 BLAKE2B 6c1b8c28f339f539b2ab8643379502a24cf62bffde00041dce54d5dd9e8d2620b181362ee5464b0ab32ba4948e209697bfabadbea2944a409a1009100d298f24 SHA512 5725e2d9d1ee8cc074bcef3bed61c71bdab2ff1c114362110c3fb8da11ad5bc8f2ff28e90a293f5f3a5cf96ecda54dffdb7ab3fb3f8b23ef6472250dc3037659
DIST openssl-1.0.2t-bindist-1.0.tar.xz 13872 BLAKE2B b2aade96a6e0ca6209a39e205b1c838de945903fcf959c62cc29ddcd1a0cb360fc5db234df86860a6a4c096f5ecc237611e4c2946b986a5500c24ba93c208ef4 SHA512 a48a7efb9b973b865bcc5009d450b428ed6b4b95e4cefe70c51056e47392c8a7bec58215168d8b07712419dc74646c2bd2fd23bcfbba2031376e292249a6b1b6
diff --git a/dev-libs/openssl/files/openssl-3.0.15-CVE-2024-9143.patch b/dev-libs/openssl/files/openssl-3.0.15-CVE-2024-9143.patch
deleted file mode 100644
index 252a24776ae8..000000000000
--- a/dev-libs/openssl/files/openssl-3.0.15-CVE-2024-9143.patch
+++ /dev/null
@@ -1,193 +0,0 @@
-https://bugs.gentoo.org/941643
-https://github.com/openssl/openssl/commit/72ae83ad214d2eef262461365a1975707f862712
-
-From 72ae83ad214d2eef262461365a1975707f862712 Mon Sep 17 00:00:00 2001
-From: Viktor Dukhovni <viktor@openssl.org>
-Date: Thu, 19 Sep 2024 01:02:40 +1000
-Subject: [PATCH] Harden BN_GF2m_poly2arr against misuse.
-
-The BN_GF2m_poly2arr() function converts characteristic-2 field
-(GF_{2^m}) Galois polynomials from a representation as a BIGNUM bitmask,
-to a compact array with just the exponents of the non-zero terms.
-
-These polynomials are then used in BN_GF2m_mod_arr() to perform modular
-reduction. A precondition of calling BN_GF2m_mod_arr() is that the
-polynomial must have a non-zero constant term (i.e. the array has `0` as
-its final element).
-
-Internally, callers of BN_GF2m_poly2arr() did not verify that
-precondition, and binary EC curve parameters with an invalid polynomial
-could lead to out of bounds memory reads and writes in BN_GF2m_mod_arr().
-
-The precondition is always true for polynomials that arise from the
-standard form of EC parameters for characteristic-two fields (X9.62).
-See the "Finite Field Identification" section of:
-
- https://www.itu.int/ITU-T/formal-language/itu-t/x/x894/2018-cor1/ANSI-X9-62.html
-
-The OpenSSL GF(2^m) code supports only the trinomial and pentanomial
-basis X9.62 forms.
-
-This commit updates BN_GF2m_poly2arr() to return `0` (failure) when
-the constant term is zero (i.e. the input bitmask BIGNUM is not odd).
-
-Additionally, the return value is made unambiguous when there is not
-enough space to also pad the array with a final `-1` sentinel value.
-The return value is now always the number of elements (including the
-final `-1`) that would be filled when the output array is sufficiently
-large. Previously the same count was returned both when the array has
-just enough room for the final `-1` and when it had only enough space
-for non-sentinel values.
-
-Finally, BN_GF2m_poly2arr() is updated to reject polynomials whose
-degree exceeds `OPENSSL_ECC_MAX_FIELD_BITS`, this guards against
-CPU exhausition attacks via excessively large inputs.
-
-The above issues do not arise in processing X.509 certificates. These
-generally have EC keys from "named curves", and RFC5840 (Section 2.1.1)
-disallows explicit EC parameters. The TLS code in OpenSSL enforces this
-constraint only after the certificate is decoded, but, even if explicit
-parameters are specified, they are in X9.62 form, which cannot represent
-problem values as noted above.
-
-Initially reported as oss-fuzz issue 71623.
-
-A closely related issue was earlier reported in
-<https://github.com/openssl/openssl/issues/19826>.
-
-Severity: Low, CVE-2024-9143
-
-Reviewed-by: Matt Caswell <matt@openssl.org>
-Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
-Reviewed-by: Paul Dale <ppzgs1@gmail.com>
-Reviewed-by: Tomas Mraz <tomas@openssl.org>
-(Merged from https://github.com/openssl/openssl/pull/25639)
-
-(cherry picked from commit 8e008cb8b23ec7dc75c45a66eeed09c815b11cd2)
---- a/crypto/bn/bn_gf2m.c
-+++ b/crypto/bn/bn_gf2m.c
-@@ -15,6 +15,7 @@
- #include "bn_local.h"
-
- #ifndef OPENSSL_NO_EC2M
-+# include <openssl/ec.h>
-
- /*
- * Maximum number of iterations before BN_GF2m_mod_solve_quad_arr should
-@@ -1140,16 +1141,26 @@ int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
- /*
- * Convert the bit-string representation of a polynomial ( \sum_{i=0}^n a_i *
- * x^i) into an array of integers corresponding to the bits with non-zero
-- * coefficient. Array is terminated with -1. Up to max elements of the array
-- * will be filled. Return value is total number of array elements that would
-- * be filled if array was large enough.
-+ * coefficient. The array is intended to be suitable for use with
-+ * `BN_GF2m_mod_arr()`, and so the constant term of the polynomial must not be
-+ * zero. This translates to a requirement that the input BIGNUM `a` is odd.
-+ *
-+ * Given sufficient room, the array is terminated with -1. Up to max elements
-+ * of the array will be filled.
-+ *
-+ * The return value is total number of array elements that would be filled if
-+ * array was large enough, including the terminating `-1`. It is `0` when `a`
-+ * is not odd or the constant term is zero contrary to requirement.
-+ *
-+ * The return value is also `0` when the leading exponent exceeds
-+ * `OPENSSL_ECC_MAX_FIELD_BITS`, this guards against CPU exhaustion attacks,
- */
- int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max)
- {
- int i, j, k = 0;
- BN_ULONG mask;
-
-- if (BN_is_zero(a))
-+ if (!BN_is_odd(a))
- return 0;
-
- for (i = a->top - 1; i >= 0; i--) {
-@@ -1167,12 +1178,13 @@ int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max)
- }
- }
-
-- if (k < max) {
-+ if (k > 0 && p[0] > OPENSSL_ECC_MAX_FIELD_BITS)
-+ return 0;
-+
-+ if (k < max)
- p[k] = -1;
-- k++;
-- }
-
-- return k;
-+ return k + 1;
- }
-
- /*
---- a/test/ec_internal_test.c
-+++ b/test/ec_internal_test.c
-@@ -155,6 +155,56 @@ static int field_tests_ecp_mont(void)
- }
-
- #ifndef OPENSSL_NO_EC2M
-+/* Test that decoding of invalid GF2m field parameters fails. */
-+static int ec2m_field_sanity(void)
-+{
-+ int ret = 0;
-+ BN_CTX *ctx = BN_CTX_new();
-+ BIGNUM *p, *a, *b;
-+ EC_GROUP *group1 = NULL, *group2 = NULL, *group3 = NULL;
-+
-+ TEST_info("Testing GF2m hardening\n");
-+
-+ BN_CTX_start(ctx);
-+ p = BN_CTX_get(ctx);
-+ a = BN_CTX_get(ctx);
-+ if (!TEST_ptr(b = BN_CTX_get(ctx))
-+ || !TEST_true(BN_one(a))
-+ || !TEST_true(BN_one(b)))
-+ goto out;
-+
-+ /* Even pentanomial value should be rejected */
-+ if (!TEST_true(BN_set_word(p, 0xf2)))
-+ goto out;
-+ if (!TEST_ptr_null(group1 = EC_GROUP_new_curve_GF2m(p, a, b, ctx)))
-+ TEST_error("Zero constant term accepted in GF2m polynomial");
-+
-+ /* Odd hexanomial should also be rejected */
-+ if (!TEST_true(BN_set_word(p, 0xf3)))
-+ goto out;
-+ if (!TEST_ptr_null(group2 = EC_GROUP_new_curve_GF2m(p, a, b, ctx)))
-+ TEST_error("Hexanomial accepted as GF2m polynomial");
-+
-+ /* Excessive polynomial degree should also be rejected */
-+ if (!TEST_true(BN_set_word(p, 0x71))
-+ || !TEST_true(BN_set_bit(p, OPENSSL_ECC_MAX_FIELD_BITS + 1)))
-+ goto out;
-+ if (!TEST_ptr_null(group3 = EC_GROUP_new_curve_GF2m(p, a, b, ctx)))
-+ TEST_error("GF2m polynomial degree > %d accepted",
-+ OPENSSL_ECC_MAX_FIELD_BITS);
-+
-+ ret = group1 == NULL && group2 == NULL && group3 == NULL;
-+
-+ out:
-+ EC_GROUP_free(group1);
-+ EC_GROUP_free(group2);
-+ EC_GROUP_free(group3);
-+ BN_CTX_end(ctx);
-+ BN_CTX_free(ctx);
-+
-+ return ret;
-+}
-+
- /* test EC_GF2m_simple_method directly */
- static int field_tests_ec2_simple(void)
- {
-@@ -443,6 +493,7 @@ int setup_tests(void)
- ADD_TEST(field_tests_ecp_simple);
- ADD_TEST(field_tests_ecp_mont);
- #ifndef OPENSSL_NO_EC2M
-+ ADD_TEST(ec2m_field_sanity);
- ADD_TEST(field_tests_ec2_simple);
- #endif
- ADD_ALL_TESTS(field_tests_default, crv_len);
-
diff --git a/dev-libs/openssl/files/openssl-3.1.7-CVE-2024-9143.patch b/dev-libs/openssl/files/openssl-3.1.7-CVE-2024-9143.patch
deleted file mode 100644
index 4f33ef000dca..000000000000
--- a/dev-libs/openssl/files/openssl-3.1.7-CVE-2024-9143.patch
+++ /dev/null
@@ -1,192 +0,0 @@
-https://bugs.gentoo.org/941643
-https://github.com/openssl/openssl/commit/fdf6723362ca51bd883295efe206cb5b1cfa5154
-
-From fdf6723362ca51bd883295efe206cb5b1cfa5154 Mon Sep 17 00:00:00 2001
-From: Viktor Dukhovni <viktor@openssl.org>
-Date: Thu, 19 Sep 2024 01:02:40 +1000
-Subject: [PATCH] Harden BN_GF2m_poly2arr against misuse.
-
-The BN_GF2m_poly2arr() function converts characteristic-2 field
-(GF_{2^m}) Galois polynomials from a representation as a BIGNUM bitmask,
-to a compact array with just the exponents of the non-zero terms.
-
-These polynomials are then used in BN_GF2m_mod_arr() to perform modular
-reduction. A precondition of calling BN_GF2m_mod_arr() is that the
-polynomial must have a non-zero constant term (i.e. the array has `0` as
-its final element).
-
-Internally, callers of BN_GF2m_poly2arr() did not verify that
-precondition, and binary EC curve parameters with an invalid polynomial
-could lead to out of bounds memory reads and writes in BN_GF2m_mod_arr().
-
-The precondition is always true for polynomials that arise from the
-standard form of EC parameters for characteristic-two fields (X9.62).
-See the "Finite Field Identification" section of:
-
- https://www.itu.int/ITU-T/formal-language/itu-t/x/x894/2018-cor1/ANSI-X9-62.html
-
-The OpenSSL GF(2^m) code supports only the trinomial and pentanomial
-basis X9.62 forms.
-
-This commit updates BN_GF2m_poly2arr() to return `0` (failure) when
-the constant term is zero (i.e. the input bitmask BIGNUM is not odd).
-
-Additionally, the return value is made unambiguous when there is not
-enough space to also pad the array with a final `-1` sentinel value.
-The return value is now always the number of elements (including the
-final `-1`) that would be filled when the output array is sufficiently
-large. Previously the same count was returned both when the array has
-just enough room for the final `-1` and when it had only enough space
-for non-sentinel values.
-
-Finally, BN_GF2m_poly2arr() is updated to reject polynomials whose
-degree exceeds `OPENSSL_ECC_MAX_FIELD_BITS`, this guards against
-CPU exhausition attacks via excessively large inputs.
-
-The above issues do not arise in processing X.509 certificates. These
-generally have EC keys from "named curves", and RFC5840 (Section 2.1.1)
-disallows explicit EC parameters. The TLS code in OpenSSL enforces this
-constraint only after the certificate is decoded, but, even if explicit
-parameters are specified, they are in X9.62 form, which cannot represent
-problem values as noted above.
-
-Initially reported as oss-fuzz issue 71623.
-
-A closely related issue was earlier reported in
-<https://github.com/openssl/openssl/issues/19826>.
-
-Severity: Low, CVE-2024-9143
-
-Reviewed-by: Matt Caswell <matt@openssl.org>
-Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
-Reviewed-by: Paul Dale <ppzgs1@gmail.com>
-Reviewed-by: Tomas Mraz <tomas@openssl.org>
-(Merged from https://github.com/openssl/openssl/pull/25639)
-
-(cherry picked from commit 8e008cb8b23ec7dc75c45a66eeed09c815b11cd2)
---- a/crypto/bn/bn_gf2m.c
-+++ b/crypto/bn/bn_gf2m.c
-@@ -15,6 +15,7 @@
- #include "bn_local.h"
-
- #ifndef OPENSSL_NO_EC2M
-+# include <openssl/ec.h>
-
- /*
- * Maximum number of iterations before BN_GF2m_mod_solve_quad_arr should
-@@ -1140,16 +1141,26 @@ int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
- /*
- * Convert the bit-string representation of a polynomial ( \sum_{i=0}^n a_i *
- * x^i) into an array of integers corresponding to the bits with non-zero
-- * coefficient. Array is terminated with -1. Up to max elements of the array
-- * will be filled. Return value is total number of array elements that would
-- * be filled if array was large enough.
-+ * coefficient. The array is intended to be suitable for use with
-+ * `BN_GF2m_mod_arr()`, and so the constant term of the polynomial must not be
-+ * zero. This translates to a requirement that the input BIGNUM `a` is odd.
-+ *
-+ * Given sufficient room, the array is terminated with -1. Up to max elements
-+ * of the array will be filled.
-+ *
-+ * The return value is total number of array elements that would be filled if
-+ * array was large enough, including the terminating `-1`. It is `0` when `a`
-+ * is not odd or the constant term is zero contrary to requirement.
-+ *
-+ * The return value is also `0` when the leading exponent exceeds
-+ * `OPENSSL_ECC_MAX_FIELD_BITS`, this guards against CPU exhaustion attacks,
- */
- int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max)
- {
- int i, j, k = 0;
- BN_ULONG mask;
-
-- if (BN_is_zero(a))
-+ if (!BN_is_odd(a))
- return 0;
-
- for (i = a->top - 1; i >= 0; i--) {
-@@ -1167,12 +1178,13 @@ int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max)
- }
- }
-
-- if (k < max) {
-+ if (k > 0 && p[0] > OPENSSL_ECC_MAX_FIELD_BITS)
-+ return 0;
-+
-+ if (k < max)
- p[k] = -1;
-- k++;
-- }
-
-- return k;
-+ return k + 1;
- }
-
- /*
---- a/test/ec_internal_test.c
-+++ b/test/ec_internal_test.c
-@@ -155,6 +155,56 @@ static int field_tests_ecp_mont(void)
- }
-
- #ifndef OPENSSL_NO_EC2M
-+/* Test that decoding of invalid GF2m field parameters fails. */
-+static int ec2m_field_sanity(void)
-+{
-+ int ret = 0;
-+ BN_CTX *ctx = BN_CTX_new();
-+ BIGNUM *p, *a, *b;
-+ EC_GROUP *group1 = NULL, *group2 = NULL, *group3 = NULL;
-+
-+ TEST_info("Testing GF2m hardening\n");
-+
-+ BN_CTX_start(ctx);
-+ p = BN_CTX_get(ctx);
-+ a = BN_CTX_get(ctx);
-+ if (!TEST_ptr(b = BN_CTX_get(ctx))
-+ || !TEST_true(BN_one(a))
-+ || !TEST_true(BN_one(b)))
-+ goto out;
-+
-+ /* Even pentanomial value should be rejected */
-+ if (!TEST_true(BN_set_word(p, 0xf2)))
-+ goto out;
-+ if (!TEST_ptr_null(group1 = EC_GROUP_new_curve_GF2m(p, a, b, ctx)))
-+ TEST_error("Zero constant term accepted in GF2m polynomial");
-+
-+ /* Odd hexanomial should also be rejected */
-+ if (!TEST_true(BN_set_word(p, 0xf3)))
-+ goto out;
-+ if (!TEST_ptr_null(group2 = EC_GROUP_new_curve_GF2m(p, a, b, ctx)))
-+ TEST_error("Hexanomial accepted as GF2m polynomial");
-+
-+ /* Excessive polynomial degree should also be rejected */
-+ if (!TEST_true(BN_set_word(p, 0x71))
-+ || !TEST_true(BN_set_bit(p, OPENSSL_ECC_MAX_FIELD_BITS + 1)))
-+ goto out;
-+ if (!TEST_ptr_null(group3 = EC_GROUP_new_curve_GF2m(p, a, b, ctx)))
-+ TEST_error("GF2m polynomial degree > %d accepted",
-+ OPENSSL_ECC_MAX_FIELD_BITS);
-+
-+ ret = group1 == NULL && group2 == NULL && group3 == NULL;
-+
-+ out:
-+ EC_GROUP_free(group1);
-+ EC_GROUP_free(group2);
-+ EC_GROUP_free(group3);
-+ BN_CTX_end(ctx);
-+ BN_CTX_free(ctx);
-+
-+ return ret;
-+}
-+
- /* test EC_GF2m_simple_method directly */
- static int field_tests_ec2_simple(void)
- {
-@@ -443,6 +493,7 @@ int setup_tests(void)
- ADD_TEST(field_tests_ecp_simple);
- ADD_TEST(field_tests_ecp_mont);
- #ifndef OPENSSL_NO_EC2M
-+ ADD_TEST(ec2m_field_sanity);
- ADD_TEST(field_tests_ec2_simple);
- #endif
- ADD_ALL_TESTS(field_tests_default, crv_len);
diff --git a/dev-libs/openssl/files/openssl-3.2.3-CVE-2024-9143.patch b/dev-libs/openssl/files/openssl-3.2.3-CVE-2024-9143.patch
deleted file mode 100644
index e84b0f6c353e..000000000000
--- a/dev-libs/openssl/files/openssl-3.2.3-CVE-2024-9143.patch
+++ /dev/null
@@ -1,193 +0,0 @@
-https://bugs.gentoo.org/941643
-https://github.com/openssl/openssl/commit/bc7e04d7c8d509fb78fc0e285aa948fb0da04700
-
-From bc7e04d7c8d509fb78fc0e285aa948fb0da04700 Mon Sep 17 00:00:00 2001
-From: Viktor Dukhovni <viktor@openssl.org>
-Date: Thu, 19 Sep 2024 01:02:40 +1000
-Subject: [PATCH] Harden BN_GF2m_poly2arr against misuse.
-
-The BN_GF2m_poly2arr() function converts characteristic-2 field
-(GF_{2^m}) Galois polynomials from a representation as a BIGNUM bitmask,
-to a compact array with just the exponents of the non-zero terms.
-
-These polynomials are then used in BN_GF2m_mod_arr() to perform modular
-reduction. A precondition of calling BN_GF2m_mod_arr() is that the
-polynomial must have a non-zero constant term (i.e. the array has `0` as
-its final element).
-
-Internally, callers of BN_GF2m_poly2arr() did not verify that
-precondition, and binary EC curve parameters with an invalid polynomial
-could lead to out of bounds memory reads and writes in BN_GF2m_mod_arr().
-
-The precondition is always true for polynomials that arise from the
-standard form of EC parameters for characteristic-two fields (X9.62).
-See the "Finite Field Identification" section of:
-
- https://www.itu.int/ITU-T/formal-language/itu-t/x/x894/2018-cor1/ANSI-X9-62.html
-
-The OpenSSL GF(2^m) code supports only the trinomial and pentanomial
-basis X9.62 forms.
-
-This commit updates BN_GF2m_poly2arr() to return `0` (failure) when
-the constant term is zero (i.e. the input bitmask BIGNUM is not odd).
-
-Additionally, the return value is made unambiguous when there is not
-enough space to also pad the array with a final `-1` sentinel value.
-The return value is now always the number of elements (including the
-final `-1`) that would be filled when the output array is sufficiently
-large. Previously the same count was returned both when the array has
-just enough room for the final `-1` and when it had only enough space
-for non-sentinel values.
-
-Finally, BN_GF2m_poly2arr() is updated to reject polynomials whose
-degree exceeds `OPENSSL_ECC_MAX_FIELD_BITS`, this guards against
-CPU exhausition attacks via excessively large inputs.
-
-The above issues do not arise in processing X.509 certificates. These
-generally have EC keys from "named curves", and RFC5840 (Section 2.1.1)
-disallows explicit EC parameters. The TLS code in OpenSSL enforces this
-constraint only after the certificate is decoded, but, even if explicit
-parameters are specified, they are in X9.62 form, which cannot represent
-problem values as noted above.
-
-Initially reported as oss-fuzz issue 71623.
-
-A closely related issue was earlier reported in
-<https://github.com/openssl/openssl/issues/19826>.
-
-Severity: Low, CVE-2024-9143
-
-Reviewed-by: Matt Caswell <matt@openssl.org>
-Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
-Reviewed-by: Paul Dale <ppzgs1@gmail.com>
-Reviewed-by: Tomas Mraz <tomas@openssl.org>
-(Merged from https://github.com/openssl/openssl/pull/25639)
-
-(cherry picked from commit 8e008cb8b23ec7dc75c45a66eeed09c815b11cd2)
---- a/crypto/bn/bn_gf2m.c
-+++ b/crypto/bn/bn_gf2m.c
-@@ -15,6 +15,7 @@
- #include "bn_local.h"
-
- #ifndef OPENSSL_NO_EC2M
-+# include <openssl/ec.h>
-
- /*
- * Maximum number of iterations before BN_GF2m_mod_solve_quad_arr should
-@@ -1130,16 +1131,26 @@ int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
- /*
- * Convert the bit-string representation of a polynomial ( \sum_{i=0}^n a_i *
- * x^i) into an array of integers corresponding to the bits with non-zero
-- * coefficient. Array is terminated with -1. Up to max elements of the array
-- * will be filled. Return value is total number of array elements that would
-- * be filled if array was large enough.
-+ * coefficient. The array is intended to be suitable for use with
-+ * `BN_GF2m_mod_arr()`, and so the constant term of the polynomial must not be
-+ * zero. This translates to a requirement that the input BIGNUM `a` is odd.
-+ *
-+ * Given sufficient room, the array is terminated with -1. Up to max elements
-+ * of the array will be filled.
-+ *
-+ * The return value is total number of array elements that would be filled if
-+ * array was large enough, including the terminating `-1`. It is `0` when `a`
-+ * is not odd or the constant term is zero contrary to requirement.
-+ *
-+ * The return value is also `0` when the leading exponent exceeds
-+ * `OPENSSL_ECC_MAX_FIELD_BITS`, this guards against CPU exhaustion attacks,
- */
- int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max)
- {
- int i, j, k = 0;
- BN_ULONG mask;
-
-- if (BN_is_zero(a))
-+ if (!BN_is_odd(a))
- return 0;
-
- for (i = a->top - 1; i >= 0; i--) {
-@@ -1157,12 +1168,13 @@ int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max)
- }
- }
-
-- if (k < max) {
-+ if (k > 0 && p[0] > OPENSSL_ECC_MAX_FIELD_BITS)
-+ return 0;
-+
-+ if (k < max)
- p[k] = -1;
-- k++;
-- }
-
-- return k;
-+ return k + 1;
- }
-
- /*
---- a/test/ec_internal_test.c
-+++ b/test/ec_internal_test.c
-@@ -155,6 +155,56 @@ static int field_tests_ecp_mont(void)
- }
-
- #ifndef OPENSSL_NO_EC2M
-+/* Test that decoding of invalid GF2m field parameters fails. */
-+static int ec2m_field_sanity(void)
-+{
-+ int ret = 0;
-+ BN_CTX *ctx = BN_CTX_new();
-+ BIGNUM *p, *a, *b;
-+ EC_GROUP *group1 = NULL, *group2 = NULL, *group3 = NULL;
-+
-+ TEST_info("Testing GF2m hardening\n");
-+
-+ BN_CTX_start(ctx);
-+ p = BN_CTX_get(ctx);
-+ a = BN_CTX_get(ctx);
-+ if (!TEST_ptr(b = BN_CTX_get(ctx))
-+ || !TEST_true(BN_one(a))
-+ || !TEST_true(BN_one(b)))
-+ goto out;
-+
-+ /* Even pentanomial value should be rejected */
-+ if (!TEST_true(BN_set_word(p, 0xf2)))
-+ goto out;
-+ if (!TEST_ptr_null(group1 = EC_GROUP_new_curve_GF2m(p, a, b, ctx)))
-+ TEST_error("Zero constant term accepted in GF2m polynomial");
-+
-+ /* Odd hexanomial should also be rejected */
-+ if (!TEST_true(BN_set_word(p, 0xf3)))
-+ goto out;
-+ if (!TEST_ptr_null(group2 = EC_GROUP_new_curve_GF2m(p, a, b, ctx)))
-+ TEST_error("Hexanomial accepted as GF2m polynomial");
-+
-+ /* Excessive polynomial degree should also be rejected */
-+ if (!TEST_true(BN_set_word(p, 0x71))
-+ || !TEST_true(BN_set_bit(p, OPENSSL_ECC_MAX_FIELD_BITS + 1)))
-+ goto out;
-+ if (!TEST_ptr_null(group3 = EC_GROUP_new_curve_GF2m(p, a, b, ctx)))
-+ TEST_error("GF2m polynomial degree > %d accepted",
-+ OPENSSL_ECC_MAX_FIELD_BITS);
-+
-+ ret = group1 == NULL && group2 == NULL && group3 == NULL;
-+
-+ out:
-+ EC_GROUP_free(group1);
-+ EC_GROUP_free(group2);
-+ EC_GROUP_free(group3);
-+ BN_CTX_end(ctx);
-+ BN_CTX_free(ctx);
-+
-+ return ret;
-+}
-+
- /* test EC_GF2m_simple_method directly */
- static int field_tests_ec2_simple(void)
- {
-@@ -443,6 +493,7 @@ int setup_tests(void)
- ADD_TEST(field_tests_ecp_simple);
- ADD_TEST(field_tests_ecp_mont);
- #ifndef OPENSSL_NO_EC2M
-+ ADD_TEST(ec2m_field_sanity);
- ADD_TEST(field_tests_ec2_simple);
- #endif
- ADD_ALL_TESTS(field_tests_default, crv_len);
-
diff --git a/dev-libs/openssl/files/openssl-3.3.2-CVE-2024-9143.patch b/dev-libs/openssl/files/openssl-3.3.2-CVE-2024-9143.patch
deleted file mode 100644
index 5776c78bfbbf..000000000000
--- a/dev-libs/openssl/files/openssl-3.3.2-CVE-2024-9143.patch
+++ /dev/null
@@ -1,193 +0,0 @@
-https://bugs.gentoo.org/941643
-https://github.com/openssl/openssl/commit/c0d3e4d32d2805f49bec30547f225bc4d092e1f4
-
-From c0d3e4d32d2805f49bec30547f225bc4d092e1f4 Mon Sep 17 00:00:00 2001
-From: Viktor Dukhovni <viktor@openssl.org>
-Date: Thu, 19 Sep 2024 01:02:40 +1000
-Subject: [PATCH] Harden BN_GF2m_poly2arr against misuse.
-
-The BN_GF2m_poly2arr() function converts characteristic-2 field
-(GF_{2^m}) Galois polynomials from a representation as a BIGNUM bitmask,
-to a compact array with just the exponents of the non-zero terms.
-
-These polynomials are then used in BN_GF2m_mod_arr() to perform modular
-reduction. A precondition of calling BN_GF2m_mod_arr() is that the
-polynomial must have a non-zero constant term (i.e. the array has `0` as
-its final element).
-
-Internally, callers of BN_GF2m_poly2arr() did not verify that
-precondition, and binary EC curve parameters with an invalid polynomial
-could lead to out of bounds memory reads and writes in BN_GF2m_mod_arr().
-
-The precondition is always true for polynomials that arise from the
-standard form of EC parameters for characteristic-two fields (X9.62).
-See the "Finite Field Identification" section of:
-
- https://www.itu.int/ITU-T/formal-language/itu-t/x/x894/2018-cor1/ANSI-X9-62.html
-
-The OpenSSL GF(2^m) code supports only the trinomial and pentanomial
-basis X9.62 forms.
-
-This commit updates BN_GF2m_poly2arr() to return `0` (failure) when
-the constant term is zero (i.e. the input bitmask BIGNUM is not odd).
-
-Additionally, the return value is made unambiguous when there is not
-enough space to also pad the array with a final `-1` sentinel value.
-The return value is now always the number of elements (including the
-final `-1`) that would be filled when the output array is sufficiently
-large. Previously the same count was returned both when the array has
-just enough room for the final `-1` and when it had only enough space
-for non-sentinel values.
-
-Finally, BN_GF2m_poly2arr() is updated to reject polynomials whose
-degree exceeds `OPENSSL_ECC_MAX_FIELD_BITS`, this guards against
-CPU exhausition attacks via excessively large inputs.
-
-The above issues do not arise in processing X.509 certificates. These
-generally have EC keys from "named curves", and RFC5840 (Section 2.1.1)
-disallows explicit EC parameters. The TLS code in OpenSSL enforces this
-constraint only after the certificate is decoded, but, even if explicit
-parameters are specified, they are in X9.62 form, which cannot represent
-problem values as noted above.
-
-Initially reported as oss-fuzz issue 71623.
-
-A closely related issue was earlier reported in
-<https://github.com/openssl/openssl/issues/19826>.
-
-Severity: Low, CVE-2024-9143
-
-Reviewed-by: Matt Caswell <matt@openssl.org>
-Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
-Reviewed-by: Paul Dale <ppzgs1@gmail.com>
-Reviewed-by: Tomas Mraz <tomas@openssl.org>
-(Merged from https://github.com/openssl/openssl/pull/25639)
-
-(cherry picked from commit 8e008cb8b23ec7dc75c45a66eeed09c815b11cd2)
---- a/crypto/bn/bn_gf2m.c
-+++ b/crypto/bn/bn_gf2m.c
-@@ -15,6 +15,7 @@
- #include "bn_local.h"
-
- #ifndef OPENSSL_NO_EC2M
-+# include <openssl/ec.h>
-
- /*
- * Maximum number of iterations before BN_GF2m_mod_solve_quad_arr should
-@@ -1130,16 +1131,26 @@ int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
- /*
- * Convert the bit-string representation of a polynomial ( \sum_{i=0}^n a_i *
- * x^i) into an array of integers corresponding to the bits with non-zero
-- * coefficient. Array is terminated with -1. Up to max elements of the array
-- * will be filled. Return value is total number of array elements that would
-- * be filled if array was large enough.
-+ * coefficient. The array is intended to be suitable for use with
-+ * `BN_GF2m_mod_arr()`, and so the constant term of the polynomial must not be
-+ * zero. This translates to a requirement that the input BIGNUM `a` is odd.
-+ *
-+ * Given sufficient room, the array is terminated with -1. Up to max elements
-+ * of the array will be filled.
-+ *
-+ * The return value is total number of array elements that would be filled if
-+ * array was large enough, including the terminating `-1`. It is `0` when `a`
-+ * is not odd or the constant term is zero contrary to requirement.
-+ *
-+ * The return value is also `0` when the leading exponent exceeds
-+ * `OPENSSL_ECC_MAX_FIELD_BITS`, this guards against CPU exhaustion attacks,
- */
- int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max)
- {
- int i, j, k = 0;
- BN_ULONG mask;
-
-- if (BN_is_zero(a))
-+ if (!BN_is_odd(a))
- return 0;
-
- for (i = a->top - 1; i >= 0; i--) {
-@@ -1157,12 +1168,13 @@ int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max)
- }
- }
-
-- if (k < max) {
-+ if (k > 0 && p[0] > OPENSSL_ECC_MAX_FIELD_BITS)
-+ return 0;
-+
-+ if (k < max)
- p[k] = -1;
-- k++;
-- }
-
-- return k;
-+ return k + 1;
- }
-
- /*
---- a/test/ec_internal_test.c
-+++ b/test/ec_internal_test.c
-@@ -155,6 +155,56 @@ static int field_tests_ecp_mont(void)
- }
-
- #ifndef OPENSSL_NO_EC2M
-+/* Test that decoding of invalid GF2m field parameters fails. */
-+static int ec2m_field_sanity(void)
-+{
-+ int ret = 0;
-+ BN_CTX *ctx = BN_CTX_new();
-+ BIGNUM *p, *a, *b;
-+ EC_GROUP *group1 = NULL, *group2 = NULL, *group3 = NULL;
-+
-+ TEST_info("Testing GF2m hardening\n");
-+
-+ BN_CTX_start(ctx);
-+ p = BN_CTX_get(ctx);
-+ a = BN_CTX_get(ctx);
-+ if (!TEST_ptr(b = BN_CTX_get(ctx))
-+ || !TEST_true(BN_one(a))
-+ || !TEST_true(BN_one(b)))
-+ goto out;
-+
-+ /* Even pentanomial value should be rejected */
-+ if (!TEST_true(BN_set_word(p, 0xf2)))
-+ goto out;
-+ if (!TEST_ptr_null(group1 = EC_GROUP_new_curve_GF2m(p, a, b, ctx)))
-+ TEST_error("Zero constant term accepted in GF2m polynomial");
-+
-+ /* Odd hexanomial should also be rejected */
-+ if (!TEST_true(BN_set_word(p, 0xf3)))
-+ goto out;
-+ if (!TEST_ptr_null(group2 = EC_GROUP_new_curve_GF2m(p, a, b, ctx)))
-+ TEST_error("Hexanomial accepted as GF2m polynomial");
-+
-+ /* Excessive polynomial degree should also be rejected */
-+ if (!TEST_true(BN_set_word(p, 0x71))
-+ || !TEST_true(BN_set_bit(p, OPENSSL_ECC_MAX_FIELD_BITS + 1)))
-+ goto out;
-+ if (!TEST_ptr_null(group3 = EC_GROUP_new_curve_GF2m(p, a, b, ctx)))
-+ TEST_error("GF2m polynomial degree > %d accepted",
-+ OPENSSL_ECC_MAX_FIELD_BITS);
-+
-+ ret = group1 == NULL && group2 == NULL && group3 == NULL;
-+
-+ out:
-+ EC_GROUP_free(group1);
-+ EC_GROUP_free(group2);
-+ EC_GROUP_free(group3);
-+ BN_CTX_end(ctx);
-+ BN_CTX_free(ctx);
-+
-+ return ret;
-+}
-+
- /* test EC_GF2m_simple_method directly */
- static int field_tests_ec2_simple(void)
- {
-@@ -443,6 +493,7 @@ int setup_tests(void)
- ADD_TEST(field_tests_ecp_simple);
- ADD_TEST(field_tests_ecp_mont);
- #ifndef OPENSSL_NO_EC2M
-+ ADD_TEST(ec2m_field_sanity);
- ADD_TEST(field_tests_ec2_simple);
- #endif
- ADD_ALL_TESTS(field_tests_default, crv_len);
-
diff --git a/dev-libs/openssl/files/openssl-3.3.2-arm64-clobber.patch b/dev-libs/openssl/files/openssl-3.3.2-arm64-clobber.patch
deleted file mode 100644
index d83c5b4fb87f..000000000000
--- a/dev-libs/openssl/files/openssl-3.3.2-arm64-clobber.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-https://gcc.gnu.org/PR118537
-https://www.postgresql.org/message-id/6fxlmnyagkycru3bewa4ympknywnsswlqzvwfft3ifqqiioxlv%40ax53pv7xdrc2
-https://github.com/openssl/openssl/pull/26469
-https://github.com/openssl/openssl/commit/4f7d8b2724ea7f42cff1e8a0e736ad448def60f5
-
-From 4f7d8b2724ea7f42cff1e8a0e736ad448def60f5 Mon Sep 17 00:00:00 2001
-From: Julian Andres Klode <julian.klode@canonical.com>
-Date: Sat, 18 Jan 2025 21:12:45 +0100
-Subject: [PATCH] Restore correct registers in aarch64 AES-CTR code
-
-Commit 1d1ca79fe35dbe5c05faed5a2ef8c4de9c5adc49 introduced
-save and restore for the registers, saving them as
-
- stp d8,d9,[sp, #16]
- stp d10,d11,[sp, #32]
- stp d12,d13,[sp, #48]
- stp d14,d15,[sp, #64]
-
-But the restore code was inadvertently typoed:
-
- ldp d8,d9,[sp, #16]
- ldp d10,d11,[sp, #32]
- ldp d12,d13,[sp, #48]
- ldp d15,d16,[sp, #64]
-
-Restoring [sp, #64] into d15,d16 instead of d14,d15.
-
-Fixes: #26466
-
-CLA: trivial
-
-Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
-Reviewed-by: Paul Dale <ppzgs1@gmail.com>
-Reviewed-by: Tomas Mraz <tomas@openssl.org>
-(Merged from https://github.com/openssl/openssl/pull/26469)
-
-(cherry picked from commit 5261f3ca41cda7ad5767e399e9a2dc008bbad5d6)
----
- crypto/aes/asm/aesv8-armx.pl | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/crypto/aes/asm/aesv8-armx.pl b/crypto/aes/asm/aesv8-armx.pl
-index 33a2dd53dae19..dc019b04ccd25 100755
---- a/crypto/aes/asm/aesv8-armx.pl
-+++ b/crypto/aes/asm/aesv8-armx.pl
-@@ -2493,7 +2493,7 @@ ()
- ldp d8,d9,[sp, #16]
- ldp d10,d11,[sp, #32]
- ldp d12,d13,[sp, #48]
-- ldp d15,d16,[sp, #64]
-+ ldp d14,d15,[sp, #64]
- ldr x29,[sp],#80
- ret
- .size ${prefix}_ctr32_encrypt_blocks_unroll12_eor3,.-${prefix}_ctr32_encrypt_blocks_unroll12_eor3
-