From 6364a8fc6fd76d4761d732d1aa7865ad09035291 Mon Sep 17 00:00:00 2001 From: jykanase Date: Wed, 29 Apr 2026 08:25:12 +0000 Subject: [PATCH 1/3] Upgrade openssl to 3.3.7 --- ...-check-to-PKCS12_item_decrypt_d2i_ex.patch | 31 - ...ed-uncompressed-certificate-length-t.patch | 33 -- ...-of-AEAD-encrypted-CMS-with-inadmiss.patch | 31 - ...W-stream-path-unauthenticated-unencr.patch | 70 --- ...-buffer-overflow-in-BIO_f_linebuffer.patch | 67 --- ...cated-functions-with-NULL-or-highest.patch | 16 +- ...ct-s-types-before-attempting-to-acce.patch | 40 -- ...pher_by_char-Add-a-NULL-guard-before.patch | 27 - ...-comments-to-clarify-functions-usage.patch | 57 -- ...g-of-AEAD-encrypted-CMS-with-inadmis.patch | 126 ---- ...ault-paths-for-the-CA-directory-tree.patch | 12 +- ...0005-apps-ca-fix-md-option-help-text.patch | 18 +- ...09-Add-Kernel-FIPS-mode-flag-support.patch | 14 +- ...10-Add-changes-to-ectest-and-eccurve.patch | 545 +++++++----------- SPECS/openssl/0011-Remove-EC-curves.patch | 285 +++++---- SPECS/openssl/0012-Disable-explicit-ec.patch | 95 +-- ...9-Allow-disabling-of-SHA1-signatures.patch | 124 ++-- ...clevel-1-if-rh-allow-sha1-signatures.patch | 38 +- SPECS/openssl/CVE-2025-69419.patch | 48 -- SPECS/openssl/CVE-2026-22796.patch | 73 --- SPECS/openssl/CVE-2026-28388.patch | 155 ----- SPECS/openssl/CVE-2026-28389.patch | 104 ---- SPECS/openssl/CVE-2026-28390.patch | 86 --- SPECS/openssl/CVE-2026-31789.patch | 44 -- SPECS/openssl/CVE-2026-31790.patch | 153 ----- SPECS/openssl/CVE-2026-31791.patch | 4 +- ...pported-algs-key-lengths-dynamically.patch | 26 +- SPECS/openssl/openssl.signatures.json | 2 +- SPECS/openssl/openssl.spec | 27 +- cgmanifest.json | 4 +- .../manifests/package/pkggen_core_aarch64.txt | 10 +- .../manifests/package/pkggen_core_x86_64.txt | 10 +- .../manifests/package/toolchain_aarch64.txt | 12 +- .../manifests/package/toolchain_x86_64.txt | 12 +- 34 files changed, 573 insertions(+), 1826 deletions(-) delete mode 100644 SPECS/openssl/0001-Add-NULL-check-to-PKCS12_item_decrypt_d2i_ex.patch delete mode 100644 SPECS/openssl/0001-Check-the-received-uncompressed-certificate-length-t.patch delete mode 100644 SPECS/openssl/0001-Correct-handling-of-AEAD-encrypted-CMS-with-inadmiss.patch delete mode 100644 SPECS/openssl/0001-Fix-OCB-AES-NI-HW-stream-path-unauthenticated-unencr.patch delete mode 100644 SPECS/openssl/0001-Fix-heap-buffer-overflow-in-BIO_f_linebuffer.patch delete mode 100644 SPECS/openssl/0001-Verify-ASN1-object-s-types-before-attempting-to-acce.patch delete mode 100644 SPECS/openssl/0001-ossl_quic_get_cipher_by_char-Add-a-NULL-guard-before.patch delete mode 100644 SPECS/openssl/0002-Some-comments-to-clarify-functions-usage.patch delete mode 100644 SPECS/openssl/0003-Test-for-handling-of-AEAD-encrypted-CMS-with-inadmis.patch mode change 100755 => 100644 SPECS/openssl/0009-Add-Kernel-FIPS-mode-flag-support.patch delete mode 100644 SPECS/openssl/CVE-2025-69419.patch delete mode 100644 SPECS/openssl/CVE-2026-22796.patch delete mode 100644 SPECS/openssl/CVE-2026-28388.patch delete mode 100644 SPECS/openssl/CVE-2026-28389.patch delete mode 100644 SPECS/openssl/CVE-2026-28390.patch delete mode 100644 SPECS/openssl/CVE-2026-31789.patch delete mode 100644 SPECS/openssl/CVE-2026-31790.patch diff --git a/SPECS/openssl/0001-Add-NULL-check-to-PKCS12_item_decrypt_d2i_ex.patch b/SPECS/openssl/0001-Add-NULL-check-to-PKCS12_item_decrypt_d2i_ex.patch deleted file mode 100644 index 29e6358893e..00000000000 --- a/SPECS/openssl/0001-Add-NULL-check-to-PKCS12_item_decrypt_d2i_ex.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0a2ecb95993b588d2156dd6527459cc3983aabd5 Mon Sep 17 00:00:00 2001 -From: Andrew Dinh -Date: Thu, 8 Jan 2026 01:24:30 +0900 -Subject: [PATCH] Add NULL check to PKCS12_item_decrypt_d2i_ex - -Address CVE-2025-69421 - -Add NULL check for oct parameter ---- - crypto/pkcs12/p12_decr.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/crypto/pkcs12/p12_decr.c b/crypto/pkcs12/p12_decr.c -index 606713b9ee..1614da4404 100644 ---- a/crypto/pkcs12/p12_decr.c -+++ b/crypto/pkcs12/p12_decr.c -@@ -146,6 +146,11 @@ void *PKCS12_item_decrypt_d2i_ex(const X509_ALGOR *algor, const ASN1_ITEM *it, - void *ret; - int outlen = 0; - -+ if (oct == NULL) { -+ ERR_raise(ERR_LIB_PKCS12, ERR_R_PASSED_NULL_PARAMETER); -+ return NULL; -+ } -+ - if (!PKCS12_pbe_crypt_ex(algor, pass, passlen, oct->data, oct->length, - &out, &outlen, 0, libctx, propq)) - return NULL; --- -2.52.0 - diff --git a/SPECS/openssl/0001-Check-the-received-uncompressed-certificate-length-t.patch b/SPECS/openssl/0001-Check-the-received-uncompressed-certificate-length-t.patch deleted file mode 100644 index 0fb4c0f8a6d..00000000000 --- a/SPECS/openssl/0001-Check-the-received-uncompressed-certificate-length-t.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 04a93ac145041e3ef0121a2688cf7c1b23780519 Mon Sep 17 00:00:00 2001 -From: Igor Ustinov -Date: Thu, 8 Jan 2026 14:02:54 +0100 -Subject: [PATCH] Check the received uncompressed certificate length to prevent - excessive pre-decompression allocation. - -The patch was proposed by Tomas Dulka and Stanislav Fort (Aisle Research). - -Fixes: CVE-2025-66199 ---- - ssl/statem/statem_lib.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/ssl/statem/statem_lib.c b/ssl/statem/statem_lib.c -index 9e0c853c0d..f82d8dcdac 100644 ---- a/ssl/statem/statem_lib.c -+++ b/ssl/statem/statem_lib.c -@@ -2877,6 +2877,12 @@ MSG_PROCESS_RETURN tls13_process_compressed_certificate(SSL_CONNECTION *sc, - goto err; - } - -+ /* Prevent excessive pre-decompression allocation */ -+ if (expected_length > sc->max_cert_list) { -+ SSLfatal(sc, SSL_AD_ILLEGAL_PARAMETER, SSL_R_EXCESSIVE_MESSAGE_SIZE); -+ goto err; -+ } -+ - if (PACKET_remaining(pkt) != comp_length || comp_length == 0) { - SSLfatal(sc, SSL_AD_DECODE_ERROR, SSL_R_BAD_DECOMPRESSION); - goto err; --- -2.52.0 - diff --git a/SPECS/openssl/0001-Correct-handling-of-AEAD-encrypted-CMS-with-inadmiss.patch b/SPECS/openssl/0001-Correct-handling-of-AEAD-encrypted-CMS-with-inadmiss.patch deleted file mode 100644 index 5633532ac6b..00000000000 --- a/SPECS/openssl/0001-Correct-handling-of-AEAD-encrypted-CMS-with-inadmiss.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 190ba58c0a1d995d4da8b017054d4b74d138291c Mon Sep 17 00:00:00 2001 -From: Igor Ustinov -Date: Mon, 12 Jan 2026 12:13:35 +0100 -Subject: [PATCH 1/3] Correct handling of AEAD-encrypted CMS with inadmissibly - long IV - -Fixes CVE-2025-15467 ---- - crypto/evp/evp_lib.c | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c -index 9eae1d421c..58fa7ce43b 100644 ---- a/crypto/evp/evp_lib.c -+++ b/crypto/evp/evp_lib.c -@@ -228,10 +228,9 @@ int evp_cipher_get_asn1_aead_params(EVP_CIPHER_CTX *c, ASN1_TYPE *type, - if (type == NULL || asn1_params == NULL) - return 0; - -- i = ossl_asn1_type_get_octetstring_int(type, &tl, NULL, EVP_MAX_IV_LENGTH); -- if (i <= 0) -+ i = ossl_asn1_type_get_octetstring_int(type, &tl, iv, EVP_MAX_IV_LENGTH); -+ if (i <= 0 || i > EVP_MAX_IV_LENGTH) - return -1; -- ossl_asn1_type_get_octetstring_int(type, &tl, iv, i); - - memcpy(asn1_params->iv, iv, i); - asn1_params->iv_len = i; --- -2.52.0 - diff --git a/SPECS/openssl/0001-Fix-OCB-AES-NI-HW-stream-path-unauthenticated-unencr.patch b/SPECS/openssl/0001-Fix-OCB-AES-NI-HW-stream-path-unauthenticated-unencr.patch deleted file mode 100644 index 668455a689c..00000000000 --- a/SPECS/openssl/0001-Fix-OCB-AES-NI-HW-stream-path-unauthenticated-unencr.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 1a556ff619473af9e179b202284a961590d5a2bd Mon Sep 17 00:00:00 2001 -From: Norbert Pocs -Date: Thu, 8 Jan 2026 15:04:54 +0100 -Subject: [PATCH] Fix OCB AES-NI/HW stream path unauthenticated/unencrypted - trailing bytes -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When ctx->stream (e.g., AES‑NI or ARMv8 CE) is available, the fast path -encrypts/decrypts full blocks but does not advance in/out pointers. The -tail-handling code then operates on the base pointers, effectively reprocessing -the beginning of the buffer while leaving the actual trailing bytes -unencrypted (encryption) or using the wrong plaintext (decryption). The -authentication checksum excludes the true tail. - -CVE-2025-69418 - -Fixes: https://github.com/openssl/srt/issues/58 - -Signed-off-by: Norbert Pocs ---- - crypto/modes/ocb128.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/crypto/modes/ocb128.c b/crypto/modes/ocb128.c -index ce72baf6da..8a5d7c7db0 100644 ---- a/crypto/modes/ocb128.c -+++ b/crypto/modes/ocb128.c -@@ -337,7 +337,7 @@ int CRYPTO_ocb128_encrypt(OCB128_CONTEXT *ctx, - - if (num_blocks && all_num_blocks == (size_t)all_num_blocks - && ctx->stream != NULL) { -- size_t max_idx = 0, top = (size_t)all_num_blocks; -+ size_t max_idx = 0, top = (size_t)all_num_blocks, processed_bytes = 0; - - /* - * See how many L_{i} entries we need to process data at hand -@@ -351,6 +351,9 @@ int CRYPTO_ocb128_encrypt(OCB128_CONTEXT *ctx, - ctx->stream(in, out, num_blocks, ctx->keyenc, - (size_t)ctx->sess.blocks_processed + 1, ctx->sess.offset.c, - (const unsigned char (*)[16])ctx->l, ctx->sess.checksum.c); -+ processed_bytes = num_blocks * 16; -+ in += processed_bytes; -+ out += processed_bytes; - } else { - /* Loop through all full blocks to be encrypted */ - for (i = ctx->sess.blocks_processed + 1; i <= all_num_blocks; i++) { -@@ -429,7 +432,7 @@ int CRYPTO_ocb128_decrypt(OCB128_CONTEXT *ctx, - - if (num_blocks && all_num_blocks == (size_t)all_num_blocks - && ctx->stream != NULL) { -- size_t max_idx = 0, top = (size_t)all_num_blocks; -+ size_t max_idx = 0, top = (size_t)all_num_blocks, processed_bytes = 0; - - /* - * See how many L_{i} entries we need to process data at hand -@@ -443,6 +446,9 @@ int CRYPTO_ocb128_decrypt(OCB128_CONTEXT *ctx, - ctx->stream(in, out, num_blocks, ctx->keydec, - (size_t)ctx->sess.blocks_processed + 1, ctx->sess.offset.c, - (const unsigned char (*)[16])ctx->l, ctx->sess.checksum.c); -+ processed_bytes = num_blocks * 16; -+ in += processed_bytes; -+ out += processed_bytes; - } else { - OCB_BLOCK tmp; - --- -2.52.0 - diff --git a/SPECS/openssl/0001-Fix-heap-buffer-overflow-in-BIO_f_linebuffer.patch b/SPECS/openssl/0001-Fix-heap-buffer-overflow-in-BIO_f_linebuffer.patch deleted file mode 100644 index 7aff251f9c1..00000000000 --- a/SPECS/openssl/0001-Fix-heap-buffer-overflow-in-BIO_f_linebuffer.patch +++ /dev/null @@ -1,67 +0,0 @@ -From fb41a020b838f8145d07586275053568469a999c Mon Sep 17 00:00:00 2001 -From: Neil Horman -Date: Wed, 7 Jan 2026 11:52:09 -0500 -Subject: [PATCH] Fix heap buffer overflow in BIO_f_linebuffer - -When a FIO_f_linebuffer is part of a bio chain, and the next BIO -preforms short writes, the remainder of the unwritten buffer is copied -unconditionally to the internal buffer ctx->obuf, which may not be -sufficiently sized to handle the remaining data, resulting in a buffer -overflow. - -Fix it by only copying data when ctx->obuf has space, flushing to the -next BIO to increase available storage if needed. - -Fixes CVE-2025-68160 ---- - crypto/bio/bf_lbuf.c | 32 ++++++++++++++++++++++++++------ - 1 file changed, 26 insertions(+), 6 deletions(-) - -diff --git a/crypto/bio/bf_lbuf.c b/crypto/bio/bf_lbuf.c -index eed3dc4..ce71231 100644 ---- a/crypto/bio/bf_lbuf.c -+++ b/crypto/bio/bf_lbuf.c -@@ -186,14 +186,34 @@ static int linebuffer_write(BIO *b, const char *in, int inl) - while (foundnl && inl > 0); - /* - * We've written as much as we can. The rest of the input buffer, if -- * any, is text that doesn't and with a NL and therefore needs to be -- * saved for the next trip. -+ * any, is text that doesn't end with a NL and therefore we need to try -+ * free up some space in our obuf so we can make forward progress. - */ -- if (inl > 0) { -- memcpy(&(ctx->obuf[ctx->obuf_len]), in, inl); -- ctx->obuf_len += inl; -- num += inl; -+ while (inl > 0) { -+ size_t avail = (size_t)ctx->obuf_size - (size_t)ctx->obuf_len; -+ size_t to_copy; -+ -+ if (avail == 0) { -+ /* Flush buffered data to make room */ -+ i = BIO_write(b->next_bio, ctx->obuf, ctx->obuf_len); -+ if (i <= 0) { -+ BIO_copy_next_retry(b); -+ return num > 0 ? num : i; -+ } -+ if (i < ctx->obuf_len) -+ memmove(ctx->obuf, ctx->obuf + i, ctx->obuf_len - i); -+ ctx->obuf_len -= i; -+ continue; -+ } -+ -+ to_copy = inl > (int)avail ? avail : (size_t)inl; -+ memcpy(&(ctx->obuf[ctx->obuf_len]), in, to_copy); -+ ctx->obuf_len += (int)to_copy; -+ in += to_copy; -+ inl -= (int)to_copy; -+ num += (int)to_copy; - } -+ - return num; - } - --- -2.45.4 - diff --git a/SPECS/openssl/0001-Replacing-deprecated-functions-with-NULL-or-highest.patch b/SPECS/openssl/0001-Replacing-deprecated-functions-with-NULL-or-highest.patch index 6a92b56fbfb..8cfd1f817f3 100644 --- a/SPECS/openssl/0001-Replacing-deprecated-functions-with-NULL-or-highest.patch +++ b/SPECS/openssl/0001-Replacing-deprecated-functions-with-NULL-or-highest.patch @@ -25,11 +25,11 @@ more supported methods for the SSL protocol. 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/ssl/methods.c b/ssl/methods.c -index c846143277..a7ae074bfd 100644 +index 0709883..38cb033 100644 --- a/ssl/methods.c +++ b/ssl/methods.c -@@ -215,17 +215,29 @@ const SSL_METHOD *TLSv1_client_method(void) - # ifndef OPENSSL_NO_SSL3_METHOD +@@ -228,17 +228,29 @@ const SSL_METHOD *TLSv1_client_method(void) + #ifndef OPENSSL_NO_SSL3_METHOD const SSL_METHOD *SSLv3_method(void) { +# ifdef OPENSSL_NO_SSL3 @@ -56,10 +56,10 @@ index c846143277..a7ae074bfd 100644 return sslv3_client_method(); +# endif } - # endif + #endif -@@ -249,17 +261,17 @@ const SSL_METHOD *DTLSv1_2_client_method(void) - # ifndef OPENSSL_NO_DTLS1_METHOD +@@ -262,17 +274,17 @@ const SSL_METHOD *DTLSv1_2_client_method(void) + #ifndef OPENSSL_NO_DTLS1_METHOD const SSL_METHOD *DTLSv1_method(void) { - return dtlsv1_method(); @@ -77,8 +77,8 @@ index c846143277..a7ae074bfd 100644 - return dtlsv1_client_method(); + return DTLS_client_method(); } - # endif + #endif -- -2.25.1 +2.45.4 diff --git a/SPECS/openssl/0001-Verify-ASN1-object-s-types-before-attempting-to-acce.patch b/SPECS/openssl/0001-Verify-ASN1-object-s-types-before-attempting-to-acce.patch deleted file mode 100644 index 3a2d5250a09..00000000000 --- a/SPECS/openssl/0001-Verify-ASN1-object-s-types-before-attempting-to-acce.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 6453d278557c8719233793730ec500c84aea55d9 Mon Sep 17 00:00:00 2001 -From: Bob Beck -Date: Wed, 7 Jan 2026 11:29:48 -0700 -Subject: [PATCH] Verify ASN1 object's types before attempting to access them - as a particular type - -Issue was reported in ossl_ess_get_signing_cert but is also present in -ossl_ess_get_signing_cert_v2. - -Fixes: https://github.com/openssl/srt/issues/61 -Fixes CVE-2025-69420 ---- - crypto/ts/ts_rsp_verify.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/crypto/ts/ts_rsp_verify.c b/crypto/ts/ts_rsp_verify.c -index 3876e30f47..40dab687d1 100644 ---- a/crypto/ts/ts_rsp_verify.c -+++ b/crypto/ts/ts_rsp_verify.c -@@ -209,7 +209,7 @@ static ESS_SIGNING_CERT *ossl_ess_get_signing_cert(const PKCS7_SIGNER_INFO *si) - const unsigned char *p; - - attr = PKCS7_get_signed_attribute(si, NID_id_smime_aa_signingCertificate); -- if (attr == NULL) -+ if (attr == NULL || attr->type != V_ASN1_SEQUENCE) - return NULL; - p = attr->value.sequence->data; - return d2i_ESS_SIGNING_CERT(NULL, &p, attr->value.sequence->length); -@@ -221,7 +221,7 @@ static ESS_SIGNING_CERT_V2 *ossl_ess_get_signing_cert_v2(const PKCS7_SIGNER_INFO - const unsigned char *p; - - attr = PKCS7_get_signed_attribute(si, NID_id_smime_aa_signingCertificateV2); -- if (attr == NULL) -+ if (attr == NULL || attr->type != V_ASN1_SEQUENCE) - return NULL; - p = attr->value.sequence->data; - return d2i_ESS_SIGNING_CERT_V2(NULL, &p, attr->value.sequence->length); --- -2.52.0 - diff --git a/SPECS/openssl/0001-ossl_quic_get_cipher_by_char-Add-a-NULL-guard-before.patch b/SPECS/openssl/0001-ossl_quic_get_cipher_by_char-Add-a-NULL-guard-before.patch deleted file mode 100644 index 8545630588a..00000000000 --- a/SPECS/openssl/0001-ossl_quic_get_cipher_by_char-Add-a-NULL-guard-before.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 7da6afe3dac7d65b30f87f2c5d305b6e699bc5dc Mon Sep 17 00:00:00 2001 -From: Daniel Kubec -Date: Fri, 9 Jan 2026 14:33:24 +0100 -Subject: [PATCH] ossl_quic_get_cipher_by_char(): Add a NULL guard before - dereferencing SSL_CIPHER - -Fixes CVE-2025-15468 ---- - ssl/quic/quic_impl.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c -index 87c1370a8d..89c108a973 100644 ---- a/ssl/quic/quic_impl.c -+++ b/ssl/quic/quic_impl.c -@@ -5222,6 +5222,8 @@ const SSL_CIPHER *ossl_quic_get_cipher_by_char(const unsigned char *p) - { - const SSL_CIPHER *ciph = ssl3_get_cipher_by_char(p); - -+ if (ciph == NULL) -+ return NULL; - if ((ciph->algorithm2 & SSL_QUIC) == 0) - return NULL; - --- -2.52.0 - diff --git a/SPECS/openssl/0002-Some-comments-to-clarify-functions-usage.patch b/SPECS/openssl/0002-Some-comments-to-clarify-functions-usage.patch deleted file mode 100644 index aa1c7459ce4..00000000000 --- a/SPECS/openssl/0002-Some-comments-to-clarify-functions-usage.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 6fb47957bfb0aef2deaa7df7aebd4eb52ffe20ce Mon Sep 17 00:00:00 2001 -From: Igor Ustinov -Date: Mon, 12 Jan 2026 12:15:42 +0100 -Subject: [PATCH 2/3] Some comments to clarify functions usage - ---- - crypto/asn1/evp_asn1.c | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/crypto/asn1/evp_asn1.c b/crypto/asn1/evp_asn1.c -index 382576364b..e73bda64e3 100644 ---- a/crypto/asn1/evp_asn1.c -+++ b/crypto/asn1/evp_asn1.c -@@ -60,6 +60,12 @@ static ossl_inline void asn1_type_init_oct(ASN1_OCTET_STRING *oct, - oct->flags = 0; - } - -+/* -+ * This function copies 'anum' to 'num' and the data of 'oct' to 'data'. -+ * If the length of 'data' > 'max_len', copies only the first 'max_len' -+ * bytes, but returns the full length of 'oct'; this allows distinguishing -+ * whether all the data was copied. -+ */ - static int asn1_type_get_int_oct(ASN1_OCTET_STRING *oct, int32_t anum, - long *num, unsigned char *data, int max_len) - { -@@ -106,6 +112,13 @@ int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, unsigned char *data, - return 0; - } - -+/* -+ * This function decodes an int-octet sequence and copies the integer to 'num' -+ * and the data of octet to 'data'. -+ * If the length of 'data' > 'max_len', copies only the first 'max_len' -+ * bytes, but returns the full length of 'oct'; this allows distinguishing -+ * whether all the data was copied. -+ */ - int ASN1_TYPE_get_int_octetstring(const ASN1_TYPE *a, long *num, - unsigned char *data, int max_len) - { -@@ -162,6 +175,13 @@ int ossl_asn1_type_set_octetstring_int(ASN1_TYPE *a, long num, - return 0; - } - -+/* -+ * This function decodes an octet-int sequence and copies the data of octet -+ * to 'data' and the integer to 'num'. -+ * If the length of 'data' > 'max_len', copies only the first 'max_len' -+ * bytes, but returns the full length of 'oct'; this allows distinguishing -+ * whether all the data was copied. -+ */ - int ossl_asn1_type_get_octetstring_int(const ASN1_TYPE *a, long *num, - unsigned char *data, int max_len) - { --- -2.52.0 - diff --git a/SPECS/openssl/0003-Test-for-handling-of-AEAD-encrypted-CMS-with-inadmis.patch b/SPECS/openssl/0003-Test-for-handling-of-AEAD-encrypted-CMS-with-inadmis.patch deleted file mode 100644 index 54927d90ca9..00000000000 --- a/SPECS/openssl/0003-Test-for-handling-of-AEAD-encrypted-CMS-with-inadmis.patch +++ /dev/null @@ -1,126 +0,0 @@ -From 1e8f5c7cd2c46b25a2877e8f3f4bbf954fbcdf77 Mon Sep 17 00:00:00 2001 -From: Igor Ustinov -Date: Sun, 11 Jan 2026 11:35:15 +0100 -Subject: [PATCH 3/3] Test for handling of AEAD-encrypted CMS with inadmissibly - long IV - ---- - test/cmsapitest.c | 39 ++++++++++++++++++- - test/recipes/80-test_cmsapi.t | 3 +- - .../encDataWithTooLongIV.pem | 11 ++++++ - 3 files changed, 50 insertions(+), 3 deletions(-) - create mode 100644 test/recipes/80-test_cmsapi_data/encDataWithTooLongIV.pem - -diff --git a/test/cmsapitest.c b/test/cmsapitest.c -index 88d519fd14..472d30c9e5 100644 ---- a/test/cmsapitest.c -+++ b/test/cmsapitest.c -@@ -9,10 +9,10 @@ - - #include - -+#include - #include - #include - #include --#include - #include "../crypto/cms/cms_local.h" /* for d.signedData and d.envelopedData */ - - #include "testutil.h" -@@ -20,6 +20,7 @@ - static X509 *cert = NULL; - static EVP_PKEY *privkey = NULL; - static char *derin = NULL; -+static char *too_long_iv_cms_in = NULL; - - static int test_encrypt_decrypt(const EVP_CIPHER *cipher) - { -@@ -382,6 +383,38 @@ end: - return ret; - } - -+static int test_cms_aesgcm_iv_too_long(void) -+{ -+ int ret = 0; -+ BIO *cmsbio = NULL, *out = NULL; -+ CMS_ContentInfo *cms = NULL; -+ unsigned long err = 0; -+ -+ if (!TEST_ptr(cmsbio = BIO_new_file(too_long_iv_cms_in, "r"))) -+ goto end; -+ -+ if (!TEST_ptr(cms = PEM_read_bio_CMS(cmsbio, NULL, NULL, NULL))) -+ goto end; -+ -+ /* Must fail cleanly (no crash) */ -+ if (!TEST_false(CMS_decrypt(cms, privkey, cert, NULL, out, 0))) -+ goto end; -+ err = ERR_peek_last_error(); -+ if (!TEST_ulong_ne(err, 0)) -+ goto end; -+ if (!TEST_int_eq(ERR_GET_LIB(err), ERR_LIB_CMS)) -+ goto end; -+ if (!TEST_int_eq(ERR_GET_REASON(err), CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR)) -+ goto end; -+ -+ ret = 1; -+end: -+ CMS_ContentInfo_free(cms); -+ BIO_free(cmsbio); -+ BIO_free(out); -+ return ret; -+} -+ - OPT_TEST_DECLARE_USAGE("certfile privkeyfile derfile\n") - - int setup_tests(void) -@@ -396,7 +429,8 @@ int setup_tests(void) - - if (!TEST_ptr(certin = test_get_argument(0)) - || !TEST_ptr(privkeyin = test_get_argument(1)) -- || !TEST_ptr(derin = test_get_argument(2))) -+ || !TEST_ptr(derin = test_get_argument(2)) -+ || !TEST_ptr(too_long_iv_cms_in = test_get_argument(3))) - return 0; - - certbio = BIO_new_file(certin, "r"); -@@ -429,6 +463,7 @@ int setup_tests(void) - ADD_TEST(test_CMS_add1_cert); - ADD_TEST(test_d2i_CMS_bio_NULL); - ADD_ALL_TESTS(test_d2i_CMS_decode, 2); -+ ADD_TEST(test_cms_aesgcm_iv_too_long); - return 1; - } - -diff --git a/test/recipes/80-test_cmsapi.t b/test/recipes/80-test_cmsapi.t -index af00355a9d..182629e71a 100644 ---- a/test/recipes/80-test_cmsapi.t -+++ b/test/recipes/80-test_cmsapi.t -@@ -18,5 +18,6 @@ plan tests => 1; - - ok(run(test(["cmsapitest", srctop_file("test", "certs", "servercert.pem"), - srctop_file("test", "certs", "serverkey.pem"), -- srctop_file("test", "recipes", "80-test_cmsapi_data", "encryptedData.der")])), -+ srctop_file("test", "recipes", "80-test_cmsapi_data", "encryptedData.der"), -+ srctop_file("test", "recipes", "80-test_cmsapi_data", "encDataWithTooLongIV.pem")])), - "running cmsapitest"); -diff --git a/test/recipes/80-test_cmsapi_data/encDataWithTooLongIV.pem b/test/recipes/80-test_cmsapi_data/encDataWithTooLongIV.pem -new file mode 100644 -index 0000000000..4323cd2fb0 ---- /dev/null -+++ b/test/recipes/80-test_cmsapi_data/encDataWithTooLongIV.pem -@@ -0,0 +1,11 @@ -+-----BEGIN CMS----- -+MIIBmgYLKoZIhvcNAQkQARegggGJMIIBhQIBADGCATMwggEvAgEAMBcwEjEQMA4G -+A1UEAwwHUm9vdCBDQQIBAjANBgkqhkiG9w0BAQEFAASCAQC8ZqP1OqbletcUre1V -+b4XOobZzQr6wKMSsdjtGzVbZowUVv5DkOn9VOefrpg4HxMq/oi8IpzVYj8ZiKRMV -+NTJ+/d8FwwBwUUNNP/IDnfEpX+rT1+pGS5zAa7NenLoZgGBNjPy5I2OHP23fPnEd -+sm8YkFjzubkhAD1lod9pEOEqB3V2kTrTTiwzSNtMHggna1zPox6TkdZwFmMnp8d2 -+CVa6lIPGx26gFwCuIDSaavmQ2URJ615L8gAvpYUlpsDqjFsabWsbaOFbMz3bIGJu -+GkrX2ezX7CpuC1wjix26ojlTySJHv+L0IrpcaIzLlC5lB1rqtuija8dGm3rBNm/P -+AAUNMDcGCSqGSIb3DQEHATAjBglghkgBZQMEAQYwFgQRzxwoRQzOHVooVn3CpaWl -+paUCARCABUNdolo6BBA55E9hYaYO2S8C/ZnD8dRO -+-----END CMS----- --- -2.52.0 - diff --git a/SPECS/openssl/0004-Override-default-paths-for-the-CA-directory-tree.patch b/SPECS/openssl/0004-Override-default-paths-for-the-CA-directory-tree.patch index 7f2077446a4..2e51dac843a 100644 --- a/SPECS/openssl/0004-Override-default-paths-for-the-CA-directory-tree.patch +++ b/SPECS/openssl/0004-Override-default-paths-for-the-CA-directory-tree.patch @@ -1,7 +1,7 @@ From 7a65ee33793fa8a28c0dfc94e6872ce92f408b15 Mon Sep 17 00:00:00 2001 From: rpm-build Date: Mon, 31 Jul 2023 09:41:27 +0200 -Subject: [PATCH 04/35] +Subject: [PATCH 04/35] 0004-Override-default-paths-for-the-CA-directory-tree.patch Patch-name: 0004-Override-default-paths-for-the-CA-directory-tree.patch @@ -15,11 +15,11 @@ From-dist-git-commit: 9409bc7044cf4b5773639cce20f51399888c45fd 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/CA.pl.in b/apps/CA.pl.in -index f029470005..729f104a7e 100644 +index 0bad37d..85bf86c 100644 --- a/apps/CA.pl.in +++ b/apps/CA.pl.in -@@ -29,7 +29,7 @@ my $X509 = "$openssl x509"; - my $PKCS12 = "$openssl pkcs12"; +@@ -32,7 +32,7 @@ my @X509 = (@openssl, "x509"); + my @PKCS12 = (@openssl, "pkcs12"); # Default values for various configuration settings. -my $CATOP = "./demoCA"; @@ -28,7 +28,7 @@ index f029470005..729f104a7e 100644 my $CAREQ = "careq.pem"; my $CACERT = "cacert.pem"; diff --git a/apps/openssl.cnf b/apps/openssl.cnf -index 8141ab20cd..3956235fda 100644 +index 00f0d24..02154bd 100644 --- a/apps/openssl.cnf +++ b/apps/openssl.cnf @@ -52,6 +52,8 @@ tsa_policy3 = 1.2.3.4.5.7 @@ -73,5 +73,5 @@ index 8141ab20cd..3956235fda 100644 crypto_device = builtin # OpenSSL engine to use for signing signer_cert = $dir/tsacert.pem # The TSA signing certificate -- -2.41.0 +2.45.4 diff --git a/SPECS/openssl/0005-apps-ca-fix-md-option-help-text.patch b/SPECS/openssl/0005-apps-ca-fix-md-option-help-text.patch index 1fed4c4619c..3e2549e37c0 100644 --- a/SPECS/openssl/0005-apps-ca-fix-md-option-help-text.patch +++ b/SPECS/openssl/0005-apps-ca-fix-md-option-help-text.patch @@ -11,18 +11,18 @@ upstreamable 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/ca.c b/apps/ca.c -index 0f21b4fa1c..3d4b2c1673 100755 +index 37180f9..8cff8ce 100644 --- a/apps/ca.c +++ b/apps/ca.c -@@ -209,7 +209,7 @@ const OPTIONS ca_options[] = { - {"noemailDN", OPT_NOEMAILDN, '-', "Don't add the EMAIL field to the DN"}, +@@ -254,7 +254,7 @@ const OPTIONS ca_options[] = { + { "noemailDN", OPT_NOEMAILDN, '-', "Don't add the EMAIL field to the DN" }, OPT_SECTION("Signing"), -- {"md", OPT_MD, 's', "Digest to use, such as sha256"}, -+ {"md", OPT_MD, 's', "Digest to use, such as sha256; see openssl help for list"}, - {"keyfile", OPT_KEYFILE, 's', "The CA private key"}, - {"keyform", OPT_KEYFORM, 'f', - "Private key file format (ENGINE, other values ignored)"}, +- { "md", OPT_MD, 's', "Digest to use, such as sha256" }, ++ { "md", OPT_MD, 's', "Digest to use, such as sha256; see openssl help for list"}, + { "keyfile", OPT_KEYFILE, 's', "The CA private key" }, + { "keyform", OPT_KEYFORM, 'f', + "Private key file format (ENGINE, other values ignored)" }, -- -2.26.2 +2.45.4 diff --git a/SPECS/openssl/0009-Add-Kernel-FIPS-mode-flag-support.patch b/SPECS/openssl/0009-Add-Kernel-FIPS-mode-flag-support.patch old mode 100755 new mode 100644 index bcf11b21b50..e6da84b9078 --- a/SPECS/openssl/0009-Add-Kernel-FIPS-mode-flag-support.patch +++ b/SPECS/openssl/0009-Add-Kernel-FIPS-mode-flag-support.patch @@ -9,7 +9,7 @@ Subject: [PATCH] Add Kernel FIPS mode flag support 2 files changed, 39 insertions(+) diff --git a/crypto/context.c b/crypto/context.c -index 33d52a9..a9694e7 100644 +index a1ae0f6..5cb04ba 100644 --- a/crypto/context.c +++ b/crypto/context.c @@ -17,6 +17,41 @@ @@ -54,7 +54,7 @@ index 33d52a9..a9694e7 100644 struct ossl_lib_ctx_st { CRYPTO_RWLOCK *lock, *rand_crngt_lock; OSSL_EX_DATA_GLOBAL global; -@@ -368,6 +403,7 @@ static int default_context_inited = 0; +@@ -379,6 +414,7 @@ static int default_context_inited = 0; DEFINE_RUN_ONCE_STATIC(default_context_do_init) { @@ -63,19 +63,19 @@ index 33d52a9..a9694e7 100644 goto err; diff --git a/include/internal/provider.h b/include/internal/provider.h -index ab41d64..efb12ae 100644 +index fa97640..aff882e 100644 --- a/include/internal/provider.h +++ b/include/internal/provider.h @@ -112,6 +112,9 @@ int ossl_provider_init_as_child(OSSL_LIB_CTX *ctx, - const OSSL_DISPATCH *in); + const OSSL_DISPATCH *in); void ossl_provider_deinit_child(OSSL_LIB_CTX *ctx); +/* FIPS flag access */ +int ossl_get_kernel_fips_flag(void); + - # ifdef __cplusplus + #ifdef __cplusplus } - # endif + #endif -- -2.33.8 +2.45.4 diff --git a/SPECS/openssl/0010-Add-changes-to-ectest-and-eccurve.patch b/SPECS/openssl/0010-Add-changes-to-ectest-and-eccurve.patch index 0453a48fe99..ab695ceef6b 100644 --- a/SPECS/openssl/0010-Add-changes-to-ectest-and-eccurve.patch +++ b/SPECS/openssl/0010-Add-changes-to-ectest-and-eccurve.patch @@ -2,17 +2,16 @@ From 1b52eeff21f095f940267ee63c87f59c132a40d7 Mon Sep 17 00:00:00 2001 From: Tobias Brick Date: Wed, 17 Apr 2024 21:35:37 +0000 Subject: [PATCH] Add changes to ectest and eccurve - --- - crypto/ec/ec_curve.c | 844 ------------------------------------------- - test/ectest.c | 174 +-------- - 2 files changed, 8 insertions(+), 1010 deletions(-) + crypto/ec/ec_curve.c | 749 ------------------------------------------- + test/ectest.c | 173 +--------- + 2 files changed, 8 insertions(+), 914 deletions(-) diff --git a/crypto/ec/ec_curve.c b/crypto/ec/ec_curve.c -index d703d16..b3f6e28 100644 +index 4d572fb..86fcea8 100644 --- a/crypto/ec/ec_curve.c +++ b/crypto/ec/ec_curve.c -@@ -30,38 +30,6 @@ typedef struct { +@@ -30,34 +30,6 @@ typedef struct { } EC_CURVE_DATA; /* the nist prime curves */ @@ -20,11 +19,8 @@ index d703d16..b3f6e28 100644 - EC_CURVE_DATA h; - unsigned char data[20 + 24 * 6]; -} _EC_NIST_PRIME_192 = { -- { -- NID_X9_62_prime_field, 20, 24, 1 -- }, -- { -- /* seed */ +- { NID_X9_62_prime_field, 20, 24, 1 }, +- { /* seed */ - 0x30, 0x45, 0xAE, 0x6F, 0xC8, 0x42, 0x2F, 0x64, 0xED, 0x57, 0x95, 0x28, - 0xD3, 0x81, 0x20, 0xEA, 0xE1, 0x21, 0x96, 0xD5, - /* p */ @@ -44,28 +40,24 @@ index d703d16..b3f6e28 100644 - 0x6b, 0x24, 0xcd, 0xd5, 0x73, 0xf9, 0x77, 0xa1, 0x1e, 0x79, 0x48, 0x11, - /* order */ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -- 0x99, 0xDE, 0xF8, 0x36, 0x14, 0x6B, 0xC9, 0xB1, 0xB4, 0xD2, 0x28, 0x31 -- } +- 0x99, 0xDE, 0xF8, 0x36, 0x14, 0x6B, 0xC9, 0xB1, 0xB4, 0xD2, 0x28, 0x31 } -}; - static const struct { EC_CURVE_DATA h; unsigned char data[20 + 28 * 6]; -@@ -200,187 +168,6 @@ static const struct { - } +@@ -184,167 +156,6 @@ static const struct { + 0xB7, 0x1E, 0x91, 0x38, 0x64, 0x09 } }; --# ifndef FIPS_MODULE +-#ifndef FIPS_MODULE -/* the x9.62 prime curves (minus the nist prime curves) */ -static const struct { - EC_CURVE_DATA h; - unsigned char data[20 + 24 * 6]; -} _EC_X9_62_PRIME_192V2 = { -- { -- NID_X9_62_prime_field, 20, 24, 1 -- }, -- { -- /* seed */ +- { NID_X9_62_prime_field, 20, 24, 1 }, +- { /* seed */ - 0x31, 0xA9, 0x2E, 0xE2, 0x02, 0x9F, 0xD1, 0x0D, 0x90, 0x1B, 0x11, 0x3E, - 0x99, 0x07, 0x10, 0xF0, 0xD2, 0x1A, 0xC6, 0xB6, - /* p */ @@ -85,19 +77,15 @@ index d703d16..b3f6e28 100644 - 0x08, 0x3d, 0xf2, 0xf2, 0xb0, 0x84, 0x7d, 0xe9, 0x70, 0xb2, 0xde, 0x15, - /* order */ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, -- 0x5F, 0xB1, 0xA7, 0x24, 0xDC, 0x80, 0x41, 0x86, 0x48, 0xD8, 0xDD, 0x31 -- } +- 0x5F, 0xB1, 0xA7, 0x24, 0xDC, 0x80, 0x41, 0x86, 0x48, 0xD8, 0xDD, 0x31 } -}; - -static const struct { - EC_CURVE_DATA h; - unsigned char data[20 + 24 * 6]; -} _EC_X9_62_PRIME_192V3 = { -- { -- NID_X9_62_prime_field, 20, 24, 1 -- }, -- { -- /* seed */ +- { NID_X9_62_prime_field, 20, 24, 1 }, +- { /* seed */ - 0xC4, 0x69, 0x68, 0x44, 0x35, 0xDE, 0xB3, 0x78, 0xC4, 0xB6, 0x5C, 0xA9, - 0x59, 0x1E, 0x2A, 0x57, 0x63, 0x05, 0x9A, 0x2E, - /* p */ @@ -117,19 +105,15 @@ index d703d16..b3f6e28 100644 - 0x6a, 0x6d, 0xc8, 0xf9, 0x97, 0x8a, 0xca, 0x76, 0x48, 0xa9, 0x43, 0xb0, - /* order */ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -- 0x7A, 0x62, 0xD0, 0x31, 0xC8, 0x3F, 0x42, 0x94, 0xF6, 0x40, 0xEC, 0x13 -- } +- 0x7A, 0x62, 0xD0, 0x31, 0xC8, 0x3F, 0x42, 0x94, 0xF6, 0x40, 0xEC, 0x13 } -}; - -static const struct { - EC_CURVE_DATA h; - unsigned char data[20 + 30 * 6]; -} _EC_X9_62_PRIME_239V1 = { -- { -- NID_X9_62_prime_field, 20, 30, 1 -- }, -- { -- /* seed */ +- { NID_X9_62_prime_field, 20, 30, 1 }, +- { /* seed */ - 0xE4, 0x3B, 0xB4, 0x60, 0xF0, 0xB8, 0x0C, 0xC0, 0xC0, 0xB0, 0x75, 0x79, - 0x8E, 0x94, 0x80, 0x60, 0xF8, 0x32, 0x1B, 0x7D, - /* p */ @@ -155,19 +139,15 @@ index d703d16..b3f6e28 100644 - /* order */ - 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0x7F, 0xFF, 0xFF, 0x9E, 0x5E, 0x9A, 0x9F, 0x5D, 0x90, 0x71, 0xFB, 0xD1, -- 0x52, 0x26, 0x88, 0x90, 0x9D, 0x0B -- } +- 0x52, 0x26, 0x88, 0x90, 0x9D, 0x0B } -}; - -static const struct { - EC_CURVE_DATA h; - unsigned char data[20 + 30 * 6]; -} _EC_X9_62_PRIME_239V2 = { -- { -- NID_X9_62_prime_field, 20, 30, 1 -- }, -- { -- /* seed */ +- { NID_X9_62_prime_field, 20, 30, 1 }, +- { /* seed */ - 0xE8, 0xB4, 0x01, 0x16, 0x04, 0x09, 0x53, 0x03, 0xCA, 0x3B, 0x80, 0x99, - 0x98, 0x2B, 0xE0, 0x9F, 0xCB, 0x9A, 0xE6, 0x16, - /* p */ @@ -193,19 +173,15 @@ index d703d16..b3f6e28 100644 - /* order */ - 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0x80, 0x00, 0x00, 0xCF, 0xA7, 0xE8, 0x59, 0x43, 0x77, 0xD4, 0x14, 0xC0, -- 0x38, 0x21, 0xBC, 0x58, 0x20, 0x63 -- } +- 0x38, 0x21, 0xBC, 0x58, 0x20, 0x63 } -}; - -static const struct { - EC_CURVE_DATA h; - unsigned char data[20 + 30 * 6]; -} _EC_X9_62_PRIME_239V3 = { -- { -- NID_X9_62_prime_field, 20, 30, 1 -- }, -- { -- /* seed */ +- { NID_X9_62_prime_field, 20, 30, 1 }, +- { /* seed */ - 0x7D, 0x73, 0x74, 0x16, 0x8F, 0xFE, 0x34, 0x71, 0xB6, 0x0A, 0x85, 0x76, - 0x86, 0xA1, 0x94, 0x75, 0xD3, 0xBF, 0xA2, 0xFF, - /* p */ @@ -231,15 +207,14 @@ index d703d16..b3f6e28 100644 - /* order */ - 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0x7F, 0xFF, 0xFF, 0x97, 0x5D, 0xEB, 0x41, 0xB3, 0xA6, 0x05, 0x7C, 0x3C, -- 0x43, 0x21, 0x46, 0x52, 0x65, 0x51 -- } +- 0x43, 0x21, 0x46, 0x52, 0x65, 0x51 } -}; -#endif /* FIPS_MODULE */ - static const struct { EC_CURVE_DATA h; unsigned char data[20 + 32 * 6]; -@@ -421,294 +208,6 @@ static const struct { +@@ -381,258 +192,6 @@ static const struct { #ifndef FIPS_MODULE /* the secg prime curves (minus the nist and x9.62 prime curves) */ @@ -247,11 +222,8 @@ index d703d16..b3f6e28 100644 - EC_CURVE_DATA h; - unsigned char data[20 + 14 * 6]; -} _EC_SECG_PRIME_112R1 = { -- { -- NID_X9_62_prime_field, 20, 14, 1 -- }, -- { -- /* seed */ +- { NID_X9_62_prime_field, 20, 14, 1 }, +- { /* seed */ - 0x00, 0xF5, 0x0B, 0x02, 0x8E, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, - 0x51, 0x75, 0x29, 0x04, 0x72, 0x78, 0x3F, 0xB1, - /* p */ @@ -271,19 +243,15 @@ index d703d16..b3f6e28 100644 - 0x75, 0x00, - /* order */ - 0xDB, 0x7C, 0x2A, 0xBF, 0x62, 0xE3, 0x5E, 0x76, 0x28, 0xDF, 0xAC, 0x65, -- 0x61, 0xC5 -- } +- 0x61, 0xC5 } -}; - -static const struct { - EC_CURVE_DATA h; - unsigned char data[20 + 14 * 6]; -} _EC_SECG_PRIME_112R2 = { -- { -- NID_X9_62_prime_field, 20, 14, 4 -- }, -- { -- /* seed */ +- { NID_X9_62_prime_field, 20, 14, 4 }, +- { /* seed */ - 0x00, 0x27, 0x57, 0xA1, 0x11, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, - 0x51, 0x75, 0x53, 0x16, 0xC0, 0x5E, 0x0B, 0xD4, - /* p */ @@ -303,19 +271,15 @@ index d703d16..b3f6e28 100644 - 0x6e, 0x97, - /* order */ - 0x36, 0xDF, 0x0A, 0xAF, 0xD8, 0xB8, 0xD7, 0x59, 0x7C, 0xA1, 0x05, 0x20, -- 0xD0, 0x4B -- } +- 0xD0, 0x4B } -}; - -static const struct { - EC_CURVE_DATA h; - unsigned char data[20 + 16 * 6]; -} _EC_SECG_PRIME_128R1 = { -- { -- NID_X9_62_prime_field, 20, 16, 1 -- }, -- { -- /* seed */ +- { NID_X9_62_prime_field, 20, 16, 1 }, +- { /* seed */ - 0x00, 0x0E, 0x0D, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, 0x51, 0x75, - 0x0C, 0xC0, 0x3A, 0x44, 0x73, 0xD0, 0x36, 0x79, - /* p */ @@ -335,19 +299,15 @@ index d703d16..b3f6e28 100644 - 0xdd, 0xed, 0x7a, 0x83, - /* order */ - 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x75, 0xA3, 0x0D, 0x1B, -- 0x90, 0x38, 0xA1, 0x15 -- } +- 0x90, 0x38, 0xA1, 0x15 } -}; - -static const struct { - EC_CURVE_DATA h; - unsigned char data[20 + 16 * 6]; -} _EC_SECG_PRIME_128R2 = { -- { -- NID_X9_62_prime_field, 20, 16, 4 -- }, -- { -- /* seed */ +- { NID_X9_62_prime_field, 20, 16, 4 }, +- { /* seed */ - 0x00, 0x4D, 0x69, 0x6E, 0x67, 0x68, 0x75, 0x61, 0x51, 0x75, 0x12, 0xD8, - 0xF0, 0x34, 0x31, 0xFC, 0xE6, 0x3B, 0x88, 0xF4, - /* p */ @@ -367,19 +327,15 @@ index d703d16..b3f6e28 100644 - 0x5f, 0xc3, 0x4b, 0x44, - /* order */ - 0x3F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xBE, 0x00, 0x24, 0x72, -- 0x06, 0x13, 0xB5, 0xA3 -- } +- 0x06, 0x13, 0xB5, 0xA3 } -}; - -static const struct { - EC_CURVE_DATA h; - unsigned char data[0 + 21 * 6]; -} _EC_SECG_PRIME_160K1 = { -- { -- NID_X9_62_prime_field, 0, 21, 1 -- }, -- { -- /* no seed */ +- { NID_X9_62_prime_field, 0, 21, 1 }, +- { /* no seed */ - /* p */ - 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xAC, 0x73, @@ -397,19 +353,15 @@ index d703d16..b3f6e28 100644 - 0x86, 0x53, 0x17, 0x33, 0xc3, 0xf0, 0x3c, 0x4f, 0xee, - /* order */ - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xB8, -- 0xFA, 0x16, 0xDF, 0xAB, 0x9A, 0xCA, 0x16, 0xB6, 0xB3 -- } +- 0xFA, 0x16, 0xDF, 0xAB, 0x9A, 0xCA, 0x16, 0xB6, 0xB3 } -}; - -static const struct { - EC_CURVE_DATA h; - unsigned char data[20 + 21 * 6]; -} _EC_SECG_PRIME_160R1 = { -- { -- NID_X9_62_prime_field, 20, 21, 1 -- }, -- { -- /* seed */ +- { NID_X9_62_prime_field, 20, 21, 1 }, +- { /* seed */ - 0x10, 0x53, 0xCD, 0xE4, 0x2C, 0x14, 0xD6, 0x96, 0xE6, 0x76, 0x87, 0x56, - 0x15, 0x17, 0x53, 0x3B, 0xF3, 0xF8, 0x33, 0x45, - /* p */ @@ -429,19 +381,15 @@ index d703d16..b3f6e28 100644 - 0x12, 0x04, 0x23, 0x51, 0x37, 0x7a, 0xc5, 0xfb, 0x32, - /* order */ - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xF4, -- 0xC8, 0xF9, 0x27, 0xAE, 0xD3, 0xCA, 0x75, 0x22, 0x57 -- } +- 0xC8, 0xF9, 0x27, 0xAE, 0xD3, 0xCA, 0x75, 0x22, 0x57 } -}; - -static const struct { - EC_CURVE_DATA h; - unsigned char data[20 + 21 * 6]; -} _EC_SECG_PRIME_160R2 = { -- { -- NID_X9_62_prime_field, 20, 21, 1 -- }, -- { -- /* seed */ +- { NID_X9_62_prime_field, 20, 21, 1 }, +- { /* seed */ - 0xB9, 0x9B, 0x99, 0xB0, 0x99, 0xB3, 0x23, 0xE0, 0x27, 0x09, 0xA4, 0xD6, - 0x96, 0xE6, 0x76, 0x87, 0x56, 0x15, 0x17, 0x51, - /* p */ @@ -461,19 +409,15 @@ index d703d16..b3f6e28 100644 - 0x0d, 0xf9, 0x98, 0x2c, 0xfe, 0xa7, 0xd4, 0x3f, 0x2e, - /* order */ - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x35, -- 0x1E, 0xE7, 0x86, 0xA8, 0x18, 0xF3, 0xA1, 0xA1, 0x6B -- } +- 0x1E, 0xE7, 0x86, 0xA8, 0x18, 0xF3, 0xA1, 0xA1, 0x6B } -}; - -static const struct { - EC_CURVE_DATA h; - unsigned char data[0 + 24 * 6]; -} _EC_SECG_PRIME_192K1 = { -- { -- NID_X9_62_prime_field, 0, 24, 1 -- }, -- { -- /* no seed */ +- { NID_X9_62_prime_field, 0, 24, 1 }, +- { /* no seed */ - /* p */ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xEE, 0x37, @@ -491,19 +435,15 @@ index d703d16..b3f6e28 100644 - 0x15, 0xbe, 0x86, 0x34, 0x40, 0x82, 0xaa, 0x88, 0xd9, 0x5e, 0x2f, 0x9d, - /* order */ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, -- 0x26, 0xF2, 0xFC, 0x17, 0x0F, 0x69, 0x46, 0x6A, 0x74, 0xDE, 0xFD, 0x8D -- } +- 0x26, 0xF2, 0xFC, 0x17, 0x0F, 0x69, 0x46, 0x6A, 0x74, 0xDE, 0xFD, 0x8D } -}; - -static const struct { - EC_CURVE_DATA h; - unsigned char data[0 + 29 * 6]; -} _EC_SECG_PRIME_224K1 = { -- { -- NID_X9_62_prime_field, 0, 29, 1 -- }, -- { -- /* no seed */ +- { NID_X9_62_prime_field, 0, 29, 1 }, +- { /* no seed */ - /* p */ - 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, @@ -527,27 +467,24 @@ index d703d16..b3f6e28 100644 - /* order */ - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0xDC, 0xE8, 0xD2, 0xEC, 0x61, 0x84, 0xCA, 0xF0, 0xA9, -- 0x71, 0x76, 0x9F, 0xB1, 0xF7 -- } +- 0x71, 0x76, 0x9F, 0xB1, 0xF7 } -}; - static const struct { EC_CURVE_DATA h; unsigned char data[0 + 32 * 6]; -@@ -745,102 +244,6 @@ static const struct { - } +@@ -664,91 +223,6 @@ static const struct { + 0xFF, 0xFF, 0xFF, 0xFE, 0xBA, 0xAE, 0xDC, 0xE6, 0xAF, 0x48, 0xA0, 0x3B, + 0xBF, 0xD2, 0x5E, 0x8C, 0xD0, 0x36, 0x41, 0x41 } }; - +- -/* some wap/wtls curves */ -static const struct { - EC_CURVE_DATA h; - unsigned char data[0 + 15 * 6]; -} _EC_WTLS_8 = { -- { -- NID_X9_62_prime_field, 0, 15, 1 -- }, -- { -- /* no seed */ +- { NID_X9_62_prime_field, 0, 15, 1 }, +- { /* no seed */ - /* p */ - 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFD, 0xE7, @@ -565,19 +502,15 @@ index d703d16..b3f6e28 100644 - 0x00, 0x00, 0x02, - /* order */ - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xEC, 0xEA, 0x55, 0x1A, -- 0xD8, 0x37, 0xE9 -- } +- 0xD8, 0x37, 0xE9 } -}; - -static const struct { - EC_CURVE_DATA h; - unsigned char data[0 + 21 * 6]; -} _EC_WTLS_9 = { -- { -- NID_X9_62_prime_field, 0, 21, 1 -- }, -- { -- /* no seed */ +- { NID_X9_62_prime_field, 0, 21, 1 }, +- { /* no seed */ - /* p */ - 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x80, 0x8F, @@ -595,19 +528,15 @@ index d703d16..b3f6e28 100644 - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, - /* order */ - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xCD, -- 0xC9, 0x8A, 0xE0, 0xE2, 0xDE, 0x57, 0x4A, 0xBF, 0x33 -- } +- 0xC9, 0x8A, 0xE0, 0xE2, 0xDE, 0x57, 0x4A, 0xBF, 0x33 } -}; - -static const struct { - EC_CURVE_DATA h; - unsigned char data[0 + 28 * 6]; -} _EC_WTLS_12 = { -- { -- NID_X9_62_prime_field, 0, 28, 1 -- }, -- { -- /* no seed */ +- { NID_X9_62_prime_field, 0, 28, 1 }, +- { /* no seed */ - /* p */ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -631,13 +560,12 @@ index d703d16..b3f6e28 100644 - /* order */ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0x16, 0xA2, 0xE0, 0xB8, 0xF0, 0x3E, 0x13, 0xDD, 0x29, 0x45, -- 0x5C, 0x5C, 0x2A, 0x3D -- } +- 0x5C, 0x5C, 0x2A, 0x3D } -}; #endif /* FIPS_MODULE */ #ifndef OPENSSL_NO_EC2M -@@ -2236,198 +1639,6 @@ static const struct { +@@ -1996,174 +1470,6 @@ static const struct { */ #ifndef FIPS_MODULE @@ -645,11 +573,8 @@ index d703d16..b3f6e28 100644 - EC_CURVE_DATA h; - unsigned char data[0 + 20 * 6]; -} _EC_brainpoolP160r1 = { -- { -- NID_X9_62_prime_field, 0, 20, 1 -- }, -- { -- /* no seed */ +- { NID_X9_62_prime_field, 0, 20, 1 }, +- { /* no seed */ - /* p */ - 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, 0xC7, 0xAD, - 0x95, 0xB3, 0xD8, 0x13, 0x95, 0x15, 0x62, 0x0F, @@ -667,19 +592,15 @@ index d703d16..b3f6e28 100644 - 0x66, 0x9C, 0x97, 0x63, 0x16, 0xDA, 0x63, 0x21, - /* order */ - 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, 0x59, 0x91, -- 0xD4, 0x50, 0x29, 0x40, 0x9E, 0x60, 0xFC, 0x09 -- } +- 0xD4, 0x50, 0x29, 0x40, 0x9E, 0x60, 0xFC, 0x09 } -}; - -static const struct { - EC_CURVE_DATA h; - unsigned char data[0 + 20 * 6]; -} _EC_brainpoolP160t1 = { -- { -- NID_X9_62_prime_field, 0, 20, 1 -- }, -- { -- /* no seed */ +- { NID_X9_62_prime_field, 0, 20, 1 }, +- { /* no seed */ - /* p */ - 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, 0xC7, 0xAD, - 0x95, 0xB3, 0xD8, 0x13, 0x95, 0x15, 0x62, 0x0F, @@ -697,19 +618,15 @@ index d703d16..b3f6e28 100644 - 0x24, 0x43, 0x77, 0x21, 0x52, 0xC9, 0xE0, 0xAD, - /* order */ - 0xE9, 0x5E, 0x4A, 0x5F, 0x73, 0x70, 0x59, 0xDC, 0x60, 0xDF, 0x59, 0x91, -- 0xD4, 0x50, 0x29, 0x40, 0x9E, 0x60, 0xFC, 0x09 -- } +- 0xD4, 0x50, 0x29, 0x40, 0x9E, 0x60, 0xFC, 0x09 } -}; - -static const struct { - EC_CURVE_DATA h; - unsigned char data[0 + 24 * 6]; -} _EC_brainpoolP192r1 = { -- { -- NID_X9_62_prime_field, 0, 24, 1 -- }, -- { -- /* no seed */ +- { NID_X9_62_prime_field, 0, 24, 1 }, +- { /* no seed */ - /* p */ - 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, 0x46, 0x30, - 0x93, 0xD1, 0x8D, 0xB7, 0x8F, 0xCE, 0x47, 0x6D, 0xE1, 0xA8, 0x62, 0x97, @@ -727,19 +644,15 @@ index d703d16..b3f6e28 100644 - 0xC1, 0x49, 0x00, 0x02, 0xE6, 0x77, 0x3F, 0xA2, 0xFA, 0x29, 0x9B, 0x8F, - /* order */ - 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, 0x46, 0x2F, -- 0x9E, 0x9E, 0x91, 0x6B, 0x5B, 0xE8, 0xF1, 0x02, 0x9A, 0xC4, 0xAC, 0xC1 -- } +- 0x9E, 0x9E, 0x91, 0x6B, 0x5B, 0xE8, 0xF1, 0x02, 0x9A, 0xC4, 0xAC, 0xC1 } -}; - -static const struct { - EC_CURVE_DATA h; - unsigned char data[0 + 24 * 6]; -} _EC_brainpoolP192t1 = { -- { -- NID_X9_62_prime_field, 0, 24, 1 -- }, -- { -- /* no seed */ +- { NID_X9_62_prime_field, 0, 24, 1 }, +- { /* no seed */ - /* p */ - 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, 0x46, 0x30, - 0x93, 0xD1, 0x8D, 0xB7, 0x8F, 0xCE, 0x47, 0x6D, 0xE1, 0xA8, 0x62, 0x97, @@ -757,19 +670,15 @@ index d703d16..b3f6e28 100644 - 0x44, 0x9D, 0x00, 0x84, 0xB7, 0xE5, 0xB3, 0xDE, 0x7C, 0xCC, 0x01, 0xC9, - /* order */ - 0xC3, 0x02, 0xF4, 0x1D, 0x93, 0x2A, 0x36, 0xCD, 0xA7, 0xA3, 0x46, 0x2F, -- 0x9E, 0x9E, 0x91, 0x6B, 0x5B, 0xE8, 0xF1, 0x02, 0x9A, 0xC4, 0xAC, 0xC1 -- } +- 0x9E, 0x9E, 0x91, 0x6B, 0x5B, 0xE8, 0xF1, 0x02, 0x9A, 0xC4, 0xAC, 0xC1 } -}; - -static const struct { - EC_CURVE_DATA h; - unsigned char data[0 + 28 * 6]; -} _EC_brainpoolP224r1 = { -- { -- NID_X9_62_prime_field, 0, 28, 1 -- }, -- { -- /* no seed */ +- { NID_X9_62_prime_field, 0, 28, 1 }, +- { /* no seed */ - /* p */ - 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, 0x30, 0x25, - 0x75, 0xD1, 0xD7, 0x87, 0xB0, 0x9F, 0x07, 0x57, 0x97, 0xDA, 0x89, 0xF5, @@ -793,19 +702,15 @@ index d703d16..b3f6e28 100644 - /* order */ - 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, 0x30, 0x25, - 0x75, 0xD0, 0xFB, 0x98, 0xD1, 0x16, 0xBC, 0x4B, 0x6D, 0xDE, 0xBC, 0xA3, -- 0xA5, 0xA7, 0x93, 0x9F -- } +- 0xA5, 0xA7, 0x93, 0x9F } -}; - -static const struct { - EC_CURVE_DATA h; - unsigned char data[0 + 28 * 6]; -} _EC_brainpoolP224t1 = { -- { -- NID_X9_62_prime_field, 0, 28, 1 -- }, -- { -- /* no seed */ +- { NID_X9_62_prime_field, 0, 28, 1 }, +- { /* no seed */ - /* p */ - 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, 0x30, 0x25, - 0x75, 0xD1, 0xD7, 0x87, 0xB0, 0x9F, 0x07, 0x57, 0x97, 0xDA, 0x89, 0xF5, @@ -829,114 +734,113 @@ index d703d16..b3f6e28 100644 - /* order */ - 0xD7, 0xC1, 0x34, 0xAA, 0x26, 0x43, 0x66, 0x86, 0x2A, 0x18, 0x30, 0x25, - 0x75, 0xD0, 0xFB, 0x98, 0xD1, 0x16, 0xBC, 0x4B, 0x6D, 0xDE, 0xBC, 0xA3, -- 0xA5, 0xA7, 0x93, 0x9F -- } +- 0xA5, 0xA7, 0x93, 0x9F } -}; - static const struct { EC_CURVE_DATA h; unsigned char data[0 + 32 * 6]; -@@ -2856,8 +2067,6 @@ static const ec_list_element curve_list[] = { - "NIST/SECG curve over a 521 bit prime field"}, +@@ -2732,8 +2038,6 @@ static const ec_list_element curve_list[] = { + "NIST/SECG curve over a 521 bit prime field" }, /* X9.62 curves */ -- {NID_X9_62_prime192v1, &_EC_NIST_PRIME_192.h, 0, -- "NIST/X9.62/SECG curve over a 192 bit prime field"}, - {NID_X9_62_prime256v1, &_EC_X9_62_PRIME_256V1.h, - # if defined(ECP_NISTZ256_ASM) - EC_GFp_nistz256_method, -@@ -2901,25 +2110,6 @@ static const ec_list_element curve_list[] = { +- { NID_X9_62_prime192v1, &_EC_NIST_PRIME_192.h, 0, +- "NIST/X9.62/SECG curve over a 192 bit prime field" }, + { NID_X9_62_prime256v1, &_EC_X9_62_PRIME_256V1.h, + #if defined(ECP_NISTZ256_ASM) + EC_GFp_nistz256_method, +@@ -2777,25 +2081,6 @@ static const ec_list_element curve_list[] = { static const ec_list_element curve_list[] = { /* prime field curves */ /* secg curves */ -- {NID_secp112r1, &_EC_SECG_PRIME_112R1.h, 0, -- "SECG/WTLS curve over a 112 bit prime field"}, -- {NID_secp112r2, &_EC_SECG_PRIME_112R2.h, 0, -- "SECG curve over a 112 bit prime field"}, -- {NID_secp128r1, &_EC_SECG_PRIME_128R1.h, 0, -- "SECG curve over a 128 bit prime field"}, -- {NID_secp128r2, &_EC_SECG_PRIME_128R2.h, 0, -- "SECG curve over a 128 bit prime field"}, -- {NID_secp160k1, &_EC_SECG_PRIME_160K1.h, 0, -- "SECG curve over a 160 bit prime field"}, -- {NID_secp160r1, &_EC_SECG_PRIME_160R1.h, 0, -- "SECG curve over a 160 bit prime field"}, -- {NID_secp160r2, &_EC_SECG_PRIME_160R2.h, 0, -- "SECG/WTLS curve over a 160 bit prime field"}, +- { NID_secp112r1, &_EC_SECG_PRIME_112R1.h, 0, +- "SECG/WTLS curve over a 112 bit prime field" }, +- { NID_secp112r2, &_EC_SECG_PRIME_112R2.h, 0, +- "SECG curve over a 112 bit prime field" }, +- { NID_secp128r1, &_EC_SECG_PRIME_128R1.h, 0, +- "SECG curve over a 128 bit prime field" }, +- { NID_secp128r2, &_EC_SECG_PRIME_128R2.h, 0, +- "SECG curve over a 128 bit prime field" }, +- { NID_secp160k1, &_EC_SECG_PRIME_160K1.h, 0, +- "SECG curve over a 160 bit prime field" }, +- { NID_secp160r1, &_EC_SECG_PRIME_160R1.h, 0, +- "SECG curve over a 160 bit prime field" }, +- { NID_secp160r2, &_EC_SECG_PRIME_160R2.h, 0, +- "SECG/WTLS curve over a 160 bit prime field" }, - /* SECG secp192r1 is the same as X9.62 prime192v1 and hence omitted */ -- {NID_secp192k1, &_EC_SECG_PRIME_192K1.h, 0, -- "SECG curve over a 192 bit prime field"}, -- {NID_secp224k1, &_EC_SECG_PRIME_224K1.h, 0, -- "SECG curve over a 224 bit prime field"}, - # ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 - {NID_secp224r1, &_EC_NIST_PRIME_224.h, EC_GFp_nistp224_method, - "NIST/SECG curve over a 224 bit prime field"}, -@@ -2949,18 +2139,6 @@ static const ec_list_element curve_list[] = { - # endif - "NIST/SECG curve over a 521 bit prime field"}, +- { NID_secp192k1, &_EC_SECG_PRIME_192K1.h, 0, +- "SECG curve over a 192 bit prime field" }, +- { NID_secp224k1, &_EC_SECG_PRIME_224K1.h, 0, +- "SECG curve over a 224 bit prime field" }, + #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 + { NID_secp224r1, &_EC_NIST_PRIME_224.h, EC_GFp_nistp224_method, + "NIST/SECG curve over a 224 bit prime field" }, +@@ -2825,18 +2110,6 @@ static const ec_list_element curve_list[] = { + #endif + "NIST/SECG curve over a 521 bit prime field" }, /* X9.62 curves */ -- {NID_X9_62_prime192v1, &_EC_NIST_PRIME_192.h, 0, -- "NIST/X9.62/SECG curve over a 192 bit prime field"}, -- {NID_X9_62_prime192v2, &_EC_X9_62_PRIME_192V2.h, 0, -- "X9.62 curve over a 192 bit prime field"}, -- {NID_X9_62_prime192v3, &_EC_X9_62_PRIME_192V3.h, 0, -- "X9.62 curve over a 192 bit prime field"}, -- {NID_X9_62_prime239v1, &_EC_X9_62_PRIME_239V1.h, 0, -- "X9.62 curve over a 239 bit prime field"}, -- {NID_X9_62_prime239v2, &_EC_X9_62_PRIME_239V2.h, 0, -- "X9.62 curve over a 239 bit prime field"}, -- {NID_X9_62_prime239v3, &_EC_X9_62_PRIME_239V3.h, 0, -- "X9.62 curve over a 239 bit prime field"}, - {NID_X9_62_prime256v1, &_EC_X9_62_PRIME_256V1.h, - # if defined(ECP_NISTZ256_ASM) - EC_GFp_nistz256_method, -@@ -3057,22 +2235,12 @@ static const ec_list_element curve_list[] = { - {NID_wap_wsg_idm_ecid_wtls5, &_EC_X9_62_CHAR2_163V1.h, 0, - "X9.62 curve over a 163 bit binary field"}, - # endif -- {NID_wap_wsg_idm_ecid_wtls6, &_EC_SECG_PRIME_112R1.h, 0, -- "SECG/WTLS curve over a 112 bit prime field"}, -- {NID_wap_wsg_idm_ecid_wtls7, &_EC_SECG_PRIME_160R2.h, 0, -- "SECG/WTLS curve over a 160 bit prime field"}, -- {NID_wap_wsg_idm_ecid_wtls8, &_EC_WTLS_8.h, 0, -- "WTLS curve over a 112 bit prime field"}, -- {NID_wap_wsg_idm_ecid_wtls9, &_EC_WTLS_9.h, 0, -- "WTLS curve over a 160 bit prime field"}, - # ifndef OPENSSL_NO_EC2M - {NID_wap_wsg_idm_ecid_wtls10, &_EC_NIST_CHAR2_233K.h, 0, - "NIST/SECG/WTLS curve over a 233 bit binary field"}, - {NID_wap_wsg_idm_ecid_wtls11, &_EC_NIST_CHAR2_233B.h, 0, - "NIST/SECG/WTLS curve over a 233 bit binary field"}, - # endif -- {NID_wap_wsg_idm_ecid_wtls12, &_EC_WTLS_12.h, 0, -- "WTLS curve over a 224 bit prime field"}, - # ifndef OPENSSL_NO_EC2M +- { NID_X9_62_prime192v1, &_EC_NIST_PRIME_192.h, 0, +- "NIST/X9.62/SECG curve over a 192 bit prime field" }, +- { NID_X9_62_prime192v2, &_EC_X9_62_PRIME_192V2.h, 0, +- "X9.62 curve over a 192 bit prime field" }, +- { NID_X9_62_prime192v3, &_EC_X9_62_PRIME_192V3.h, 0, +- "X9.62 curve over a 192 bit prime field" }, +- { NID_X9_62_prime239v1, &_EC_X9_62_PRIME_239V1.h, 0, +- "X9.62 curve over a 239 bit prime field" }, +- { NID_X9_62_prime239v2, &_EC_X9_62_PRIME_239V2.h, 0, +- "X9.62 curve over a 239 bit prime field" }, +- { NID_X9_62_prime239v3, &_EC_X9_62_PRIME_239V3.h, 0, +- "X9.62 curve over a 239 bit prime field" }, + { NID_X9_62_prime256v1, &_EC_X9_62_PRIME_256V1.h, + #if defined(ECP_NISTZ256_ASM) + EC_GFp_nistz256_method, +@@ -2933,22 +2206,12 @@ static const ec_list_element curve_list[] = { + { NID_wap_wsg_idm_ecid_wtls5, &_EC_X9_62_CHAR2_163V1.h, 0, + "X9.62 curve over a 163 bit binary field" }, + #endif +- { NID_wap_wsg_idm_ecid_wtls6, &_EC_SECG_PRIME_112R1.h, 0, +- "SECG/WTLS curve over a 112 bit prime field" }, +- { NID_wap_wsg_idm_ecid_wtls7, &_EC_SECG_PRIME_160R2.h, 0, +- "SECG/WTLS curve over a 160 bit prime field" }, +- { NID_wap_wsg_idm_ecid_wtls8, &_EC_WTLS_8.h, 0, +- "WTLS curve over a 112 bit prime field" }, +- { NID_wap_wsg_idm_ecid_wtls9, &_EC_WTLS_9.h, 0, +- "WTLS curve over a 160 bit prime field" }, + #ifndef OPENSSL_NO_EC2M + { NID_wap_wsg_idm_ecid_wtls10, &_EC_NIST_CHAR2_233K.h, 0, + "NIST/SECG/WTLS curve over a 233 bit binary field" }, + { NID_wap_wsg_idm_ecid_wtls11, &_EC_NIST_CHAR2_233B.h, 0, + "NIST/SECG/WTLS curve over a 233 bit binary field" }, + #endif +- { NID_wap_wsg_idm_ecid_wtls12, &_EC_WTLS_12.h, 0, +- "WTLS curve over a 224 bit prime field" }, + #ifndef OPENSSL_NO_EC2M /* IPSec curves */ - {NID_ipsec3, &_EC_IPSEC_155_ID3.h, 0, -@@ -3083,18 +2251,6 @@ static const ec_list_element curve_list[] = { - "\tNot suitable for ECDSA.\n\tQuestionable extension field!"}, - # endif + { NID_ipsec3, &_EC_IPSEC_155_ID3.h, 0, +@@ -2959,18 +2222,6 @@ static const ec_list_element curve_list[] = { + "\tNot suitable for ECDSA.\n\tQuestionable extension field!" }, + #endif /* brainpool curves */ -- {NID_brainpoolP160r1, &_EC_brainpoolP160r1.h, 0, -- "RFC 5639 curve over a 160 bit prime field"}, -- {NID_brainpoolP160t1, &_EC_brainpoolP160t1.h, 0, -- "RFC 5639 curve over a 160 bit prime field"}, -- {NID_brainpoolP192r1, &_EC_brainpoolP192r1.h, 0, -- "RFC 5639 curve over a 192 bit prime field"}, -- {NID_brainpoolP192t1, &_EC_brainpoolP192t1.h, 0, -- "RFC 5639 curve over a 192 bit prime field"}, -- {NID_brainpoolP224r1, &_EC_brainpoolP224r1.h, 0, -- "RFC 5639 curve over a 224 bit prime field"}, -- {NID_brainpoolP224t1, &_EC_brainpoolP224t1.h, 0, -- "RFC 5639 curve over a 224 bit prime field"}, - {NID_brainpoolP256r1, &_EC_brainpoolP256r1.h, 0, - "RFC 5639 curve over a 256 bit prime field"}, - {NID_brainpoolP256t1, &_EC_brainpoolP256t1.h, 0, +- { NID_brainpoolP160r1, &_EC_brainpoolP160r1.h, 0, +- "RFC 5639 curve over a 160 bit prime field" }, +- { NID_brainpoolP160t1, &_EC_brainpoolP160t1.h, 0, +- "RFC 5639 curve over a 160 bit prime field" }, +- { NID_brainpoolP192r1, &_EC_brainpoolP192r1.h, 0, +- "RFC 5639 curve over a 192 bit prime field" }, +- { NID_brainpoolP192t1, &_EC_brainpoolP192t1.h, 0, +- "RFC 5639 curve over a 192 bit prime field" }, +- { NID_brainpoolP224r1, &_EC_brainpoolP224r1.h, 0, +- "RFC 5639 curve over a 224 bit prime field" }, +- { NID_brainpoolP224t1, &_EC_brainpoolP224t1.h, 0, +- "RFC 5639 curve over a 224 bit prime field" }, + { NID_brainpoolP256r1, &_EC_brainpoolP256r1.h, 0, + "RFC 5639 curve over a 256 bit prime field" }, + { NID_brainpoolP256t1, &_EC_brainpoolP256t1.h, 0, diff --git a/test/ectest.c b/test/ectest.c -index 70df89e..0ddbba3 100644 +index 0233f87..93ba2ce 100644 --- a/test/ectest.c +++ b/test/ectest.c -@@ -175,184 +175,26 @@ static int prime_field_tests(void) +@@ -174,183 +174,26 @@ static int prime_field_tests(void) || !TEST_ptr(p = BN_new()) || !TEST_ptr(a = BN_new()) || !TEST_ptr(b = BN_new()) @@ -945,8 +849,8 @@ index 70df89e..0ddbba3 100644 - || !TEST_true(BN_hex2bn(&b, "1")) - || !TEST_ptr(group = EC_GROUP_new_curve_GFp(p, a, b, ctx)) - || !TEST_true(EC_GROUP_get_curve(group, p, a, b, ctx))) -+ /* -+ * applications should use EC_GROUP_new_curve_GFp so ++ /* ++ * applications should use EC_GROUP_new_curve_GFp so + * that the library gets to choose the EC_METHOD + */ + || !TEST_ptr(group = EC_GROUP_new(EC_GFp_mont_method()))) @@ -994,7 +898,7 @@ index 70df89e..0ddbba3 100644 - TEST_note(" point at infinity"); - } else { - if (!TEST_true(EC_POINT_get_affine_coordinates(group, P, x, y, -- ctx))) +- ctx))) - goto err; - - test_output_bignum("x", x); @@ -1011,64 +915,64 @@ index 70df89e..0ddbba3 100644 - || !TEST_true(EC_POINT_is_at_infinity(group, P))) - goto err; - -- len = -- EC_POINT_point2oct(group, Q, POINT_CONVERSION_COMPRESSED, buf, -- sizeof(buf), ctx); +- len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_COMPRESSED, buf, +- sizeof(buf), ctx); - if (!TEST_size_t_ne(len, 0) - || !TEST_true(EC_POINT_oct2point(group, P, buf, len, ctx)) - || !TEST_int_eq(0, EC_POINT_cmp(group, P, Q, ctx))) -- goto err; ++ || !TEST_ptr(yplusone = BN_new())) + goto err; - test_output_memory("Generator as octet string, compressed form:", -- buf, len); +- buf, len); - - len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_UNCOMPRESSED, -- buf, sizeof(buf), ctx); +- buf, sizeof(buf), ctx); - if (!TEST_size_t_ne(len, 0) - || !TEST_true(EC_POINT_oct2point(group, P, buf, len, ctx)) - || !TEST_int_eq(0, EC_POINT_cmp(group, P, Q, ctx))) - goto err; - test_output_memory("Generator as octet string, uncompressed form:", -- buf, len); +- buf, len); - - len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_HYBRID, -- buf, sizeof(buf), ctx); +- buf, sizeof(buf), ctx); - if (!TEST_size_t_ne(len, 0) - || !TEST_true(EC_POINT_oct2point(group, P, buf, len, ctx)) - || !TEST_int_eq(0, EC_POINT_cmp(group, P, Q, ctx))) - goto err; - test_output_memory("Generator as octet string, hybrid form:", -- buf, len); +- buf, len); - - if (!TEST_true(EC_POINT_invert(group, P, ctx)) - || !TEST_int_eq(0, EC_POINT_cmp(group, P, R, ctx)) - -- /* -- * Curve secp160r1 (Certicom Research SEC 2 Version 1.0, section 2.4.2, -- * 2000) -- not a NIST curve, but commonly used -- */ +- /* +- * Curve secp160r1 (Certicom Research SEC 2 Version 1.0, section 2.4.2, +- * 2000) -- not a NIST curve, but commonly used +- */ - -- || !TEST_true(BN_hex2bn(&p, "FFFFFFFF" +- || !TEST_true(BN_hex2bn(&p, "FFFFFFFF" - "FFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF")) - || !TEST_int_eq(1, BN_check_prime(p, ctx, NULL)) -- || !TEST_true(BN_hex2bn(&a, "FFFFFFFF" +- || !TEST_true(BN_hex2bn(&a, "FFFFFFFF" - "FFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC")) -- || !TEST_true(BN_hex2bn(&b, "1C97BEFC" +- || !TEST_true(BN_hex2bn(&b, "1C97BEFC" - "54BD7A8B65ACF89F81D4D4ADC565FA45")) - || !TEST_true(EC_GROUP_set_curve(group, p, a, b, ctx)) -- || !TEST_true(BN_hex2bn(&x, "4A96B568" +- || !TEST_true(BN_hex2bn(&x, "4A96B568" - "8EF573284664698968C38BB913CBFC82")) -- || !TEST_true(BN_hex2bn(&y, "23a62855" +- || !TEST_true(BN_hex2bn(&y, "23a62855" - "3168947d59dcc912042351377ac5fb32")) - || !TEST_true(BN_add(yplusone, y, BN_value_one())) -- /* -- * When (x, y) is on the curve, (x, y + 1) is, as it happens, not, -- * and therefore setting the coordinates should fail. -- */ +- /* +- * When (x, y) is on the curve, (x, y + 1) is, as it happens, not, +- * and therefore setting the coordinates should fail. +- */ - || !TEST_false(EC_POINT_set_affine_coordinates(group, P, x, yplusone, -- ctx)) +- ctx)) - || !TEST_true(EC_POINT_set_affine_coordinates(group, P, x, y, ctx)) - || !TEST_int_gt(EC_POINT_is_on_curve(group, P, ctx), 0) -- || !TEST_true(BN_hex2bn(&z, "0100000000" +- || !TEST_true(BN_hex2bn(&z, "0100000000" - "000000000001F4C8F927AED3CA752257")) - || !TEST_true(EC_GROUP_set_generator(group, P, z, BN_value_one())) - || !TEST_true(EC_POINT_get_affine_coordinates(group, P, x, y, ctx))) @@ -1077,58 +981,57 @@ index 70df89e..0ddbba3 100644 - test_output_bignum("x", x); - test_output_bignum("y", y); - /* G_y value taken from the standard: */ -- if (!TEST_true(BN_hex2bn(&z, "23a62855" +- if (!TEST_true(BN_hex2bn(&z, "23a62855" - "3168947d59dcc912042351377ac5fb32")) - || !TEST_BN_eq(y, z) - || !TEST_int_eq(EC_GROUP_get_degree(group), 160) - || !group_order_tests(group) - -- /* Curve P-192 (FIPS PUB 186-2, App. 6) */ +- /* Curve P-192 (FIPS PUB 186-2, App. 6) */ - -- || !TEST_true(BN_hex2bn(&p, "FFFFFFFFFFFFFFFF" +- || !TEST_true(BN_hex2bn(&p, "FFFFFFFFFFFFFFFF" - "FFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF")) - || !TEST_int_eq(1, BN_check_prime(p, ctx, NULL)) -- || !TEST_true(BN_hex2bn(&a, "FFFFFFFFFFFFFFFF" +- || !TEST_true(BN_hex2bn(&a, "FFFFFFFFFFFFFFFF" - "FFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC")) -- || !TEST_true(BN_hex2bn(&b, "64210519E59C80E7" +- || !TEST_true(BN_hex2bn(&b, "64210519E59C80E7" - "0FA7E9AB72243049FEB8DEECC146B9B1")) - || !TEST_true(EC_GROUP_set_curve(group, p, a, b, ctx)) -- || !TEST_true(BN_hex2bn(&x, "188DA80EB03090F6" +- || !TEST_true(BN_hex2bn(&x, "188DA80EB03090F6" - "7CBF20EB43A18800F4FF0AFD82FF1012")) - || !TEST_true(EC_POINT_set_compressed_coordinates(group, P, x, 1, ctx)) - || !TEST_int_gt(EC_POINT_is_on_curve(group, P, ctx), 0) -- || !TEST_true(BN_hex2bn(&z, "FFFFFFFFFFFFFFFF" +- || !TEST_true(BN_hex2bn(&z, "FFFFFFFFFFFFFFFF" - "FFFFFFFF99DEF836146BC9B1B4D22831")) - || !TEST_true(EC_GROUP_set_generator(group, P, z, BN_value_one())) - || !TEST_true(EC_POINT_get_affine_coordinates(group, P, x, y, ctx))) -+ || !TEST_ptr(yplusone = BN_new())) - goto err; - +- goto err; +- - TEST_info("NIST curve P-192 -- Generator"); - test_output_bignum("x", x); - test_output_bignum("y", y); - /* G_y value taken from the standard: */ -- if (!TEST_true(BN_hex2bn(&z, "07192B95FFC8DA78" +- if (!TEST_true(BN_hex2bn(&z, "07192B95FFC8DA78" - "631011ED6B24CDD573F977A11E794811")) - || !TEST_BN_eq(y, z) - || !TEST_true(BN_add(yplusone, y, BN_value_one())) -- /* -- * When (x, y) is on the curve, (x, y + 1) is, as it happens, not, -- * and therefore setting the coordinates should fail. -- */ +- /* +- * When (x, y) is on the curve, (x, y + 1) is, as it happens, not, +- * and therefore setting the coordinates should fail. +- */ - || !TEST_false(EC_POINT_set_affine_coordinates(group, P, x, yplusone, -- ctx)) +- ctx)) - || !TEST_int_eq(EC_GROUP_get_degree(group), 192) - || !group_order_tests(group) -- - /* Curve P-224 (FIPS PUB 186-2, App. 6) */ -- || !TEST_true(BN_hex2bn(&p, "FFFFFFFFFFFFFFFFFFFFFFFF" -+ if (!TEST_true(BN_hex2bn(&p, "FFFFFFFFFFFFFFFFFFFFFFFF" + /* Curve P-224 (FIPS PUB 186-2, App. 6) */ + +- || !TEST_true(BN_hex2bn(&p, "FFFFFFFFFFFFFFFFFFFFFFFF" ++ if (!TEST_true(BN_hex2bn(&p, "FFFFFFFFFFFFFFFFFFFFFFFF" "FFFFFFFF000000000000000000000001")) || !TEST_int_eq(1, BN_check_prime(p, ctx, NULL)) - || !TEST_true(BN_hex2bn(&a, "FFFFFFFFFFFFFFFFFFFFFFFF" -@@ -3128,7 +2970,7 @@ int setup_tests(void) + || !TEST_true(BN_hex2bn(&a, "FFFFFFFFFFFFFFFFFFFFFFFF" +@@ -3522,7 +3365,7 @@ int setup_tests(void) ADD_TEST(parameter_test); ADD_TEST(ossl_parameter_test); @@ -1138,5 +1041,5 @@ index 70df89e..0ddbba3 100644 ADD_TEST(prime_field_tests); #ifndef OPENSSL_NO_EC2M -- -2.33.8 +2.45.4 diff --git a/SPECS/openssl/0011-Remove-EC-curves.patch b/SPECS/openssl/0011-Remove-EC-curves.patch index 917b336114d..12239afece6 100644 --- a/SPECS/openssl/0011-Remove-EC-curves.patch +++ b/SPECS/openssl/0011-Remove-EC-curves.patch @@ -2,155 +2,154 @@ From ffab71090fd4c1cc81cd3e3458a4348b0805fe17 Mon Sep 17 00:00:00 2001 From: Tobias Brick Date: Wed, 17 Apr 2024 21:39:03 +0000 Subject: [PATCH] Remove EC curves - --- - apps/speed.c | 8 +--- + apps/speed.c | 8 ---- crypto/evp/ec_support.c | 87 ------------------------------------ test/acvp_test.inc | 9 ---- test/ecdsatest.h | 17 ------- test/recipes/15-test_genec.t | 27 ----------- - 5 files changed, 1 insertion(+), 147 deletions(-) + 5 files changed, 148 deletions(-) diff --git a/apps/speed.c b/apps/speed.c -index b978323..84a4ee3 100644 +index f776d53..3f8dcca 100644 --- a/apps/speed.c +++ b/apps/speed.c -@@ -404,7 +404,7 @@ static double ffdh_results[FFDH_NUM][1]; /* 1 op: derivation */ +@@ -451,8 +451,6 @@ static double ffdh_results[FFDH_NUM][1]; /* 1 op: derivation */ #endif /* OPENSSL_NO_DH */ enum ec_curves_t { -- R_EC_P160, R_EC_P192, R_EC_P224, R_EC_P256, R_EC_P384, R_EC_P521, -+ R_EC_P224, R_EC_P256, R_EC_P384, R_EC_P521, - #ifndef OPENSSL_NO_EC2M - R_EC_K163, R_EC_K233, R_EC_K283, R_EC_K409, R_EC_K571, - R_EC_B163, R_EC_B233, R_EC_B283, R_EC_B409, R_EC_B571, -@@ -414,8 +414,6 @@ enum ec_curves_t { +- R_EC_P160, +- R_EC_P192, + R_EC_P224, + R_EC_P256, + R_EC_P384, +@@ -479,8 +477,6 @@ enum ec_curves_t { }; /* list of ecdsa curves */ static const OPT_PAIR ecdsa_choices[ECDSA_NUM] = { -- {"ecdsap160", R_EC_P160}, -- {"ecdsap192", R_EC_P192}, - {"ecdsap224", R_EC_P224}, - {"ecdsap256", R_EC_P256}, - {"ecdsap384", R_EC_P384}, -@@ -448,8 +446,6 @@ enum { +- { "ecdsap160", R_EC_P160 }, +- { "ecdsap192", R_EC_P192 }, + { "ecdsap224", R_EC_P224 }, + { "ecdsap256", R_EC_P256 }, + { "ecdsap384", R_EC_P384 }, +@@ -515,8 +511,6 @@ enum { }; /* list of ecdh curves, extension of |ecdsa_choices| list above */ static const OPT_PAIR ecdh_choices[EC_NUM] = { -- {"ecdhp160", R_EC_P160}, -- {"ecdhp192", R_EC_P192}, - {"ecdhp224", R_EC_P224}, - {"ecdhp256", R_EC_P256}, - {"ecdhp384", R_EC_P384}, -@@ -1825,8 +1821,6 @@ int speed_main(int argc, char **argv) +- { "ecdhp160", R_EC_P160 }, +- { "ecdhp192", R_EC_P192 }, + { "ecdhp224", R_EC_P224 }, + { "ecdhp256", R_EC_P256 }, + { "ecdhp384", R_EC_P384 }, +@@ -2002,8 +1996,6 @@ int speed_main(int argc, char **argv) */ static const EC_CURVE ec_curves[EC_NUM] = { /* Prime Curves */ -- {"secp160r1", NID_secp160r1, 160}, -- {"nistp192", NID_X9_62_prime192v1, 192}, - {"nistp224", NID_secp224r1, 224}, - {"nistp256", NID_X9_62_prime256v1, 256}, - {"nistp384", NID_secp384r1, 384}, +- { "secp160r1", NID_secp160r1, 160 }, +- { "nistp192", NID_X9_62_prime192v1, 192 }, + { "nistp224", NID_secp224r1, 224 }, + { "nistp256", NID_X9_62_prime256v1, 256 }, + { "nistp384", NID_secp384r1, 384 }, diff --git a/crypto/evp/ec_support.c b/crypto/evp/ec_support.c -index 1ec1014..82b9529 100644 +index 20883c4..9715c62 100644 --- a/crypto/evp/ec_support.c +++ b/crypto/evp/ec_support.c @@ -20,89 +20,15 @@ typedef struct ec_name2nid_st { static const EC_NAME2NID curve_list[] = { /* prime field curves */ /* secg curves */ -- {"secp112r1", NID_secp112r1 }, -- {"secp112r2", NID_secp112r2 }, -- {"secp128r1", NID_secp128r1 }, -- {"secp128r2", NID_secp128r2 }, -- {"secp160k1", NID_secp160k1 }, -- {"secp160r1", NID_secp160r1 }, -- {"secp160r2", NID_secp160r2 }, -- {"secp192k1", NID_secp192k1 }, -- {"secp224k1", NID_secp224k1 }, - {"secp224r1", NID_secp224r1 }, - {"secp256k1", NID_secp256k1 }, - {"secp384r1", NID_secp384r1 }, - {"secp521r1", NID_secp521r1 }, +- { "secp112r1", NID_secp112r1 }, +- { "secp112r2", NID_secp112r2 }, +- { "secp128r1", NID_secp128r1 }, +- { "secp128r2", NID_secp128r2 }, +- { "secp160k1", NID_secp160k1 }, +- { "secp160r1", NID_secp160r1 }, +- { "secp160r2", NID_secp160r2 }, +- { "secp192k1", NID_secp192k1 }, +- { "secp224k1", NID_secp224k1 }, + { "secp224r1", NID_secp224r1 }, + { "secp256k1", NID_secp256k1 }, + { "secp384r1", NID_secp384r1 }, + { "secp521r1", NID_secp521r1 }, /* X9.62 curves */ -- {"prime192v1", NID_X9_62_prime192v1 }, -- {"prime192v2", NID_X9_62_prime192v2 }, -- {"prime192v3", NID_X9_62_prime192v3 }, -- {"prime239v1", NID_X9_62_prime239v1 }, -- {"prime239v2", NID_X9_62_prime239v2 }, -- {"prime239v3", NID_X9_62_prime239v3 }, - {"prime256v1", NID_X9_62_prime256v1 }, +- { "prime192v1", NID_X9_62_prime192v1 }, +- { "prime192v2", NID_X9_62_prime192v2 }, +- { "prime192v3", NID_X9_62_prime192v3 }, +- { "prime239v1", NID_X9_62_prime239v1 }, +- { "prime239v2", NID_X9_62_prime239v2 }, +- { "prime239v3", NID_X9_62_prime239v3 }, + { "prime256v1", NID_X9_62_prime256v1 }, /* characteristic two field curves */ /* NIST/SECG curves */ -- {"sect113r1", NID_sect113r1 }, -- {"sect113r2", NID_sect113r2 }, -- {"sect131r1", NID_sect131r1 }, -- {"sect131r2", NID_sect131r2 }, -- {"sect163k1", NID_sect163k1 }, -- {"sect163r1", NID_sect163r1 }, -- {"sect163r2", NID_sect163r2 }, -- {"sect193r1", NID_sect193r1 }, -- {"sect193r2", NID_sect193r2 }, -- {"sect233k1", NID_sect233k1 }, -- {"sect233r1", NID_sect233r1 }, -- {"sect239k1", NID_sect239k1 }, -- {"sect283k1", NID_sect283k1 }, -- {"sect283r1", NID_sect283r1 }, -- {"sect409k1", NID_sect409k1 }, -- {"sect409r1", NID_sect409r1 }, -- {"sect571k1", NID_sect571k1 }, -- {"sect571r1", NID_sect571r1 }, +- { "sect113r1", NID_sect113r1 }, +- { "sect113r2", NID_sect113r2 }, +- { "sect131r1", NID_sect131r1 }, +- { "sect131r2", NID_sect131r2 }, +- { "sect163k1", NID_sect163k1 }, +- { "sect163r1", NID_sect163r1 }, +- { "sect163r2", NID_sect163r2 }, +- { "sect193r1", NID_sect193r1 }, +- { "sect193r2", NID_sect193r2 }, +- { "sect233k1", NID_sect233k1 }, +- { "sect233r1", NID_sect233r1 }, +- { "sect239k1", NID_sect239k1 }, +- { "sect283k1", NID_sect283k1 }, +- { "sect283r1", NID_sect283r1 }, +- { "sect409k1", NID_sect409k1 }, +- { "sect409r1", NID_sect409r1 }, +- { "sect571k1", NID_sect571k1 }, +- { "sect571r1", NID_sect571r1 }, - /* X9.62 curves */ -- {"c2pnb163v1", NID_X9_62_c2pnb163v1 }, -- {"c2pnb163v2", NID_X9_62_c2pnb163v2 }, -- {"c2pnb163v3", NID_X9_62_c2pnb163v3 }, -- {"c2pnb176v1", NID_X9_62_c2pnb176v1 }, -- {"c2tnb191v1", NID_X9_62_c2tnb191v1 }, -- {"c2tnb191v2", NID_X9_62_c2tnb191v2 }, -- {"c2tnb191v3", NID_X9_62_c2tnb191v3 }, -- {"c2pnb208w1", NID_X9_62_c2pnb208w1 }, -- {"c2tnb239v1", NID_X9_62_c2tnb239v1 }, -- {"c2tnb239v2", NID_X9_62_c2tnb239v2 }, -- {"c2tnb239v3", NID_X9_62_c2tnb239v3 }, -- {"c2pnb272w1", NID_X9_62_c2pnb272w1 }, -- {"c2pnb304w1", NID_X9_62_c2pnb304w1 }, -- {"c2tnb359v1", NID_X9_62_c2tnb359v1 }, -- {"c2pnb368w1", NID_X9_62_c2pnb368w1 }, -- {"c2tnb431r1", NID_X9_62_c2tnb431r1 }, +- { "c2pnb163v1", NID_X9_62_c2pnb163v1 }, +- { "c2pnb163v2", NID_X9_62_c2pnb163v2 }, +- { "c2pnb163v3", NID_X9_62_c2pnb163v3 }, +- { "c2pnb176v1", NID_X9_62_c2pnb176v1 }, +- { "c2tnb191v1", NID_X9_62_c2tnb191v1 }, +- { "c2tnb191v2", NID_X9_62_c2tnb191v2 }, +- { "c2tnb191v3", NID_X9_62_c2tnb191v3 }, +- { "c2pnb208w1", NID_X9_62_c2pnb208w1 }, +- { "c2tnb239v1", NID_X9_62_c2tnb239v1 }, +- { "c2tnb239v2", NID_X9_62_c2tnb239v2 }, +- { "c2tnb239v3", NID_X9_62_c2tnb239v3 }, +- { "c2pnb272w1", NID_X9_62_c2pnb272w1 }, +- { "c2pnb304w1", NID_X9_62_c2pnb304w1 }, +- { "c2tnb359v1", NID_X9_62_c2tnb359v1 }, +- { "c2pnb368w1", NID_X9_62_c2pnb368w1 }, +- { "c2tnb431r1", NID_X9_62_c2tnb431r1 }, - /* - * the WAP/WTLS curves [unlike SECG, spec has its own OIDs for curves - * from X9.62] - */ -- {"wap-wsg-idm-ecid-wtls1", NID_wap_wsg_idm_ecid_wtls1 }, -- {"wap-wsg-idm-ecid-wtls3", NID_wap_wsg_idm_ecid_wtls3 }, -- {"wap-wsg-idm-ecid-wtls4", NID_wap_wsg_idm_ecid_wtls4 }, -- {"wap-wsg-idm-ecid-wtls5", NID_wap_wsg_idm_ecid_wtls5 }, -- {"wap-wsg-idm-ecid-wtls6", NID_wap_wsg_idm_ecid_wtls6 }, -- {"wap-wsg-idm-ecid-wtls7", NID_wap_wsg_idm_ecid_wtls7 }, -- {"wap-wsg-idm-ecid-wtls8", NID_wap_wsg_idm_ecid_wtls8 }, -- {"wap-wsg-idm-ecid-wtls9", NID_wap_wsg_idm_ecid_wtls9 }, -- {"wap-wsg-idm-ecid-wtls10", NID_wap_wsg_idm_ecid_wtls10 }, -- {"wap-wsg-idm-ecid-wtls11", NID_wap_wsg_idm_ecid_wtls11 }, -- {"wap-wsg-idm-ecid-wtls12", NID_wap_wsg_idm_ecid_wtls12 }, +- { "wap-wsg-idm-ecid-wtls1", NID_wap_wsg_idm_ecid_wtls1 }, +- { "wap-wsg-idm-ecid-wtls3", NID_wap_wsg_idm_ecid_wtls3 }, +- { "wap-wsg-idm-ecid-wtls4", NID_wap_wsg_idm_ecid_wtls4 }, +- { "wap-wsg-idm-ecid-wtls5", NID_wap_wsg_idm_ecid_wtls5 }, +- { "wap-wsg-idm-ecid-wtls6", NID_wap_wsg_idm_ecid_wtls6 }, +- { "wap-wsg-idm-ecid-wtls7", NID_wap_wsg_idm_ecid_wtls7 }, +- { "wap-wsg-idm-ecid-wtls8", NID_wap_wsg_idm_ecid_wtls8 }, +- { "wap-wsg-idm-ecid-wtls9", NID_wap_wsg_idm_ecid_wtls9 }, +- { "wap-wsg-idm-ecid-wtls10", NID_wap_wsg_idm_ecid_wtls10 }, +- { "wap-wsg-idm-ecid-wtls11", NID_wap_wsg_idm_ecid_wtls11 }, +- { "wap-wsg-idm-ecid-wtls12", NID_wap_wsg_idm_ecid_wtls12 }, - /* IPSec curves */ -- {"Oakley-EC2N-3", NID_ipsec3 }, -- {"Oakley-EC2N-4", NID_ipsec4 }, +- { "Oakley-EC2N-3", NID_ipsec3 }, +- { "Oakley-EC2N-4", NID_ipsec4 }, /* brainpool curves */ -- {"brainpoolP160r1", NID_brainpoolP160r1 }, -- {"brainpoolP160t1", NID_brainpoolP160t1 }, -- {"brainpoolP192r1", NID_brainpoolP192r1 }, -- {"brainpoolP192t1", NID_brainpoolP192t1 }, -- {"brainpoolP224r1", NID_brainpoolP224r1 }, -- {"brainpoolP224t1", NID_brainpoolP224t1 }, - {"brainpoolP256r1", NID_brainpoolP256r1 }, - {"brainpoolP256t1", NID_brainpoolP256t1 }, - {"brainpoolP320r1", NID_brainpoolP320r1 }, +- { "brainpoolP160r1", NID_brainpoolP160r1 }, +- { "brainpoolP160t1", NID_brainpoolP160t1 }, +- { "brainpoolP192r1", NID_brainpoolP192r1 }, +- { "brainpoolP192t1", NID_brainpoolP192t1 }, +- { "brainpoolP224r1", NID_brainpoolP224r1 }, +- { "brainpoolP224t1", NID_brainpoolP224t1 }, + { "brainpoolP256r1", NID_brainpoolP256r1 }, + { "brainpoolP256t1", NID_brainpoolP256t1 }, + { "brainpoolP320r1", NID_brainpoolP320r1 }, @@ -111,8 +37,6 @@ static const EC_NAME2NID curve_list[] = { - {"brainpoolP384t1", NID_brainpoolP384t1 }, - {"brainpoolP512r1", NID_brainpoolP512r1 }, - {"brainpoolP512t1", NID_brainpoolP512t1 }, + { "brainpoolP384t1", NID_brainpoolP384t1 }, + { "brainpoolP512r1", NID_brainpoolP512r1 }, + { "brainpoolP512t1", NID_brainpoolP512t1 }, - /* SM2 curve */ -- {"SM2", NID_sm2 }, +- { "SM2", NID_sm2 }, }; const char *OSSL_EC_curve_nid2name(int nid) @@ -158,20 +157,20 @@ index 1ec1014..82b9529 100644 /* Functions to translate between common NIST curve names and NIDs */ static const EC_NAME2NID nist_curves[] = { -- {"B-163", NID_sect163r2}, -- {"B-233", NID_sect233r1}, -- {"B-283", NID_sect283r1}, -- {"B-409", NID_sect409r1}, -- {"B-571", NID_sect571r1}, -- {"K-163", NID_sect163k1}, -- {"K-233", NID_sect233k1}, -- {"K-283", NID_sect283k1}, -- {"K-409", NID_sect409k1}, -- {"K-571", NID_sect571k1}, -- {"P-192", NID_X9_62_prime192v1}, - {"P-224", NID_secp224r1}, - {"P-256", NID_X9_62_prime256v1}, - {"P-384", NID_secp384r1}, +- { "B-163", NID_sect163r2 }, +- { "B-233", NID_sect233r1 }, +- { "B-283", NID_sect283r1 }, +- { "B-409", NID_sect409r1 }, +- { "B-571", NID_sect571r1 }, +- { "K-163", NID_sect163k1 }, +- { "K-233", NID_sect233k1 }, +- { "K-283", NID_sect283k1 }, +- { "K-409", NID_sect409k1 }, +- { "K-571", NID_sect571k1 }, +- { "P-192", NID_X9_62_prime192v1 }, + { "P-224", NID_secp224r1 }, + { "P-256", NID_X9_62_prime256v1 }, + { "P-384", NID_secp384r1 }, diff --git a/test/acvp_test.inc b/test/acvp_test.inc index ad11d3a..894a0bf 100644 --- a/test/acvp_test.inc @@ -193,7 +192,7 @@ index ad11d3a..894a0bf 100644 "SHA2-512", "P-521", diff --git a/test/ecdsatest.h b/test/ecdsatest.h -index 63fe319..06b5c0a 100644 +index 700d7b5..6aa4faa 100644 --- a/test/ecdsatest.h +++ b/test/ecdsatest.h @@ -32,23 +32,6 @@ typedef struct { @@ -201,25 +200,25 @@ index 63fe319..06b5c0a 100644 static const ecdsa_cavs_kat_t ecdsa_cavs_kats[] = { - /* prime KATs from X9.62 */ -- {NID_X9_62_prime192v1, NID_sha1, -- "616263", /* "abc" */ -- "1a8d598fc15bf0fd89030b5cb1111aeb92ae8baf5ea475fb", -- "0462b12d60690cdcf330babab6e69763b471f994dd702d16a563bf5ec08069705ffff65e" -- "5ca5c0d69716dfcb3474373902", -- "fa6de29746bbeb7f8bb1e761f85f7dfb2983169d82fa2f4e", -- "885052380ff147b734c330c43d39b2c4a89f29b0f749fead", -- "e9ecc78106def82bf1070cf1d4d804c3cb390046951df686"}, -- {NID_X9_62_prime239v1, NID_sha1, -- "616263", /* "abc" */ -- "7ef7c6fabefffdea864206e80b0b08a9331ed93e698561b64ca0f7777f3d", -- "045b6dc53bc61a2548ffb0f671472de6c9521a9d2d2534e65abfcbd5fe0c707fd9f1ed2e" -- "65f09f6ce0893baf5e8e31e6ae82ea8c3592335be906d38dee", -- "656c7196bf87dcc5d1f1020906df2782360d36b2de7a17ece37d503784af", -- "2cb7f36803ebb9c427c58d8265f11fc5084747133078fc279de874fbecb0", -- "2eeae988104e9c2234a3c2beb1f53bfa5dc11ff36a875d1e3ccb1f7e45cf"}, +- { NID_X9_62_prime192v1, NID_sha1, +- "616263", /* "abc" */ +- "1a8d598fc15bf0fd89030b5cb1111aeb92ae8baf5ea475fb", +- "0462b12d60690cdcf330babab6e69763b471f994dd702d16a563bf5ec08069705ffff65e" +- "5ca5c0d69716dfcb3474373902", +- "fa6de29746bbeb7f8bb1e761f85f7dfb2983169d82fa2f4e", +- "885052380ff147b734c330c43d39b2c4a89f29b0f749fead", +- "e9ecc78106def82bf1070cf1d4d804c3cb390046951df686" }, +- { NID_X9_62_prime239v1, NID_sha1, +- "616263", /* "abc" */ +- "7ef7c6fabefffdea864206e80b0b08a9331ed93e698561b64ca0f7777f3d", +- "045b6dc53bc61a2548ffb0f671472de6c9521a9d2d2534e65abfcbd5fe0c707fd9f1ed2e" +- "65f09f6ce0893baf5e8e31e6ae82ea8c3592335be906d38dee", +- "656c7196bf87dcc5d1f1020906df2782360d36b2de7a17ece37d503784af", +- "2cb7f36803ebb9c427c58d8265f11fc5084747133078fc279de874fbecb0", +- "2eeae988104e9c2234a3c2beb1f53bfa5dc11ff36a875d1e3ccb1f7e45cf" }, /* prime KATs from NIST CAVP */ - {NID_secp224r1, NID_sha224, - "699325d6fc8fbbb4981a6ded3c3a54ad2e4e3db8a5669201912064c64e700c139248cdc1" + { NID_secp224r1, NID_sha224, + "699325d6fc8fbbb4981a6ded3c3a54ad2e4e3db8a5669201912064c64e700c139248cdc1" diff --git a/test/recipes/15-test_genec.t b/test/recipes/15-test_genec.t index 4d5090f..0a90a60 100644 --- a/test/recipes/15-test_genec.t @@ -271,5 +270,5 @@ index 4d5090f..0a90a60 100644 P-256 P-384 -- -2.33.8 +2.45.4 diff --git a/SPECS/openssl/0012-Disable-explicit-ec.patch b/SPECS/openssl/0012-Disable-explicit-ec.patch index 9b86309a6f2..6cd6232e7e6 100644 --- a/SPECS/openssl/0012-Disable-explicit-ec.patch +++ b/SPECS/openssl/0012-Disable-explicit-ec.patch @@ -18,10 +18,10 @@ From-dist-git-commit: 9409bc7044cf4b5773639cce20f51399888c45fd 5 files changed, 39 insertions(+), 32 deletions(-) diff --git a/crypto/ec/ec_asn1.c b/crypto/ec/ec_asn1.c -index 7a0b35a594..d19d57344e 100644 +index 6b44b80..bb0d743 100644 --- a/crypto/ec/ec_asn1.c +++ b/crypto/ec/ec_asn1.c -@@ -905,6 +905,12 @@ EC_GROUP *d2i_ECPKParameters(EC_GROUP **a, const unsigned char **in, long len) +@@ -889,6 +889,12 @@ EC_GROUP *d2i_ECPKParameters(EC_GROUP **a, const unsigned char **in, long len) if (params->type == ECPKPARAMETERS_TYPE_EXPLICIT) group->decoded_from_explicit_params = 1; @@ -34,7 +34,7 @@ index 7a0b35a594..d19d57344e 100644 if (a) { EC_GROUP_free(*a); *a = group; -@@ -964,6 +970,11 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len) +@@ -948,6 +954,11 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len) goto err; } @@ -47,7 +47,7 @@ index 7a0b35a594..d19d57344e 100644 if (priv_key->privateKey) { diff --git a/crypto/ec/ec_lib.c b/crypto/ec/ec_lib.c -index a84e088c19..6c37bf78ae 100644 +index 32a8a81..a85aace 100644 --- a/crypto/ec/ec_lib.c +++ b/crypto/ec/ec_lib.c @@ -1724,6 +1724,11 @@ EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[], @@ -71,16 +71,17 @@ index a84e088c19..6c37bf78ae 100644 EC_GROUP_free(group); group = named_group; diff --git a/test/ectest.c b/test/ectest.c -index 4890b0555e..e11aec5b3b 100644 +index 6390cd5..0ddfdaf 100644 --- a/test/ectest.c +++ b/test/ectest.c -@@ -2301,10 +2301,11 @@ static int do_test_custom_explicit_fromdata(EC_GROUP *group, BN_CTX *ctx, +@@ -2792,11 +2792,12 @@ static int do_test_custom_explicit_fromdata(EC_GROUP *group, BN_CTX *ctx, if (!TEST_ptr(params = OSSL_PARAM_BLD_to_param(bld)) || !TEST_ptr(pctx = EVP_PKEY_CTX_new_from_name(NULL, "EC", NULL)) || !TEST_int_gt(EVP_PKEY_fromdata_init(pctx), 0) - || !TEST_int_gt(EVP_PKEY_fromdata(pctx, &pkeyparam, + || !TEST_int_le(EVP_PKEY_fromdata(pctx, &pkeyparam, - EVP_PKEY_KEY_PARAMETERS, params), 0)) + EVP_PKEY_KEY_PARAMETERS, params), + 0)) goto err; - +/* As creating the key should fail, the rest of the test is pointless */ @@ -88,54 +89,54 @@ index 4890b0555e..e11aec5b3b 100644 /*- Check that all the set values are retrievable -*/ /* There should be no match to a group name since the generator changed */ -@@ -2433,6 +2434,7 @@ static int do_test_custom_explicit_fromdata(EC_GROUP *group, BN_CTX *ctx, +@@ -2925,6 +2926,7 @@ static int do_test_custom_explicit_fromdata(EC_GROUP *group, BN_CTX *ctx, #endif - ) + ) goto err; +#endif ret = 1; err: BN_free(order_out); -@@ -2714,21 +2716,21 @@ static int custom_params_test(int id) +@@ -3218,21 +3220,21 @@ static int custom_params_test(int id) /* Compute keyexchange in both directions */ if (!TEST_ptr(pctx1 = EVP_PKEY_CTX_new(pkey1, NULL)) -- || !TEST_int_eq(EVP_PKEY_derive_init(pctx1), 1) -- || !TEST_int_eq(EVP_PKEY_derive_set_peer(pctx1, pkey2), 1) -+ || !TEST_int_le(EVP_PKEY_derive_init(pctx1), 0) -+/* || !TEST_int_eq(EVP_PKEY_derive_set_peer(pctx1, pkey2), 1) - || !TEST_int_eq(EVP_PKEY_derive(pctx1, NULL, &sslen), 1) - || !TEST_int_gt(bsize, sslen) -- || !TEST_int_eq(EVP_PKEY_derive(pctx1, buf1, &sslen), 1)) -+ || !TEST_int_eq(EVP_PKEY_derive(pctx1, buf1, &sslen), 1)*/) +- || !TEST_int_eq(EVP_PKEY_derive_init(pctx1), 1) +- || !TEST_int_eq(EVP_PKEY_derive_set_peer(pctx1, pkey2), 1) ++ || !TEST_int_le(EVP_PKEY_derive_init(pctx1), 0) ++/* || !TEST_int_eq(EVP_PKEY_derive_set_peer(pctx1, pkey2), 1) + || !TEST_int_eq(EVP_PKEY_derive(pctx1, NULL, &sslen), 1) + || !TEST_int_gt(bsize, sslen) +- || !TEST_int_eq(EVP_PKEY_derive(pctx1, buf1, &sslen), 1)) ++ || !TEST_int_eq(EVP_PKEY_derive(pctx1, buf1, &sslen), 1)*/) goto err; if (!TEST_ptr(pctx2 = EVP_PKEY_CTX_new(pkey2, NULL)) -- || !TEST_int_eq(EVP_PKEY_derive_init(pctx2), 1) -- || !TEST_int_eq(EVP_PKEY_derive_set_peer(pctx2, pkey1), 1) -+ || !TEST_int_le(EVP_PKEY_derive_init(pctx2), 1) -+/* || !TEST_int_eq(EVP_PKEY_derive_set_peer(pctx2, pkey1), 1) - || !TEST_int_eq(EVP_PKEY_derive(pctx2, NULL, &t), 1) - || !TEST_int_gt(bsize, t) - || !TEST_int_le(sslen, t) -- || !TEST_int_eq(EVP_PKEY_derive(pctx2, buf2, &t), 1)) -+ || !TEST_int_eq(EVP_PKEY_derive(pctx2, buf2, &t), 1) */) +- || !TEST_int_eq(EVP_PKEY_derive_init(pctx2), 1) +- || !TEST_int_eq(EVP_PKEY_derive_set_peer(pctx2, pkey1), 1) ++ || !TEST_int_le(EVP_PKEY_derive_init(pctx2), 1) ++/* || !TEST_int_eq(EVP_PKEY_derive_set_peer(pctx2, pkey1), 1) + || !TEST_int_eq(EVP_PKEY_derive(pctx2, NULL, &t), 1) + || !TEST_int_gt(bsize, t) + || !TEST_int_le(sslen, t) +- || !TEST_int_eq(EVP_PKEY_derive(pctx2, buf2, &t), 1)) ++ || !TEST_int_eq(EVP_PKEY_derive(pctx2, buf2, &t), 1) */) goto err; - +#if 0 /* Both sides should expect the same shared secret */ if (!TEST_mem_eq(buf1, sslen, buf2, t)) goto err; -@@ -2780,7 +2782,7 @@ static int custom_params_test(int id) - /* compare with previous result */ - || !TEST_mem_eq(buf1, t, buf2, sslen)) +@@ -3287,7 +3289,7 @@ static int custom_params_test(int id) + /* compare with previous result */ + || !TEST_mem_eq(buf1, t, buf2, sslen)) goto err; - +#endif ret = 1; - err: + err: diff --git a/test/endecode_test.c b/test/endecode_test.c -index 14648287eb..9a437d8c64 100644 +index 03cbe87..dbea140 100644 --- a/test/endecode_test.c +++ b/test/endecode_test.c @@ -62,7 +62,7 @@ static BN_CTX *bnctx = NULL; @@ -145,9 +146,9 @@ index 14648287eb..9a437d8c64 100644 -static OSSL_PARAM *ec_explicit_prime_params_explicit = NULL; +/*static OSSL_PARAM *ec_explicit_prime_params_explicit = NULL;*/ - # ifndef OPENSSL_NO_EC2M + #ifndef OPENSSL_NO_EC2M static OSSL_PARAM_BLD *bld_tri_nc = NULL; -@@ -1009,9 +1009,9 @@ IMPLEMENT_TEST_SUITE_LEGACY(EC, "EC") +@@ -1012,9 +1012,9 @@ IMPLEMENT_TEST_SUITE_LEGACY(EC, "EC") DOMAIN_KEYS(ECExplicitPrimeNamedCurve); IMPLEMENT_TEST_SUITE(ECExplicitPrimeNamedCurve, "EC", 1) IMPLEMENT_TEST_SUITE_LEGACY(ECExplicitPrimeNamedCurve, "EC") @@ -157,28 +158,28 @@ index 14648287eb..9a437d8c64 100644 +/*DOMAIN_KEYS(ECExplicitPrime2G);*/ +/*IMPLEMENT_TEST_SUITE(ECExplicitPrime2G, "EC", 0)*/ +/*IMPLEMENT_TEST_SUITE_LEGACY(ECExplicitPrime2G, "EC")*/ - # ifndef OPENSSL_NO_EC2M + #ifndef OPENSSL_NO_EC2M DOMAIN_KEYS(ECExplicitTriNamedCurve); IMPLEMENT_TEST_SUITE(ECExplicitTriNamedCurve, "EC", 1) -@@ -1352,7 +1352,7 @@ int setup_tests(void) +@@ -1406,7 +1406,7 @@ int setup_tests(void) || !create_ec_explicit_prime_params_namedcurve(bld_prime_nc) || !create_ec_explicit_prime_params(bld_prime) || !TEST_ptr(ec_explicit_prime_params_nc = OSSL_PARAM_BLD_to_param(bld_prime_nc)) - || !TEST_ptr(ec_explicit_prime_params_explicit = OSSL_PARAM_BLD_to_param(bld_prime)) +/* || !TEST_ptr(ec_explicit_prime_params_explicit = OSSL_PARAM_BLD_to_param(bld_prime))*/ - # ifndef OPENSSL_NO_EC2M + #ifndef OPENSSL_NO_EC2M || !TEST_ptr(bld_tri_nc = OSSL_PARAM_BLD_new()) || !TEST_ptr(bld_tri = OSSL_PARAM_BLD_new()) -@@ -1380,7 +1380,7 @@ int setup_tests(void) +@@ -1434,7 +1434,7 @@ int setup_tests(void) TEST_info("Generating EC keys..."); MAKE_DOMAIN_KEYS(EC, "EC", EC_params); MAKE_DOMAIN_KEYS(ECExplicitPrimeNamedCurve, "EC", ec_explicit_prime_params_nc); - MAKE_DOMAIN_KEYS(ECExplicitPrime2G, "EC", ec_explicit_prime_params_explicit); +/* MAKE_DOMAIN_KEYS(ECExplicitPrime2G, "EC", ec_explicit_prime_params_explicit);*/ - # ifndef OPENSSL_NO_EC2M + #ifndef OPENSSL_NO_EC2M MAKE_DOMAIN_KEYS(ECExplicitTriNamedCurve, "EC", ec_explicit_tri_params_nc); MAKE_DOMAIN_KEYS(ECExplicitTri2G, "EC", ec_explicit_tri_params_explicit); -@@ -1423,8 +1423,8 @@ int setup_tests(void) +@@ -1481,8 +1481,8 @@ int setup_tests(void) ADD_TEST_SUITE_LEGACY(EC); ADD_TEST_SUITE(ECExplicitPrimeNamedCurve); ADD_TEST_SUITE_LEGACY(ECExplicitPrimeNamedCurve); @@ -186,10 +187,10 @@ index 14648287eb..9a437d8c64 100644 - ADD_TEST_SUITE_LEGACY(ECExplicitPrime2G); +/* ADD_TEST_SUITE(ECExplicitPrime2G);*/ +/* ADD_TEST_SUITE_LEGACY(ECExplicitPrime2G);*/ - # ifndef OPENSSL_NO_EC2M + #ifndef OPENSSL_NO_EC2M ADD_TEST_SUITE(ECExplicitTriNamedCurve); ADD_TEST_SUITE_LEGACY(ECExplicitTriNamedCurve); -@@ -1461,7 +1461,7 @@ void cleanup_tests(void) +@@ -1525,7 +1525,7 @@ void cleanup_tests(void) { #ifndef OPENSSL_NO_EC OSSL_PARAM_free(ec_explicit_prime_params_nc); @@ -197,18 +198,18 @@ index 14648287eb..9a437d8c64 100644 +/* OSSL_PARAM_free(ec_explicit_prime_params_explicit);*/ OSSL_PARAM_BLD_free(bld_prime_nc); OSSL_PARAM_BLD_free(bld_prime); - # ifndef OPENSSL_NO_EC2M -@@ -1483,7 +1483,7 @@ void cleanup_tests(void) + #ifndef OPENSSL_NO_EC2M +@@ -1547,7 +1547,7 @@ void cleanup_tests(void) #ifndef OPENSSL_NO_EC FREE_DOMAIN_KEYS(EC); FREE_DOMAIN_KEYS(ECExplicitPrimeNamedCurve); - FREE_DOMAIN_KEYS(ECExplicitPrime2G); +/* FREE_DOMAIN_KEYS(ECExplicitPrime2G);*/ - # ifndef OPENSSL_NO_EC2M + #ifndef OPENSSL_NO_EC2M FREE_DOMAIN_KEYS(ECExplicitTriNamedCurve); FREE_DOMAIN_KEYS(ECExplicitTri2G); diff --git a/test/recipes/30-test_evp_data/evppkey_ecdsa.txt b/test/recipes/30-test_evp_data/evppkey_ecdsa.txt -index ec3c032aba..584ecee0eb 100644 +index 1f9ce93..5d49148 100644 --- a/test/recipes/30-test_evp_data/evppkey_ecdsa.txt +++ b/test/recipes/30-test_evp_data/evppkey_ecdsa.txt @@ -133,18 +133,6 @@ AAAA//////////+85vqtpxeehPO5ysL8YyVRAgEBBG0wawIBAQQgiUTxtr5vLVjj @@ -231,5 +232,5 @@ index ec3c032aba..584ecee0eb 100644 -----BEGIN PRIVATE KEY----- MGMCAQAwEAYHKoZIzj0CAQYFK4EEAA8ETDBKAgEBBBUDnQW0mLiHVha/jqFznX/K -- -2.41.0 +2.45.4 diff --git a/SPECS/openssl/0049-Allow-disabling-of-SHA1-signatures.patch b/SPECS/openssl/0049-Allow-disabling-of-SHA1-signatures.patch index 37a865dade4..a222ea053da 100644 --- a/SPECS/openssl/0049-Allow-disabling-of-SHA1-signatures.patch +++ b/SPECS/openssl/0049-Allow-disabling-of-SHA1-signatures.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Allow disabling of SHA1 signatures --- crypto/context.c | 14 ++++ - crypto/evp/evp_cnf.c | 13 +++ + crypto/evp/evp_cnf.c | 15 +++- crypto/evp/m_sigver.c | 79 +++++++++++++++++++ crypto/evp/pmeth_lib.c | 15 ++++ doc/man5/config.pod | 13 +++ @@ -14,27 +14,27 @@ Subject: [PATCH] Allow disabling of SHA1 signatures include/internal/sslconf.h | 4 + providers/common/securitycheck.c | 20 +++++ providers/common/securitycheck_default.c | 9 ++- - providers/implementations/signature/dsa_sig.c | 11 ++- + providers/implementations/signature/dsa_sig.c | 15 ++-- .../implementations/signature/ecdsa_sig.c | 4 + providers/implementations/signature/rsa_sig.c | 20 ++++- ssl/t1_lib.c | 8 ++ util/libcrypto.num | 2 + - 15 files changed, 209 insertions(+), 9 deletions(-) + 15 files changed, 212 insertions(+), 12 deletions(-) diff --git a/crypto/context.c b/crypto/context.c -index a9694e7..f561242 100644 +index 5cb04ba..7ebff76 100644 --- a/crypto/context.c +++ b/crypto/context.c -@@ -83,6 +83,8 @@ struct ossl_lib_ctx_st { +@@ -84,6 +84,8 @@ struct ossl_lib_ctx_st { void *fips_prov; #endif + void *legacy_digest_signatures; + - unsigned int ischild:1; + unsigned int ischild : 1; }; -@@ -223,6 +225,10 @@ static int context_init(OSSL_LIB_CTX *ctx) +@@ -233,6 +235,10 @@ static int context_init(OSSL_LIB_CTX *ctx) goto err; #endif @@ -45,7 +45,7 @@ index a9694e7..f561242 100644 /* Low priority. */ #ifndef FIPS_MODULE ctx->child_provider = ossl_child_prov_ctx_new(ctx); -@@ -366,6 +372,11 @@ static void context_deinit_objs(OSSL_LIB_CTX *ctx) +@@ -376,6 +382,11 @@ static void context_deinit_objs(OSSL_LIB_CTX *ctx) } #endif @@ -57,7 +57,7 @@ index a9694e7..f561242 100644 /* Low priority. */ #ifndef FIPS_MODULE if (ctx->child_provider != NULL) { -@@ -663,6 +674,9 @@ void *ossl_lib_ctx_get_data(OSSL_LIB_CTX *ctx, int index) +@@ -674,6 +685,9 @@ void *ossl_lib_ctx_get_data(OSSL_LIB_CTX *ctx, int index) return ctx->fips_prov; #endif @@ -68,7 +68,7 @@ index a9694e7..f561242 100644 return NULL; } diff --git a/crypto/evp/evp_cnf.c b/crypto/evp/evp_cnf.c -index 0e7fe64..b9d3b6d 100644 +index 184bab9..8ade2b5 100644 --- a/crypto/evp/evp_cnf.c +++ b/crypto/evp/evp_cnf.c @@ -10,6 +10,7 @@ @@ -79,10 +79,11 @@ index 0e7fe64..b9d3b6d 100644 #include #include #include -@@ -57,6 +58,18 @@ static int alg_module_init(CONF_IMODULE *md, const CONF *cnf) +@@ -57,7 +58,19 @@ static int alg_module_init(CONF_IMODULE *md, const CONF *cnf) ERR_raise(ERR_LIB_EVP, EVP_R_SET_DEFAULT_PROPERTY_FAILURE); return 0; } +- } else { + } else if (strcmp(oval->name, "rh-allow-sha1-signatures") == 0) { + int m; + @@ -95,16 +96,17 @@ index 0e7fe64..b9d3b6d 100644 + ERR_raise(ERR_LIB_EVP, EVP_R_SET_DEFAULT_PROPERTY_FAILURE); + return 0; + } - } else { ++ } else { ERR_raise_data(ERR_LIB_EVP, EVP_R_UNKNOWN_OPTION, - "name=%s, value=%s", oval->name, oval->value); + "name=%s, value=%s", oval->name, oval->value); + return 0; diff --git a/crypto/evp/m_sigver.c b/crypto/evp/m_sigver.c -index 3a979f4..01e6828 100644 +index 8558b4d..97af7fb 100644 --- a/crypto/evp/m_sigver.c +++ b/crypto/evp/m_sigver.c @@ -15,6 +15,73 @@ #include "internal/provider.h" - #include "internal/numbers.h" /* includes SIZE_MAX */ + #include "internal/numbers.h" /* includes SIZE_MAX */ #include "evp_local.h" +#include "crypto/context.h" + @@ -176,7 +178,7 @@ index 3a979f4..01e6828 100644 #ifndef FIPS_MODULE -@@ -253,6 +320,18 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, +@@ -251,6 +318,18 @@ reinitialize: } } @@ -196,7 +198,7 @@ index 3a979f4..01e6828 100644 if (signature->digest_verify_init == NULL) { ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR); diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c -index c4b9615..57eda1f 100644 +index 3f3e416..83a9775 100644 --- a/crypto/evp/pmeth_lib.c +++ b/crypto/evp/pmeth_lib.c @@ -33,6 +33,7 @@ @@ -207,7 +209,7 @@ index c4b9615..57eda1f 100644 #include "evp_local.h" #ifndef FIPS_MODULE -@@ -933,6 +934,20 @@ static int evp_pkey_ctx_set_md(EVP_PKEY_CTX *ctx, const EVP_MD *md, +@@ -934,6 +935,20 @@ static int evp_pkey_ctx_set_md(EVP_PKEY_CTX *ctx, const EVP_MD *md, return -2; } @@ -229,7 +231,7 @@ index c4b9615..57eda1f 100644 return EVP_PKEY_CTX_ctrl(ctx, -1, op, ctrl, 0, (void *)(md)); diff --git a/doc/man5/config.pod b/doc/man5/config.pod -index 8b3bf20..4d9254f 100644 +index 4e095c0..fe2f9f8 100644 --- a/doc/man5/config.pod +++ b/doc/man5/config.pod @@ -307,6 +307,19 @@ Within the algorithm properties section, the following names have meaning: @@ -264,34 +266,34 @@ index 7369a73..55b7423 100644 +void *ossl_ctx_legacy_digest_signatures_new(OSSL_LIB_CTX *); +void ossl_ctx_legacy_digest_signatures_free(void *); diff --git a/include/internal/cryptlib.h b/include/internal/cryptlib.h -index 64851fd..aa8ed67 100644 +index cac7c3a..3ebbaa4 100644 --- a/include/internal/cryptlib.h +++ b/include/internal/cryptlib.h -@@ -117,7 +117,8 @@ typedef struct ossl_ex_data_global_st { - # define OSSL_LIB_CTX_CHILD_PROVIDER_INDEX 18 - # define OSSL_LIB_CTX_THREAD_INDEX 19 - # define OSSL_LIB_CTX_DECODER_CACHE_INDEX 20 --# define OSSL_LIB_CTX_MAX_INDEXES 20 +@@ -114,7 +114,8 @@ typedef struct ossl_ex_data_global_st { + #define OSSL_LIB_CTX_CHILD_PROVIDER_INDEX 18 + #define OSSL_LIB_CTX_THREAD_INDEX 19 + #define OSSL_LIB_CTX_DECODER_CACHE_INDEX 20 +-#define OSSL_LIB_CTX_MAX_INDEXES 20 +# define OSSL_LIB_CTX_LEGACY_DIGEST_SIGNATURES_INDEX 21 +# define OSSL_LIB_CTX_MAX_INDEXES 22 OSSL_LIB_CTX *ossl_lib_ctx_get_concrete(OSSL_LIB_CTX *ctx); int ossl_lib_ctx_is_default(OSSL_LIB_CTX *ctx); diff --git a/include/internal/sslconf.h b/include/internal/sslconf.h -index fd7f7e3..05464b0 100644 +index a7cec01..8ddb790 100644 --- a/include/internal/sslconf.h +++ b/include/internal/sslconf.h @@ -18,4 +18,8 @@ int conf_ssl_name_find(const char *name, size_t *idx); void conf_ssl_get_cmd(const SSL_CONF_CMD *cmd, size_t idx, char **cmdstr, - char **arg); + char **arg); +/* Methods to support disabling all signatures with legacy digests */ +int ossl_ctx_legacy_digest_signatures_allowed(OSSL_LIB_CTX *libctx, int loadconfig); +int ossl_ctx_legacy_digest_signatures_allowed_set(OSSL_LIB_CTX *libctx, int allow, -+ int loadconfig); ++ int loadconfig); #endif diff --git a/providers/common/securitycheck.c b/providers/common/securitycheck.c -index 0d3acdb..fe694c4 100644 +index 71519c6..afda0e4 100644 --- a/providers/common/securitycheck.c +++ b/providers/common/securitycheck.c @@ -19,6 +19,7 @@ @@ -302,10 +304,10 @@ index 0d3acdb..fe694c4 100644 /* * FIPS requires a minimum security strength of 112 bits (for encryption or -@@ -243,6 +244,15 @@ int ossl_digest_get_approved_nid_with_sha1(OSSL_LIB_CTX *ctx, const EVP_MD *md, +@@ -244,6 +245,15 @@ int ossl_digest_get_approved_nid_with_sha1(OSSL_LIB_CTX *ctx, const EVP_MD *md, mdnid = -1; /* disallowed by security checks */ } - # endif /* OPENSSL_NO_FIPS_SECURITYCHECKS */ + #endif /* OPENSSL_NO_FIPS_SECURITYCHECKS */ + +#ifndef FIPS_MODULE + if (!ossl_ctx_legacy_digest_signatures_allowed(ctx, 0)) @@ -318,10 +320,10 @@ index 0d3acdb..fe694c4 100644 return mdnid; } -@@ -252,5 +262,15 @@ int ossl_digest_is_allowed(OSSL_LIB_CTX *ctx, const EVP_MD *md) +@@ -253,5 +263,15 @@ int ossl_digest_is_allowed(OSSL_LIB_CTX *ctx, const EVP_MD *md) if (ossl_securitycheck_enabled(ctx)) return ossl_digest_get_approved_nid(md) != NID_undef; - # endif /* OPENSSL_NO_FIPS_SECURITYCHECKS */ + #endif /* OPENSSL_NO_FIPS_SECURITYCHECKS */ + +#ifndef FIPS_MODULE + { @@ -335,7 +337,7 @@ index 0d3acdb..fe694c4 100644 return 1; } diff --git a/providers/common/securitycheck_default.c b/providers/common/securitycheck_default.c -index 2463234..2ca7a59 100644 +index be4e078..b5a4c8c 100644 --- a/providers/common/securitycheck_default.c +++ b/providers/common/securitycheck_default.c @@ -15,6 +15,7 @@ @@ -350,14 +352,14 @@ index 2463234..2ca7a59 100644 } int ossl_digest_rsa_sign_get_md_nid(OSSL_LIB_CTX *ctx, const EVP_MD *md, -- ossl_unused int sha1_allowed) -+ int sha1_allowed) +- ossl_unused int sha1_allowed) ++ int sha1_allowed) { int mdnid; + int ldsigs_allowed; static const OSSL_ITEM name_to_nid[] = { - { NID_md5, OSSL_DIGEST_NAME_MD5 }, + { NID_md5, OSSL_DIGEST_NAME_MD5 }, @@ -42,8 +44,11 @@ int ossl_digest_rsa_sign_get_md_nid(OSSL_LIB_CTX *ctx, const EVP_MD *md, { NID_ripemd160, OSSL_DIGEST_NAME_RIPEMD160 }, }; @@ -372,10 +374,10 @@ index 2463234..2ca7a59 100644 return mdnid; } diff --git a/providers/implementations/signature/dsa_sig.c b/providers/implementations/signature/dsa_sig.c -index b89a0f6..e0c26a1 100644 +index c3bc915..7471ec1 100644 --- a/providers/implementations/signature/dsa_sig.c +++ b/providers/implementations/signature/dsa_sig.c -@@ -125,12 +125,17 @@ static int dsa_setup_md(PROV_DSA_CTX *ctx, +@@ -124,14 +124,19 @@ static int dsa_setup_md(PROV_DSA_CTX *ctx, mdprops = ctx->propq; if (mdname != NULL) { @@ -383,25 +385,29 @@ index b89a0f6..e0c26a1 100644 WPACKET pkt; EVP_MD *md = EVP_MD_fetch(ctx->libctx, mdname, mdprops); - int md_nid = ossl_digest_get_approved_nid_with_sha1(ctx->libctx, md, -- sha1_allowed); -+ int md_nid; +- sha1_allowed); ++ int md_nid; size_t mdname_len = strlen(mdname); +- +- if (md == NULL || md_nid < 0) { +#ifdef FIPS_MODULE + int sha1_allowed = (ctx->operation != EVP_PKEY_OP_SIGN); +#else + int sha1_allowed = 0; +#endif + md_nid = ossl_digest_get_approved_nid_with_sha1(ctx->libctx, md, -+ sha1_allowed); - - if (md == NULL || md_nid < 0) { ++ sha1_allowed); ++ ++ if (md == NULL || md_nid < 0) { if (md == NULL) + ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_DIGEST, + "%s could not be fetched", mdname); diff --git a/providers/implementations/signature/ecdsa_sig.c b/providers/implementations/signature/ecdsa_sig.c -index fe65ed8..191580b 100644 +index 0d19adb..ed1f402 100644 --- a/providers/implementations/signature/ecdsa_sig.c +++ b/providers/implementations/signature/ecdsa_sig.c -@@ -247,7 +247,11 @@ static int ecdsa_setup_md(PROV_ECDSA_CTX *ctx, const char *mdname, - "%s could not be fetched", mdname); +@@ -251,7 +251,11 @@ static int ecdsa_setup_md(PROV_ECDSA_CTX *ctx, const char *mdname, + "%s could not be fetched", mdname); return 0; } +#ifdef FIPS_MODULE @@ -410,10 +416,10 @@ index fe65ed8..191580b 100644 + sha1_allowed = 0; +#endif md_nid = ossl_digest_get_approved_nid_with_sha1(ctx->libctx, md, - sha1_allowed); + sha1_allowed); if (md_nid < 0) { diff --git a/providers/implementations/signature/rsa_sig.c b/providers/implementations/signature/rsa_sig.c -index 76db37d..2391909 100644 +index ed50deb..b70cfc8 100644 --- a/providers/implementations/signature/rsa_sig.c +++ b/providers/implementations/signature/rsa_sig.c @@ -25,6 +25,7 @@ @@ -432,11 +438,11 @@ index 76db37d..2391909 100644 static OSSL_FUNC_signature_newctx_fn rsa_newctx; static OSSL_FUNC_signature_sign_init_fn rsa_sign_init; -@@ -301,10 +303,15 @@ static int rsa_setup_md(PROV_RSA_CTX *ctx, const char *mdname, +@@ -317,10 +319,15 @@ static int rsa_setup_md(PROV_RSA_CTX *ctx, const char *mdname, if (mdname != NULL) { EVP_MD *md = EVP_MD_fetch(ctx->libctx, mdname, mdprops); -+ int md_nid; ++ int md_nid; + size_t mdname_len = strlen(mdname); +#ifdef FIPS_MODULE int sha1_allowed = (ctx->operation != EVP_PKEY_OP_SIGN); @@ -445,12 +451,12 @@ index 76db37d..2391909 100644 + int sha1_allowed = 0; +#endif + md_nid = ossl_digest_rsa_sign_get_md_nid(ctx->libctx, md, - sha1_allowed); + sha1_allowed); - size_t mdname_len = strlen(mdname); if (md == NULL || md_nid <= 0 -@@ -1366,8 +1373,15 @@ static int rsa_set_ctx_params(void *vprsactx, const OSSL_PARAM params[]) +@@ -1371,8 +1378,15 @@ static int rsa_set_ctx_params(void *vprsactx, const OSSL_PARAM params[]) prsactx->pad_mode = pad_mode; if (prsactx->md == NULL && pmdname == NULL @@ -468,7 +474,7 @@ index 76db37d..2391909 100644 if (pmgf1mdname != NULL && !rsa_setup_mgf1_md(prsactx, pmgf1mdname, pmgf1mdprops)) diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c -index e9aa078..b4969f5 100644 +index b752fda..b1eedc0 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -20,6 +20,7 @@ @@ -479,7 +485,7 @@ index e9aa078..b4969f5 100644 #include "internal/nelem.h" #include "internal/sizes.h" #include "internal/tlsgroups.h" -@@ -1514,6 +1515,7 @@ int ssl_setup_sigalgs(SSL_CTX *ctx) +@@ -1513,6 +1514,7 @@ int ssl_setup_sigalgs(SSL_CTX *ctx) uint16_t *tls12_sigalgs_list = NULL; EVP_PKEY *tmpkey = EVP_PKEY_new(); int ret = 0; @@ -487,15 +493,15 @@ index e9aa078..b4969f5 100644 if (ctx == NULL) goto err; -@@ -1529,6 +1531,7 @@ int ssl_setup_sigalgs(SSL_CTX *ctx) +@@ -1528,6 +1530,7 @@ int ssl_setup_sigalgs(SSL_CTX *ctx) goto err; ERR_set_mark(); + ldsigs_allowed = ossl_ctx_legacy_digest_signatures_allowed(ctx->libctx, 0); /* First fill cache and tls12_sigalgs list from legacy algorithm list */ for (i = 0, lu = sigalg_lookup_tbl; - i < OSSL_NELEM(sigalg_lookup_tbl); lu++, i++) { -@@ -1550,6 +1553,11 @@ int ssl_setup_sigalgs(SSL_CTX *ctx) + i < OSSL_NELEM(sigalg_lookup_tbl); lu++, i++) { +@@ -1549,6 +1552,11 @@ int ssl_setup_sigalgs(SSL_CTX *ctx) cache[i].enabled = 0; continue; } @@ -518,5 +524,5 @@ index 7581369..8590276 100644 +ossl_ctx_legacy_digest_signatures_allowed ? 3_0_1 EXIST::FUNCTION: +ossl_ctx_legacy_digest_signatures_allowed_set ? 3_0_1 EXIST::FUNCTION: -- -2.33.8 +2.45.4 diff --git a/SPECS/openssl/0052-Allow-SHA1-in-seclevel-1-if-rh-allow-sha1-signatures.patch b/SPECS/openssl/0052-Allow-SHA1-in-seclevel-1-if-rh-allow-sha1-signatures.patch index 71876ded60e..1cc9c958b15 100644 --- a/SPECS/openssl/0052-Allow-SHA1-in-seclevel-1-if-rh-allow-sha1-signatures.patch +++ b/SPECS/openssl/0052-Allow-SHA1-in-seclevel-1-if-rh-allow-sha1-signatures.patch @@ -4,14 +4,14 @@ Date: Wed, 17 Apr 2024 22:18:03 +0000 Subject: [PATCH] Allow SHA1 in seclevel 1 if rh allow sha1 signatures --- - crypto/x509/x509_vfy.c | 20 ++++++++++- - doc/man5/config.pod | 7 ++++ - ssl/t1_lib.c | 62 ++++++++++++++++++++++++++++++----- + crypto/x509/x509_vfy.c | 20 +++++++++++- + doc/man5/config.pod | 7 +++++ + ssl/t1_lib.c | 58 +++++++++++++++++++++++++++++++---- test/recipes/25-test_verify.t | 4 +-- - 4 files changed, 81 insertions(+), 12 deletions(-) + 4 files changed, 80 insertions(+), 9 deletions(-) diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c -index 1794c14..1dfbe58 100644 +index 23118b7..98f69ab 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -25,6 +25,7 @@ @@ -22,7 +22,7 @@ index 1794c14..1dfbe58 100644 #include "crypto/x509.h" #include "x509_local.h" -@@ -3668,14 +3669,31 @@ static int check_sig_level(X509_STORE_CTX *ctx, X509 *cert) +@@ -3662,14 +3663,31 @@ static int check_sig_level(X509_STORE_CTX *ctx, X509 *cert) { int secbits = -1; int level = ctx->param->auth_level; @@ -56,7 +56,7 @@ index 1794c14..1dfbe58 100644 return secbits >= minbits_table[level - 1]; } diff --git a/doc/man5/config.pod b/doc/man5/config.pod -index 4d9254f..d1c4ad1 100644 +index fe2f9f8..44ae801 100644 --- a/doc/man5/config.pod +++ b/doc/man5/config.pod @@ -320,6 +320,13 @@ this option is set to B. Because TLS 1.1 or lower use MD5-SHA1 as @@ -74,7 +74,7 @@ index 4d9254f..d1c4ad1 100644 The value is a boolean that can be B or B. If the value is diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c -index b4969f5..4560dc5 100644 +index b1eedc0..e58d803 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -20,6 +20,7 @@ @@ -85,22 +85,18 @@ index b4969f5..4560dc5 100644 #include "internal/sslconf.h" #include "internal/nelem.h" #include "internal/sizes.h" -@@ -1989,15 +1990,28 @@ int tls12_check_peer_sigalg(SSL_CONNECTION *s, uint16_t sig, EVP_PKEY *pkey) +@@ -1986,12 +1987,27 @@ int tls12_check_peer_sigalg(SSL_CONNECTION *s, uint16_t sig, EVP_PKEY *pkey) * Make sure security callback allows algorithm. For historical * reasons we have to pass the sigalg as a two byte char array. */ - sigalgstr[0] = (sig >> 8) & 0xff; - sigalgstr[1] = sig & 0xff; - secbits = sigalg_security_bits(SSL_CONNECTION_GET_CTX(s), lu); -- if (secbits == 0 || -- !ssl_security(s, SSL_SECOP_SIGALG_CHECK, secbits, -- md != NULL ? EVP_MD_get_type(md) : NID_undef, -- (void *)sigalgstr)) { +- if (secbits == 0 || !ssl_security(s, SSL_SECOP_SIGALG_CHECK, secbits, md != NULL ? EVP_MD_get_type(md) : NID_undef, (void *)sigalgstr)) { - SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE, SSL_R_WRONG_SIGNATURE_TYPE); - return 0; -+ + if ((lu->hash == NID_sha1 || lu->hash == NID_md5_sha1) -+ && ossl_ctx_legacy_digest_signatures_allowed(SSL_CONNECTION_GET_CTX(s)->libctx, 0) ++ && ossl_ctx_legacy_digest_signatures_allowed(SSL_CONNECTION_GET_CTX(s)->libctx, 0) + && SSL_get_security_level(SSL_CONNECTION_GET_SSL(s)) < 2) { + /* When rh-allow-sha1-signatures = yes and security level <= 1, + * explicitly allow SHA1 for backwards compatibility. Also allow @@ -123,7 +119,7 @@ index b4969f5..4560dc5 100644 } /* Store the sigalg the peer uses */ s->s3.tmp.peer_sigalg = lu; -@@ -2568,6 +2582,15 @@ static int tls12_sigalg_allowed(const SSL_CONNECTION *s, int op, +@@ -2566,6 +2582,15 @@ static int tls12_sigalg_allowed(const SSL_CONNECTION *s, int op, } } @@ -139,7 +135,7 @@ index b4969f5..4560dc5 100644 /* Finally see if security callback allows it */ secbits = sigalg_security_bits(SSL_CONNECTION_GET_CTX(s), lu); sigalgstr[0] = (lu->sigalg >> 8) & 0xff; -@@ -3511,6 +3534,7 @@ static int ssl_security_cert_sig(SSL_CONNECTION *s, SSL_CTX *ctx, X509 *x, +@@ -3505,6 +3530,7 @@ static int ssl_security_cert_sig(SSL_CONNECTION *s, SSL_CTX *ctx, X509 *x, { /* Lookup signature algorithm digest */ int secbits, nid, pknid; @@ -147,7 +143,7 @@ index b4969f5..4560dc5 100644 /* Don't check signature if self signed */ if ((X509_get_extension_flags(x) & EXFLAG_SS) != 0) -@@ -3520,6 +3544,26 @@ static int ssl_security_cert_sig(SSL_CONNECTION *s, SSL_CTX *ctx, X509 *x, +@@ -3514,6 +3540,26 @@ static int ssl_security_cert_sig(SSL_CONNECTION *s, SSL_CTX *ctx, X509 *x, /* If digest NID not defined use signature NID */ if (nid == NID_undef) nid = pknid; @@ -175,10 +171,10 @@ index b4969f5..4560dc5 100644 return ssl_security(s, op, secbits, nid, x); else diff --git a/test/recipes/25-test_verify.t b/test/recipes/25-test_verify.t -index 1c8fce8..a584629 100644 +index dc66662..17b7960 100644 --- a/test/recipes/25-test_verify.t +++ b/test/recipes/25-test_verify.t -@@ -481,8 +481,8 @@ ok(verify("ee-pss-sha1-cert", "", ["root-cert"], ["ca-cert"], "-auth_level", "0" +@@ -482,8 +482,8 @@ ok(verify("ee-pss-sha1-cert", "", ["root-cert"], ["ca-cert"], "-auth_level", "0" ok(verify("ee-pss-sha256-cert", "", ["root-cert"], ["ca-cert"], ), "CA with PSS signature using SHA256"); @@ -190,5 +186,5 @@ index 1c8fce8..a584629 100644 ok(verify("ee-pss-sha256-cert", "", ["root-cert"], ["ca-cert"], "-auth_level", "2"), "PSS signature using SHA256 and auth level 2"); -- -2.33.8 +2.45.4 diff --git a/SPECS/openssl/CVE-2025-69419.patch b/SPECS/openssl/CVE-2025-69419.patch deleted file mode 100644 index 811801edd8a..00000000000 --- a/SPECS/openssl/CVE-2025-69419.patch +++ /dev/null @@ -1,48 +0,0 @@ -From a26a90d38edec3748566129d824e664b54bee2e2 Mon Sep 17 00:00:00 2001 -From: Norbert Pocs -Date: Thu, 11 Dec 2025 12:49:00 +0100 -Subject: [PATCH] Check return code of UTF8_putc - -Signed-off-by: Norbert Pocs - -Reviewed-by: Nikola Pajkovsky -Reviewed-by: Viktor Dukhovni -(Merged from https://github.com/openssl/openssl/pull/29376) ---- - crypto/asn1/a_strex.c | 6 ++++-- - crypto/pkcs12/p12_utl.c | 5 +++++ - 2 files changed, 9 insertions(+), 2 deletions(-) - -diff --git a/crypto/asn1/a_strex.c b/crypto/asn1/a_strex.c -index 683b8a06fc540..68c2e31a70a28 100644 ---- a/crypto/asn1/a_strex.c -+++ b/crypto/asn1/a_strex.c -@@ -198,8 +198,10 @@ static int do_buf(unsigned char *buf, int buflen, - orflags = CHARTYPE_LAST_ESC_2253; - if (type & BUF_TYPE_CONVUTF8) { - unsigned char utfbuf[6]; -- int utflen; -- utflen = UTF8_putc(utfbuf, sizeof(utfbuf), c); -+ int utflen = UTF8_putc(utfbuf, sizeof(utfbuf), c); -+ -+ if (utflen < 0) -+ return -1; /* error happened with UTF8 */ - for (i = 0; i < utflen; i++) { - /* - * We don't need to worry about setting orflags correctly -diff --git a/crypto/pkcs12/p12_utl.c b/crypto/pkcs12/p12_utl.c -index 1669ef5b07939..9360f9930713f 100644 ---- a/crypto/pkcs12/p12_utl.c -+++ b/crypto/pkcs12/p12_utl.c -@@ -206,6 +206,11 @@ char *OPENSSL_uni2utf8(const unsigned char *uni, int unilen) - /* re-run the loop emitting UTF-8 string */ - for (asclen = 0, i = 0; i < unilen; ) { - j = bmp_to_utf8(asctmp+asclen, uni+i, unilen-i); -+ /* when UTF8_putc fails */ -+ if (j < 0) { -+ OPENSSL_free(asctmp); -+ return NULL; -+ } - if (j == 4) i += 4; - else i += 2; - asclen += j; diff --git a/SPECS/openssl/CVE-2026-22796.patch b/SPECS/openssl/CVE-2026-22796.patch deleted file mode 100644 index c1dc210699f..00000000000 --- a/SPECS/openssl/CVE-2026-22796.patch +++ /dev/null @@ -1,73 +0,0 @@ -From eeee3cbd4d682095ed431052f00403004596373e Mon Sep 17 00:00:00 2001 -From: Bob Beck -Date: Wed, 7 Jan 2026 11:29:48 -0700 -Subject: [PATCH] Ensure ASN1 types are checked before use. - -Some of these were fixed by LibreSSL in commit https://github.com/openbsd/src/commit/aa1f637d454961d22117b4353f98253e984b3ba8 -this fix includes the other fixes in that commit, as well as fixes for others found by a scan -for a similar unvalidated access paradigm in the tree. - -Reviewed-by: Kurt Roeckx -Reviewed-by: Shane Lontis -Reviewed-by: Tomas Mraz -(Merged from https://github.com/openssl/openssl/pull/29582) - -Fixes CVE-2026-22796, CVE-2026-22795 ---- - apps/s_client.c | 3 ++- - crypto/pkcs12/p12_kiss.c | 10 ++++++++-- - crypto/pkcs7/pk7_doit.c | 2 ++ - 3 files changed, 12 insertions(+), 3 deletions(-) - -diff --git a/apps/s_client.c b/apps/s_client.c -index c5b7384a290a4..1f52cf378fbbc 100644 ---- a/apps/s_client.c -+++ b/apps/s_client.c -@@ -2832,8 +2832,9 @@ int s_client_main(int argc, char **argv) - goto end; - } - atyp = ASN1_generate_nconf(genstr, cnf); -- if (atyp == NULL) { -+ if (atyp == NULL || atyp->type != V_ASN1_SEQUENCE) { - NCONF_free(cnf); -+ ASN1_TYPE_free(atyp); - BIO_printf(bio_err, "ASN1_generate_nconf failed\n"); - goto end; - } -diff --git a/crypto/pkcs12/p12_kiss.c b/crypto/pkcs12/p12_kiss.c -index 10b581612dbb2..d0236e34fe9df 100644 ---- a/crypto/pkcs12/p12_kiss.c -+++ b/crypto/pkcs12/p12_kiss.c -@@ -196,11 +196,17 @@ static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen, - ASN1_BMPSTRING *fname = NULL; - ASN1_OCTET_STRING *lkid = NULL; - -- if ((attrib = PKCS12_SAFEBAG_get0_attr(bag, NID_friendlyName))) -+ if ((attrib = PKCS12_SAFEBAG_get0_attr(bag, NID_friendlyName))) { -+ if (attrib->type != V_ASN1_BMPSTRING) -+ return 0; - fname = attrib->value.bmpstring; -+ } - -- if ((attrib = PKCS12_SAFEBAG_get0_attr(bag, NID_localKeyID))) -+ if ((attrib = PKCS12_SAFEBAG_get0_attr(bag, NID_localKeyID))) { -+ if (attrib->type != V_ASN1_OCTET_STRING) -+ return 0; - lkid = attrib->value.octet_string; -+ } - - switch (PKCS12_SAFEBAG_get_nid(bag)) { - case NID_keyBag: -diff --git a/crypto/pkcs7/pk7_doit.c b/crypto/pkcs7/pk7_doit.c -index 74f863af8fa52..6353fec47c068 100644 ---- a/crypto/pkcs7/pk7_doit.c -+++ b/crypto/pkcs7/pk7_doit.c -@@ -1178,6 +1178,8 @@ ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk) - ASN1_TYPE *astype; - if ((astype = get_attribute(sk, NID_pkcs9_messageDigest)) == NULL) - return NULL; -+ if (astype->type != V_ASN1_OCTET_STRING) -+ return NULL; - return astype->value.octet_string; - } - diff --git a/SPECS/openssl/CVE-2026-28388.patch b/SPECS/openssl/CVE-2026-28388.patch deleted file mode 100644 index e69738aa84b..00000000000 --- a/SPECS/openssl/CVE-2026-28388.patch +++ /dev/null @@ -1,155 +0,0 @@ -From 6297bdc962e9f2ecb436e26dc51f4fff653a0a89 Mon Sep 17 00:00:00 2001 -From: Daniel Kubec -Date: Tue, 17 Mar 2026 11:11:22 +0100 -Subject: [PATCH 1/2] Fix NULL Dereference When Delta CRL Lacks CRL Number - Extension - -Fixes CVE-2026-28388 -Fixes https://github.com/openssl/srt/issues/77 - -Signed-off-by: Kanishk Bansal ---- - crypto/x509/x509_vfy.c | 2 ++ - test/certs/cve-2026-28388-ca.pem | 19 +++++++++++++++++++ - test/certs/cve-2026-28388-crls.pem | 22 ++++++++++++++++++++++ - test/certs/cve-2026-28388-leaf.pem | 19 +++++++++++++++++++ - test/recipes/25-test_verify.t | 15 +++++++++++++-- - 5 files changed, 75 insertions(+), 2 deletions(-) - create mode 100644 test/certs/cve-2026-28388-ca.pem - create mode 100644 test/certs/cve-2026-28388-crls.pem - create mode 100644 test/certs/cve-2026-28388-leaf.pem - -diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c -index 1dfbe58..7ba2d2c 100644 ---- a/crypto/x509/x509_vfy.c -+++ b/crypto/x509/x509_vfy.c -@@ -1227,6 +1227,8 @@ static int check_delta_base(X509_CRL *delta, X509_CRL *base) - if (ASN1_INTEGER_cmp(delta->base_crl_number, base->crl_number) > 0) - return 0; - /* Delta CRL number must exceed full CRL number */ -+ if (delta->crl_number == NULL) -+ return 0; - return ASN1_INTEGER_cmp(delta->crl_number, base->crl_number) > 0; - } - -diff --git a/test/certs/cve-2026-28388-ca.pem b/test/certs/cve-2026-28388-ca.pem -new file mode 100644 -index 0000000..9e36d11 ---- /dev/null -+++ b/test/certs/cve-2026-28388-ca.pem -@@ -0,0 +1,19 @@ -+-----BEGIN CERTIFICATE----- -+MIIDFTCCAf2gAwIBAgIUOl5NN/jfsuLU9JSGLZAfRzviF+owDQYJKoZIhvcNAQEL -+BQAwEjEQMA4GA1UEAwwHVGVzdCBDQTAeFw0yNjAzMTcwODE5NDdaFw0yNzAzMTcw -+ODE5NDdaMBIxEDAOBgNVBAMMB1Rlc3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IB -+DwAwggEKAoIBAQD0m4KETjF0c25spNWUiNChWP0GalDL0gVDFbtAoMVF/lvlZEcp -+hcg62ifHJRPntWyVAmH70DAI87cWzl/73QYGaOcMVcH5yEM31BoK83FvhsS3RTPO -+FSrNCHaZrrWuga+QkBmMcR6qX7GF5eb6ASMBsLuuDqbkCRbTJ2ryhYeWF+VFemBF -+pSHpcinSSLvswTVbZiCqmoy0WkK8eiyfLMZA17PgVLQpyPZ3rp5YG5vEZZoqFc/f -+1bCHjwQ7fNdLCEMqPvE/I0mg2skRClb1L1Vieud/jmjL8nVd9I12j1eUOcSKtCkW -+nj4BFa7TRz13sN3LZOFvV774ZaXRJ1GxoAlnAgMBAAGjYzBhMB0GA1UdDgQWBBSt -+UxfaVbV9QMmfwMoImdgi4MZHzTAfBgNVHSMEGDAWgBStUxfaVbV9QMmfwMoImdgi -+4MZHzTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0B -+AQsFAAOCAQEA84w49n0pPJlqiD1/mn3pUZ66lBP0fFZiCuV/3YatBZcW+xcboW0Q -+xImYztjZo0i+sQLZOalI4GoBqD77Dv4Qas0QoJZIp0wM8DjE3YcudCr4cpUhT1XC -+ruHVHQA9bY5rW0GsfUBW6/3RbRpiK4SaFG3sUBbXPo0dC2EaLDjpLM7o2UljRrWu -+d/vg6ieKuAicexLxqQLdM4SxjyvBpCwHg/dnMxawSj4Xhks1BHJ0hTLKJGDgfVHh -+ex8+878u6Gf7fAOZa5idWUgTvdt5WHSW5x+Tm/P6LGG3HkM425ZU6BLTCHONoBud -+cOlfWTTuIyweX5TRL5HY3SuO1cpMBpjiAA== -+-----END CERTIFICATE----- -diff --git a/test/certs/cve-2026-28388-crls.pem b/test/certs/cve-2026-28388-crls.pem -new file mode 100644 -index 0000000..46cbd78 ---- /dev/null -+++ b/test/certs/cve-2026-28388-crls.pem -@@ -0,0 +1,22 @@ -+-----BEGIN X509 CRL----- -+MIIBizB1AgEBMA0GCSqGSIb3DQEBCwUAMBIxEDAOBgNVBAMMB1Rlc3QgQ0EXDTI2 -+MDMxNzA4MTk0N1oXDTI2MDQxNjA4MTk0N1qgLzAtMB8GA1UdIwQYMBaAFK1TF9pV -+tX1AyZ/AygiZ2CLgxkfNMAoGA1UdFAQDAgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBl -+3vVknchCNA/oW0ovtnrE+xQs8yAk3uElooQlw88moTcts2YAcKWl49lnNWZk/RbF -+Zs8m+MUuNb2W861siuvY3EwnSKVaJB2tKPfCRBP4xt+Q0g/Tn5CWxzpzHjQfLT6l -+pvWOwaO7aE6bthX7MQ9XBpnHSPxsbul+MhV5PER11BYZGVh5MH0XxfMI0jDHFh2M -+klTamgaao3TkVOI3OQPgzUx/q0Lz/YoCIH0pYGGP6KTGUX2x7UfD1tcIOcUp6tvO -+6hG3utMgJOpZJl9yMzhG+ZURjbz4MSbBM0FVIaWnBn2VzY1jHGky0nK83IZhiddf -+OohWoSH8tqwrNFZkblAH -+-----END X509 CRL----- -+-----BEGIN X509 CRL----- -+MIIBjjB4AgEBMA0GCSqGSIb3DQEBCwUAMBIxEDAOBgNVBAMMB1Rlc3QgQ0EXDTI2 -+MDEwODEyMDAwMFoXDTI2MDIwODEyMDAwMFqgMjAwMB8GA1UdIwQYMBaAFK1TF9pV -+tX1AyZ/AygiZ2CLgxkfNMA0GA1UdGwEB/wQDAgEBMA0GCSqGSIb3DQEBCwUAA4IB -+AQCyYxa5iVUFxBpdXgBGSMqkuxJqQzVni8nXK0DiXHfgbTud+HD5Qp/6PX2EQuwK -+SrT0yeNJBU1gxxMMsbdA0yVTPa7N2Ny39mjq/27yBXduiljo3Gs4NLEW9grJRnep -+WOD1cQe3Fea5HlEfUoQJF1WVekF6CnOSqESaDvTAzqpZd7pxU8cuduiRJPin93ki -+1nicQAU/G4Td190+JEAWD3/dJTg2LF6LKrmHiv2ZUTuNsVBfcbhFSoC6FpnjFUAI -+kF8EgJpuBEfqV6erIuT1GD+5p1QGNqdcNl7LO9erJaUFnssJBJtj84iXd7RZARNs -+njcibOSKC9YWgNmZUy0QV5D8 -+-----END X509 CRL----- -diff --git a/test/certs/cve-2026-28388-leaf.pem b/test/certs/cve-2026-28388-leaf.pem -new file mode 100644 -index 0000000..02b2299 ---- /dev/null -+++ b/test/certs/cve-2026-28388-leaf.pem -@@ -0,0 +1,19 @@ -+-----BEGIN CERTIFICATE----- -+MIIDHTCCAgWgAwIBAgIBATANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQDDAdUZXN0 -+IENBMB4XDTI2MDMxNzA4MTk0N1oXDTI3MDMxNzA4MTk0N1owFDESMBAGA1UEAwwJ -+VGVzdCBMZWFmMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqx7jpC6+ -+nRZ4ol6sShkpv04hGYtt7y+Ns4oIfdQTqo57DItFab8D8cH04zR8NND42MMnsPPn -+Ovh9gv2l1mj9ZfwgXI5PvaKc6CoXvXb0ttekdDUS1iw9g04BxIXTDANxsdSXrCDd -+Npyr1Pxdo3N2fiH6qN9/Lsh7yg0vJW/aJzdvhLcCTFcr89qmCsh17XfcTR0wZJXP -+QdlRib9EK8aa6aKOYmm44SBbuXXyWojhheUaqVuzDj6A0L9opmh/DVXa9bdIN/FX -+CKJB+d60Qxy5pKwpzDDxbCdG2vA1U2cPz8yAgelFG5AmXSHF7Id4G6GTCAY6PbTO -+Jy2Z4I6NY+mj5wIDAQABo3wwejAdBgNVHQ4EFgQUlf2YZ93MvS4kZm7fshosgp+J -+ImkwHwYDVR0jBBgwFoAUrVMX2lW1fUDJn8DKCJnYIuDGR80wCQYDVR0TBAIwADAt -+BgNVHS4EJjAkMCKgIKAehhxodHRwOi8vZXhhbXBsZS5jb20vZGVsdGEucGVtMA0G -+CSqGSIb3DQEBCwUAA4IBAQDoNAQGLS0Juf3i2fhuVQyWIFvNIMElLexeLnnd/y80 -+13nsP68ZGT2D3DoHQSz3SL7sNjLBc2CiUVftdaRQ4dNCz8sBY5BRTS5XEGbbTAFZ -+bQUReykuuTy83CGw/JYN6YT/OHcf4gEhUnWtRMCmIz3J/NMRVSRnpV2Ezjltm/Q+ -+emFS/QclRhkP6Vu+lwM/nV6uAN8T7Ba68Hym2MN0clozrpoKeqFouB7D0i+iCZMw -+zbac5as0hn7Fm+HGTbfTs2/fqUslvE6PmagepceP37pTSSVmYRmdpOD2cyCb30A+ -+nJFGQg7PcacGSL1re65W35XzdU8Si8OYD+PxjDaRbPcP -+-----END CERTIFICATE----- -diff --git a/test/recipes/25-test_verify.t b/test/recipes/25-test_verify.t -index 90bc684..45928c9 100644 ---- a/test/recipes/25-test_verify.t -+++ b/test/recipes/25-test_verify.t -@@ -6,7 +6,6 @@ - # in the file LICENSE in the source distribution or at - # https://www.openssl.org/source/license.html - -- - use strict; - use warnings; - -@@ -30,7 +29,7 @@ sub verify { - run(app([@args])); - } - --plan tests => 202; -+plan tests => 203; - - # Canonical success - ok(verify("ee-cert", "sslserver", ["root-cert"], ["ca-cert"]), -@@ -591,6 +590,18 @@ ok(!verify("ee-cert-policies-bad", "", ["root-cert"], ["ca-pol-cert"], - "-explicit_policy"), - "Bad certificate policy"); - -+# CVE-2026-28388 -+my $cve_28388_stderr = "cve-2026-28388.err"; -+run(app(["openssl", "verify", -+ "-attime", "1739527200", -+ "-CAfile", srctop_file(@certspath, "cve-2026-28388-ca.pem"), -+ "-crl_check", "-use_deltas", -+ "-CRLfile", srctop_file(@certspath, "cve-2026-28388-crls.pem"), -+ srctop_file(@certspath, "cve-2026-28388-leaf.pem")], -+ stderr => $cve_28388_stderr)); -+ok(grep(/CRL is not yet valid/, do { open my $fh, '<', $cve_28388_stderr; <$fh> }), -+ "CVE-2026-28388"); -+ - # CAstore option - my $rootcertname = "root-cert"; - my $rootcert = srctop_file(@certspath, "${rootcertname}.pem"); --- -2.45.4 - diff --git a/SPECS/openssl/CVE-2026-28389.patch b/SPECS/openssl/CVE-2026-28389.patch deleted file mode 100644 index 8ff4698093e..00000000000 --- a/SPECS/openssl/CVE-2026-28389.patch +++ /dev/null @@ -1,104 +0,0 @@ -From 0bd289178c04e4c164679ecf15b627082f657c07 Mon Sep 17 00:00:00 2001 -From: Neil Horman -Date: Mon, 16 Mar 2026 13:49:07 -0400 -Subject: [PATCH 1/2] Fix NULL deref in [ec]dh_cms_set_shared_info - -Multiple independent reports indicated a SIGSEGV was possible in CMS -processing when a crafted CMS EnvelopedData message using A Key -Agreement Recipient Info field. If the -KeyEncryptionAlgorithmIdentifier omits the optional parameter field, the -referenced functions above will attempt to dereference the -alg->parameter data prior to checking if the parameter field is NULL. - -Confirmed to resolve the issues using the reproducers provided in the -security reports. - -Co-authored-by: Tomas Mraz - -Fixes CVE-2026-28389 ---- - crypto/cms/cms_dh.c | 13 +++++++++---- - crypto/cms/cms_ec.c | 14 ++++++++++---- - 2 files changed, 19 insertions(+), 8 deletions(-) - -diff --git a/crypto/cms/cms_dh.c b/crypto/cms/cms_dh.c -index 402fc8c..98274d7 100644 ---- a/crypto/cms/cms_dh.c -+++ b/crypto/cms/cms_dh.c -@@ -89,16 +89,21 @@ static int dh_cms_set_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri) - int keylen, plen; - EVP_CIPHER *kekcipher = NULL; - EVP_CIPHER_CTX *kekctx; -+ const ASN1_OBJECT *aoid; -+ const void *parameter = NULL; -+ int ptype = 0; - char name[OSSL_MAX_NAME_SIZE]; - - if (!CMS_RecipientInfo_kari_get0_alg(ri, &alg, &ukm)) - goto err; - -+ X509_ALGOR_get0(&aoid, &ptype, ¶meter, alg); -+ - /* - * For DH we only have one OID permissible. If ever any more get defined - * we will need something cleverer. - */ -- if (OBJ_obj2nid(alg->algorithm) != NID_id_smime_alg_ESDH) { -+ if (OBJ_obj2nid(aoid) != NID_id_smime_alg_ESDH) { - ERR_raise(ERR_LIB_CMS, CMS_R_KDF_PARAMETER_ERROR); - goto err; - } -@@ -107,11 +112,11 @@ static int dh_cms_set_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri) - || EVP_PKEY_CTX_set_dh_kdf_md(pctx, EVP_sha1()) <= 0) - goto err; - -- if (alg->parameter->type != V_ASN1_SEQUENCE) -+ if (ptype != V_ASN1_SEQUENCE) - goto err; - -- p = alg->parameter->value.sequence->data; -- plen = alg->parameter->value.sequence->length; -+ p = ASN1_STRING_get0_data(parameter); -+ plen = ASN1_STRING_length(parameter); - kekalg = d2i_X509_ALGOR(NULL, &p, plen); - if (kekalg == NULL) - goto err; -diff --git a/crypto/cms/cms_ec.c b/crypto/cms/cms_ec.c -index a4427d7..fa7d8a6 100644 ---- a/crypto/cms/cms_ec.c -+++ b/crypto/cms/cms_ec.c -@@ -166,21 +166,27 @@ static int ecdh_cms_set_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri) - int plen, keylen; - EVP_CIPHER *kekcipher = NULL; - EVP_CIPHER_CTX *kekctx; -+ const ASN1_OBJECT *aoid = NULL; -+ int ptype = 0; -+ const void *parameter = NULL; -+ - char name[OSSL_MAX_NAME_SIZE]; - - if (!CMS_RecipientInfo_kari_get0_alg(ri, &alg, &ukm)) - return 0; - -- if (!ecdh_cms_set_kdf_param(pctx, OBJ_obj2nid(alg->algorithm))) { -+ X509_ALGOR_get0(&aoid, &ptype, ¶meter, alg); -+ -+ if (!ecdh_cms_set_kdf_param(pctx, OBJ_obj2nid(aoid))) { - ERR_raise(ERR_LIB_CMS, CMS_R_KDF_PARAMETER_ERROR); - return 0; - } - -- if (alg->parameter->type != V_ASN1_SEQUENCE) -+ if (ptype != V_ASN1_SEQUENCE) - return 0; - -- p = alg->parameter->value.sequence->data; -- plen = alg->parameter->value.sequence->length; -+ p = ASN1_STRING_get0_data(parameter); -+ plen = ASN1_STRING_length(parameter); - kekalg = d2i_X509_ALGOR(NULL, &p, plen); - if (kekalg == NULL) - goto err; --- -2.45.4 - diff --git a/SPECS/openssl/CVE-2026-28390.patch b/SPECS/openssl/CVE-2026-28390.patch deleted file mode 100644 index 3e6ab423d04..00000000000 --- a/SPECS/openssl/CVE-2026-28390.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 799af1c59b6295d39ce326cf830f219896e50642 Mon Sep 17 00:00:00 2001 -From: Neil Horman -Date: Wed, 1 Apr 2026 10:56:44 +0200 -Subject: [PATCH 2/2] Fix NULL deref in rsa_cms_decrypt - -Very simmilar to CVE-2026-28389, ensure that if we are missing -parameters in RSA-OAEP SourceFunc in CMS KeyTransportRecipientInfo, -we don't segfault when decrypting. - -Co-authored-by: Tomas Mraz - -Fixes CVE-2026-28390 ---- - crypto/cms/cms_rsa.c | 31 +++++++++++++++++++------------ - 1 file changed, 19 insertions(+), 12 deletions(-) - -diff --git a/crypto/cms/cms_rsa.c b/crypto/cms/cms_rsa.c -index f132df5..a1e26d3 100644 ---- a/crypto/cms/cms_rsa.c -+++ b/crypto/cms/cms_rsa.c -@@ -42,10 +42,13 @@ static int rsa_cms_decrypt(CMS_RecipientInfo *ri) - X509_ALGOR *cmsalg; - int nid; - int rv = -1; -- unsigned char *label = NULL; -+ const unsigned char *label = NULL; - int labellen = 0; - const EVP_MD *mgf1md = NULL, *md = NULL; - RSA_OAEP_PARAMS *oaep; -+ const ASN1_OBJECT *aoid; -+ const void *parameter = NULL; -+ int ptype = 0; - - pkctx = CMS_RecipientInfo_get0_pkey_ctx(ri); - if (pkctx == NULL) -@@ -75,21 +78,19 @@ static int rsa_cms_decrypt(CMS_RecipientInfo *ri) - goto err; - - if (oaep->pSourceFunc != NULL) { -- X509_ALGOR *plab = oaep->pSourceFunc; -+ X509_ALGOR_get0(&aoid, &ptype, ¶meter, oaep->pSourceFunc); - -- if (OBJ_obj2nid(plab->algorithm) != NID_pSpecified) { -+ if (OBJ_obj2nid(aoid) != NID_pSpecified) { - ERR_raise(ERR_LIB_CMS, CMS_R_UNSUPPORTED_LABEL_SOURCE); - goto err; - } -- if (plab->parameter->type != V_ASN1_OCTET_STRING) { -+ if (ptype != V_ASN1_OCTET_STRING) { - ERR_raise(ERR_LIB_CMS, CMS_R_INVALID_LABEL); - goto err; - } - -- label = plab->parameter->value.octet_string->data; -- /* Stop label being freed when OAEP parameters are freed */ -- plab->parameter->value.octet_string->data = NULL; -- labellen = plab->parameter->value.octet_string->length; -+ label = ASN1_STRING_get0_data(parameter); -+ labellen = ASN1_STRING_length(parameter); - } - - if (EVP_PKEY_CTX_set_rsa_padding(pkctx, RSA_PKCS1_OAEP_PADDING) <= 0) -@@ -98,10 +99,16 @@ static int rsa_cms_decrypt(CMS_RecipientInfo *ri) - goto err; - if (EVP_PKEY_CTX_set_rsa_mgf1_md(pkctx, mgf1md) <= 0) - goto err; -- if (label != NULL -- && EVP_PKEY_CTX_set0_rsa_oaep_label(pkctx, label, labellen) <= 0) { -- OPENSSL_free(label); -- goto err; -+ if (label != NULL) { -+ unsigned char *dup_label = OPENSSL_memdup(label, labellen); -+ -+ if (dup_label == NULL) -+ goto err; -+ -+ if (EVP_PKEY_CTX_set0_rsa_oaep_label(pkctx, dup_label, labellen) <= 0) { -+ OPENSSL_free(dup_label); -+ goto err; -+ } - } - /* Carry on */ - rv = 1; --- -2.45.4 - diff --git a/SPECS/openssl/CVE-2026-31789.patch b/SPECS/openssl/CVE-2026-31789.patch deleted file mode 100644 index 44265b76c8b..00000000000 --- a/SPECS/openssl/CVE-2026-31789.patch +++ /dev/null @@ -1,44 +0,0 @@ -From c1f14e209519886cd7bc714cee819d8318b2f90f Mon Sep 17 00:00:00 2001 -From: Igor Ustinov -Date: Thu, 5 Mar 2026 15:47:34 +0100 -Subject: [PATCH] Avoid possible buffer overflow in buf2hex conversion - -Fixes CVE-2026-31789 ---- - crypto/o_str.c | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - -diff --git a/crypto/o_str.c b/crypto/o_str.c -index dfac215..e187e7e 100644 ---- a/crypto/o_str.c -+++ b/crypto/o_str.c -@@ -225,6 +225,11 @@ static int buf2hexstr_sep(char *str, size_t str_n, size_t *strlength, - int has_sep = (sep != CH_ZERO); - size_t len = has_sep ? buflen * 3 : 1 + buflen * 2; - -+ if (buflen > (has_sep ? SIZE_MAX / 3 : (SIZE_MAX - 1) / 2)) { -+ ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_BYTES); -+ return 0; -+ } -+ - if (len == 0) - ++len; - if (strlength != NULL) -@@ -269,7 +274,13 @@ char *ossl_buf2hexstr_sep(const unsigned char *buf, long buflen, char sep) - if (buflen == 0) - return OPENSSL_zalloc(1); - -- tmp_n = (sep != CH_ZERO) ? buflen * 3 : 1 + buflen * 2; -+ if ((sep != CH_ZERO && (size_t)buflen > SIZE_MAX / 3) -+ || (sep == CH_ZERO && (size_t)buflen > (SIZE_MAX - 1) / 2)) { -+ ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_BYTES); -+ return NULL; -+ } -+ -+ tmp_n = (sep != CH_ZERO) ? (size_t)buflen * 3 : 1 + (size_t)buflen * 2; - if ((tmp = OPENSSL_malloc(tmp_n)) == NULL) - return NULL; - --- -2.45.4 - diff --git a/SPECS/openssl/CVE-2026-31790.patch b/SPECS/openssl/CVE-2026-31790.patch deleted file mode 100644 index 8ad2bcfeec5..00000000000 --- a/SPECS/openssl/CVE-2026-31790.patch +++ /dev/null @@ -1,153 +0,0 @@ -From a6cea8781bf8fd53768a8ea3ff2d1120ec644b0d Mon Sep 17 00:00:00 2001 -From: Nikola Pajkovsky -Date: Thu, 19 Mar 2026 12:16:08 +0100 -Subject: [PATCH 1/2] rsa_kem: validate RSA_public_encrypt() result in RSASVE - -RSA_public_encrypt() returns the number of bytes written on success and --1 on failure. With the existing `if (ret)` check, a provider-side RSA KEM -encapsulation can incorrectly succeed when the underlying RSA public -encrypt operation fails. In that case the code reports success, returns -lengths as if encapsulation completed normally, and leaves the freshly -generated secret available instead of discarding it. - -Tighten the success condition so RSASVE only succeeds when -RSA_public_encrypt() returns a positive value equal to the modulus-sized -output expected for RSA_NO_PADDING. Any other return value is treated as -failure, and the generated secret is cleansed before returning. - -Fixes CVE: CVE-2026-31790 -Fixes: https://github.com/openssl/srt/issues/95 -Signed-off-by: Nikola Pajkovsky ---- - providers/implementations/kem/rsa_kem.c | 20 ++++---- - test/evp_extra_test.c | 67 +++++++++++++++++++++++++ - 2 files changed, 78 insertions(+), 9 deletions(-) - -diff --git a/providers/implementations/kem/rsa_kem.c b/providers/implementations/kem/rsa_kem.c -index 5b8c2f2..f5c7a7a 100644 ---- a/providers/implementations/kem/rsa_kem.c -+++ b/providers/implementations/kem/rsa_kem.c -@@ -284,17 +284,19 @@ static int rsasve_generate(PROV_RSA_CTX *prsactx, - return 0; - - /* Step(3): out = RSAEP((n,e), z) */ -- ret = RSA_public_encrypt(nlen, secret, out, prsactx->rsa, RSA_NO_PADDING); -- if (ret) { -- ret = 1; -- if (outlen != NULL) -- *outlen = nlen; -- if (secretlen != NULL) -- *secretlen = nlen; -- } else { -+ ret = RSA_public_encrypt((int)nlen, secret, out, prsactx->rsa, -+ RSA_NO_PADDING); -+ if (ret <= 0 || ret != (int)nlen) { - OPENSSL_cleanse(secret, nlen); -+ return 0; - } -- return ret; -+ -+ if (outlen != NULL) -+ *outlen = nlen; -+ if (secretlen != NULL) -+ *secretlen = nlen; -+ -+ return 1; - } - - /** -diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c -index ac7517c..8ffb9ed 100644 ---- a/test/evp_extra_test.c -+++ b/test/evp_extra_test.c -@@ -644,6 +644,32 @@ static EVP_PKEY *load_example_ec_key(void) - #endif - - #ifndef OPENSSL_NO_DEPRECATED_3_0 -+ -+static EVP_PKEY *make_bad_rsa_pubkey(void) -+{ -+ RSA *rsa = NULL; -+ BIGNUM *n = NULL, *e = NULL; -+ EVP_PKEY *pkey = NULL; -+ -+ /* Deliberately invalid public key: n = 17, e = 17 */ -+ if (!TEST_ptr(pkey = EVP_PKEY_new()) -+ || !TEST_ptr(rsa = RSA_new()) -+ || !TEST_ptr(n = BN_new()) -+ || !TEST_ptr(e = BN_new()) -+ || !TEST_true(BN_set_word(n, 17)) -+ || !TEST_true(BN_set_word(e, 17)) -+ || !TEST_true(RSA_set0_key(rsa, n, e, NULL)) -+ || !EVP_PKEY_assign_RSA(pkey, rsa)) -+ goto err; -+ -+ return pkey; -+err: -+ BN_free(n); -+ BN_free(e); -+ RSA_free(rsa); -+ return NULL; -+} -+ - # ifndef OPENSSL_NO_DH - static EVP_PKEY *load_example_dh_key(void) - { -@@ -5122,6 +5148,46 @@ static int test_custom_ciph_meth(void) - return testresult; - } - -+static int test_rsasve_kem_with_invalid_pub_key(void) -+{ -+ RSA *rsa = NULL; -+ EVP_PKEY *pkey = NULL; -+ EVP_PKEY_CTX *ctx = NULL; -+ unsigned char *ct = NULL; -+ unsigned char *secret = NULL; -+ size_t ctlen = 0, secretlen = 0; -+ int testresult = 0; -+ -+ if (nullprov != NULL) { -+ testresult = TEST_skip("Test does not support a non-default library context"); -+ goto err; -+ } -+ -+ if (!TEST_ptr(pkey = make_bad_rsa_pubkey())) -+ goto err; -+ -+ if (!TEST_ptr(ctx = EVP_PKEY_CTX_new_from_pkey(testctx, pkey, NULL)) -+ || !TEST_int_eq(EVP_PKEY_encapsulate_init(ctx, NULL), 1) -+ || !TEST_int_eq(EVP_PKEY_CTX_set_kem_op(ctx, "RSASVE"), 1) -+ || !TEST_int_eq(EVP_PKEY_encapsulate(ctx, NULL, &ctlen, NULL, &secretlen), 1) -+ || !TEST_ptr(ct = OPENSSL_malloc(ctlen)) -+ || !TEST_ptr(secret = OPENSSL_malloc(secretlen))) -+ goto err; -+ -+ if (!TEST_int_eq(EVP_PKEY_encapsulate(ctx, ct, &ctlen, secret, &secretlen), 0)) -+ goto err; -+ -+ testresult = 1; -+ -+err: -+ OPENSSL_free(secret); -+ OPENSSL_free(ct); -+ EVP_PKEY_CTX_free(ctx); -+ RSA_free(rsa); -+ EVP_PKEY_free(pkey); -+ return testresult; -+} -+ - # ifndef OPENSSL_NO_DYNAMIC_ENGINE - /* Test we can create a signature keys with an associated ENGINE */ - static int test_signatures_with_engine(int tst) -@@ -5849,6 +5915,7 @@ int setup_tests(void) - ADD_TEST(test_evp_md_cipher_meth); - ADD_TEST(test_custom_md_meth); - ADD_TEST(test_custom_ciph_meth); -+ ADD_TEST(test_rsasve_kem_with_invalid_pub_key); - - # ifndef OPENSSL_NO_DYNAMIC_ENGINE - /* Tests only support the default libctx */ --- -2.45.4 - diff --git a/SPECS/openssl/CVE-2026-31791.patch b/SPECS/openssl/CVE-2026-31791.patch index 989bb60b493..bf762fc5cc0 100644 --- a/SPECS/openssl/CVE-2026-31791.patch +++ b/SPECS/openssl/CVE-2026-31791.patch @@ -11,10 +11,10 @@ jan.kaminski@cert.pl and bartosz.michalowski@cert.pl 1 file changed, 2 insertions(+) diff --git a/crypto/ocsp/ocsp_vfy.c b/crypto/ocsp/ocsp_vfy.c -index b0827e9..62a81a3 100644 +index e020ac3..62b7a3e 100644 --- a/crypto/ocsp/ocsp_vfy.c +++ b/crypto/ocsp/ocsp_vfy.c -@@ -200,6 +200,8 @@ static X509 *ocsp_find_signer_sk(STACK_OF(X509) *certs, OCSP_RESPID *id) +@@ -199,6 +199,8 @@ static X509 *ocsp_find_signer_sk(STACK_OF(X509) *certs, OCSP_RESPID *id) /* Lookup by key hash */ /* If key hash isn't SHA1 length then forget it */ diff --git a/SPECS/openssl/filter-unsupported-algs-key-lengths-dynamically.patch b/SPECS/openssl/filter-unsupported-algs-key-lengths-dynamically.patch index 70c6a4f3c51..65f6d27788e 100644 --- a/SPECS/openssl/filter-unsupported-algs-key-lengths-dynamically.patch +++ b/SPECS/openssl/filter-unsupported-algs-key-lengths-dynamically.patch @@ -5,13 +5,13 @@ Subject: [PATCH] filter unsupported algs key lengths dynamically --- apps/speed.c | 258 ++++++++++++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 256 insertions(+), 2 deletions(-) + 1 file changed, 255 insertions(+), 3 deletions(-) diff --git a/apps/speed.c b/apps/speed.c -index f04e0a5..73395ce 100644 +index 9d504f2..aed63d5 100644 --- a/apps/speed.c +++ b/apps/speed.c -@@ -611,6 +611,176 @@ static int have_cipher(const char *name) +@@ -685,6 +685,175 @@ static int have_cipher(const char *name) return ret; } @@ -121,7 +121,6 @@ index f04e0a5..73395ce 100644 + EVP_PKEY_CTX_free(pctx); + } + } -+ + /* Try to generate a key and test signing */ + if (kctx != NULL) { + if (EVP_PKEY_keygen_init(kctx) > 0 @@ -187,8 +186,8 @@ index f04e0a5..73395ce 100644 + static int EVP_Digest_loop(const char *mdname, ossl_unused int algindex, void *args) { - loopargs_t *tempargs = *(loopargs_t **) args; -@@ -2549,6 +2719,80 @@ int speed_main(int argc, char **argv) + loopargs_t *tempargs = *(loopargs_t **)args; +@@ -2614,6 +2783,80 @@ int speed_main(int argc, char **argv) memset(sigs_doit, 1, sizeof(sigs_doit)); do_sigs = 1; } @@ -269,22 +268,22 @@ index f04e0a5..73395ce 100644 for (i = 0; i < ALGOR_NUM; i++) if (doit[i]) pr_header++; -@@ -4217,17 +4461,27 @@ int speed_main(int argc, char **argv) +@@ -4277,18 +4520,27 @@ int speed_main(int argc, char **argv) /* no string after rsa permitted: */ if (strlen(sig_name) < MAX_ALGNAME_SUFFIX + 4 /* rsa+digit */ && sscanf(sig_name, "rsa%u%s", &bits, sfx) == 1) { -+ /* Pre-validate RSA key size support */ ++ /* Pre-validate RSA key size support */ + if (!is_rsa_key_supported(bits)) { + /* Provider doesn't support this key size - skip silently */ + goto sig_err_break; + } params[0] = OSSL_PARAM_construct_uint(OSSL_PKEY_PARAM_RSA_BITS, - &bits); + &bits); use_params = 1; } if (strncmp(sig_name, "dsa", 3) == 0) { -+ unsigned int dsa_bits = atoi(sig_name + 3); ++ unsigned int dsa_bits = atoi(sig_name + 3); + /* Pre-validate DSA key size support */ + if (!is_dsa_key_supported(dsa_bits)) { + /* Provider doesn't support this key size - skip silently */ @@ -294,11 +293,12 @@ index f04e0a5..73395ce 100644 if (ctx_params == NULL || EVP_PKEY_paramgen_init(ctx_params) <= 0 - || EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx_params, -- atoi(sig_name + 3)) <= 0 -+ || EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx_params, dsa_bits) <= 0 +- atoi(sig_name + 3)) +- <= 0 ++ || EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx_params, dsa_bits) <= 0 || EVP_PKEY_paramgen(ctx_params, &pkey_params) <= 0 || (sig_gen_ctx = EVP_PKEY_CTX_new(pkey_params, NULL)) == NULL || EVP_PKEY_keygen_init(sig_gen_ctx) <= 0) { -- -2.43.0 +2.45.4 diff --git a/SPECS/openssl/openssl.signatures.json b/SPECS/openssl/openssl.signatures.json index 5d493e57720..100a400d17b 100644 --- a/SPECS/openssl/openssl.signatures.json +++ b/SPECS/openssl/openssl.signatures.json @@ -5,6 +5,6 @@ "configuration-prefix.h": "11aba0dcfab381269e7e6ba1fdde1e4e8dfe51e39d8c7a2918f3b28a32cb98fd", "configuration-switch.h": "400439d7e8c551e7d5de8bfc648dcc0ddf6f4a7552750af4813449f68941b928", "genpatches": "9da7f988d4378adf499b1322e79f29e94c889c4bf10cd6e79e6991b673de2463", - "openssl-3.3.5.tar.gz": "9d62c00a5a6903740c8703f0e006257f429d565d3b91ac1a9bd4a4c700002e01" + "openssl-3.3.7.tar.gz": "4900be54e81c4dfe00bb1a10dad33fd8414833573c40d0e9e3274d4ed32e53a2" } } diff --git a/SPECS/openssl/openssl.spec b/SPECS/openssl/openssl.spec index 80b6d249d63..f88e8cf6c0d 100644 --- a/SPECS/openssl/openssl.spec +++ b/SPECS/openssl/openssl.spec @@ -8,8 +8,8 @@ Summary: Utilities from the general purpose cryptography library with TLS implementation Name: openssl -Version: 3.3.5 -Release: 6%{?dist} +Version: 3.3.7 +Release: 1%{?dist} Vendor: Microsoft Corporation Distribution: Azure Linux Source: https://github.com/openssl/openssl/releases/download/openssl-%{version}/openssl-%{version}.tar.gz @@ -66,24 +66,7 @@ Patch80: 0001-Replacing-deprecated-functions-with-NULL-or-highest.patch # algorithms that are used in the speed tests. This patch skips those tests. # If OpenSSL updates speed to be FIPS-tolerant, remove this patch. Patch82: filter-unsupported-algs-key-lengths-dynamically.patch -Patch100: 0001-Correct-handling-of-AEAD-encrypted-CMS-with-inadmiss.patch -Patch101: 0002-Some-comments-to-clarify-functions-usage.patch -Patch102: 0003-Test-for-handling-of-AEAD-encrypted-CMS-with-inadmis.patch -Patch103: 0001-ossl_quic_get_cipher_by_char-Add-a-NULL-guard-before.patch -Patch104: 0001-Check-the-received-uncompressed-certificate-length-t.patch -Patch105: 0001-Fix-heap-buffer-overflow-in-BIO_f_linebuffer.patch -Patch106: 0001-Fix-OCB-AES-NI-HW-stream-path-unauthenticated-unencr.patch -Patch107: 0001-Verify-ASN1-object-s-types-before-attempting-to-acce.patch -Patch108: 0001-Add-NULL-check-to-PKCS12_item_decrypt_d2i_ex.patch -Patch109: CVE-2025-69419.patch -Patch110: CVE-2026-22796.patch -Patch111: CVE-2026-31789.patch -Patch112: CVE-2026-28389.patch -Patch113: CVE-2026-28390.patch -Patch114: CVE-2026-28388.patch -Patch115: CVE-2026-31791.patch -Patch116: CVE-2026-31790.patch - +Patch100: CVE-2026-31791.patch License: Apache-2.0 URL: http://www.openssl.org/ @@ -380,6 +363,10 @@ install -m644 %{SOURCE9} \ %ldconfig_scriptlets libs %changelog +* Fri Apr 24 2026 Jyoti Kanase - 3.3.7-1 +- Upgrade to 3.3.7 +- remove unused patches + * Thu Apr 23 2026 Lynsey Rydberg - 3.3.5-6 - Rename FIPS provider config from fips_prov.cnf to fipsmodule.cnf to align with upstream OpenSSL. diff --git a/cgmanifest.json b/cgmanifest.json index 59e58525908..b4a4c729dc7 100644 --- a/cgmanifest.json +++ b/cgmanifest.json @@ -15713,8 +15713,8 @@ "type": "other", "other": { "name": "openssl", - "version": "3.3.5", - "downloadUrl": "https://github.com/openssl/openssl/releases/download/openssl-3.3.5/openssl-3.3.5.tar.gz" + "version": "3.3.7", + "downloadUrl": "https://github.com/openssl/openssl/releases/download/openssl-3.3.7/openssl-3.3.7.tar.gz" } } }, diff --git a/toolkit/resources/manifests/package/pkggen_core_aarch64.txt b/toolkit/resources/manifests/package/pkggen_core_aarch64.txt index 1b4f12be529..2fcc8dd4733 100644 --- a/toolkit/resources/manifests/package/pkggen_core_aarch64.txt +++ b/toolkit/resources/manifests/package/pkggen_core_aarch64.txt @@ -170,11 +170,11 @@ gtk-doc-1.33.2-1.azl3.noarch.rpm autoconf-2.72-2.azl3.noarch.rpm automake-1.16.5-2.azl3.noarch.rpm ocaml-srpm-macros-9-4.azl3.noarch.rpm -openssl-3.3.5-6.azl3.aarch64.rpm -openssl-devel-3.3.5-6.azl3.aarch64.rpm -openssl-libs-3.3.5-6.azl3.aarch64.rpm -openssl-perl-3.3.5-6.azl3.aarch64.rpm -openssl-static-3.3.5-6.azl3.aarch64.rpm +openssl-3.3.7-1.azl3.aarch64.rpm +openssl-devel-3.3.7-1.azl3.aarch64.rpm +openssl-libs-3.3.7-1.azl3.aarch64.rpm +openssl-perl-3.3.7-1.azl3.aarch64.rpm +openssl-static-3.3.7-1.azl3.aarch64.rpm libcap-2.69-15.azl3.aarch64.rpm libcap-devel-2.69-15.azl3.aarch64.rpm debugedit-5.0-2.azl3.aarch64.rpm diff --git a/toolkit/resources/manifests/package/pkggen_core_x86_64.txt b/toolkit/resources/manifests/package/pkggen_core_x86_64.txt index 5a9fe0b9279..2ad47d77dc3 100644 --- a/toolkit/resources/manifests/package/pkggen_core_x86_64.txt +++ b/toolkit/resources/manifests/package/pkggen_core_x86_64.txt @@ -170,11 +170,11 @@ gtk-doc-1.33.2-1.azl3.noarch.rpm autoconf-2.72-2.azl3.noarch.rpm automake-1.16.5-2.azl3.noarch.rpm ocaml-srpm-macros-9-4.azl3.noarch.rpm -openssl-3.3.5-6.azl3.x86_64.rpm -openssl-devel-3.3.5-6.azl3.x86_64.rpm -openssl-libs-3.3.5-6.azl3.x86_64.rpm -openssl-perl-3.3.5-6.azl3.x86_64.rpm -openssl-static-3.3.5-6.azl3.x86_64.rpm +openssl-3.3.7-1.azl3.x86_64.rpm +openssl-devel-3.3.7-1.azl3.x86_64.rpm +openssl-libs-3.3.7-1.azl3.x86_64.rpm +openssl-perl-3.3.7-1.azl3.x86_64.rpm +openssl-static-3.3.7-1.azl3.x86_64.rpm libcap-2.69-15.azl3.x86_64.rpm libcap-devel-2.69-15.azl3.x86_64.rpm debugedit-5.0-2.azl3.x86_64.rpm diff --git a/toolkit/resources/manifests/package/toolchain_aarch64.txt b/toolkit/resources/manifests/package/toolchain_aarch64.txt index 4ec0cf71611..2be23c885b5 100644 --- a/toolkit/resources/manifests/package/toolchain_aarch64.txt +++ b/toolkit/resources/manifests/package/toolchain_aarch64.txt @@ -287,12 +287,12 @@ npth-debuginfo-1.6-4.azl3.aarch64.rpm npth-devel-1.6-4.azl3.aarch64.rpm ntsysv-1.25-1.azl3.aarch64.rpm ocaml-srpm-macros-9-4.azl3.noarch.rpm -openssl-3.3.5-6.azl3.aarch64.rpm -openssl-debuginfo-3.3.5-6.azl3.aarch64.rpm -openssl-devel-3.3.5-6.azl3.aarch64.rpm -openssl-libs-3.3.5-6.azl3.aarch64.rpm -openssl-perl-3.3.5-6.azl3.aarch64.rpm -openssl-static-3.3.5-6.azl3.aarch64.rpm +openssl-3.3.7-1.azl3.aarch64.rpm +openssl-debuginfo-3.3.7-1.azl3.aarch64.rpm +openssl-devel-3.3.7-1.azl3.aarch64.rpm +openssl-libs-3.3.7-1.azl3.aarch64.rpm +openssl-perl-3.3.7-1.azl3.aarch64.rpm +openssl-static-3.3.7-1.azl3.aarch64.rpm p11-kit-0.25.0-1.azl3.aarch64.rpm p11-kit-debuginfo-0.25.0-1.azl3.aarch64.rpm p11-kit-devel-0.25.0-1.azl3.aarch64.rpm diff --git a/toolkit/resources/manifests/package/toolchain_x86_64.txt b/toolkit/resources/manifests/package/toolchain_x86_64.txt index d4fda2ce3a8..3720de636fd 100644 --- a/toolkit/resources/manifests/package/toolchain_x86_64.txt +++ b/toolkit/resources/manifests/package/toolchain_x86_64.txt @@ -295,12 +295,12 @@ npth-debuginfo-1.6-4.azl3.x86_64.rpm npth-devel-1.6-4.azl3.x86_64.rpm ntsysv-1.25-1.azl3.x86_64.rpm ocaml-srpm-macros-9-4.azl3.noarch.rpm -openssl-3.3.5-6.azl3.x86_64.rpm -openssl-debuginfo-3.3.5-6.azl3.x86_64.rpm -openssl-devel-3.3.5-6.azl3.x86_64.rpm -openssl-libs-3.3.5-6.azl3.x86_64.rpm -openssl-perl-3.3.5-6.azl3.x86_64.rpm -openssl-static-3.3.5-6.azl3.x86_64.rpm +openssl-3.3.7-1.azl3.x86_64.rpm +openssl-debuginfo-3.3.7-1.azl3.x86_64.rpm +openssl-devel-3.3.7-1.azl3.x86_64.rpm +openssl-libs-3.3.7-1.azl3.x86_64.rpm +openssl-perl-3.3.7-1.azl3.x86_64.rpm +openssl-static-3.3.7-1.azl3.x86_64.rpm p11-kit-0.25.0-1.azl3.x86_64.rpm p11-kit-debuginfo-0.25.0-1.azl3.x86_64.rpm p11-kit-devel-0.25.0-1.azl3.x86_64.rpm From cbd9b545bd038f8ad06cdb9c912735d002f81dcb Mon Sep 17 00:00:00 2001 From: jykanase Date: Wed, 13 May 2026 06:31:18 +0000 Subject: [PATCH 2/3] Fix-test-regressions --- .../Allow-NULL-buffer-with-0-bsize.patch | 87 +++++++++++++++++++ SPECS/openssl/openssl.spec | 1 + 2 files changed, 88 insertions(+) create mode 100644 SPECS/openssl/Allow-NULL-buffer-with-0-bsize.patch diff --git a/SPECS/openssl/Allow-NULL-buffer-with-0-bsize.patch b/SPECS/openssl/Allow-NULL-buffer-with-0-bsize.patch new file mode 100644 index 00000000000..6a17da4ecf3 --- /dev/null +++ b/SPECS/openssl/Allow-NULL-buffer-with-0-bsize.patch @@ -0,0 +1,87 @@ +From 0463cbf185680e66a3a8960f10cd33001377d28e Mon Sep 17 00:00:00 2001 +From: Tomas Mraz +Date: Wed, 8 Apr 2026 17:38:51 +0200 +Subject: [PATCH] OSSL_PARAM_BLD_push_octet_*(): Allow NULL buffer with 0 bsize + +Fixes #30728 + +Reviewed-by: Eugene Syromiatnikov +Reviewed-by: Shane Lontis +Reviewed-by: Paul Dale +MergeDate: Mon Apr 13 07:47:44 2026 +(Merged from https://github.com/openssl/openssl/pull/30730) + +Upstream Patch Reference: https://github.com/openssl/openssl/commit/0463cbf185680e66a3a8960f10cd33001377d28e.patch +--- + crypto/param_build.c | 6 +++--- + test/param_build_test.c | 10 ++++++++++ + 2 files changed, 13 insertions(+), 3 deletions(-) + +diff --git a/crypto/param_build.c b/crypto/param_build.c +index 4e90c58..d37b18c 100644 +--- a/crypto/param_build.c ++++ b/crypto/param_build.c +@@ -345,7 +345,7 @@ int OSSL_PARAM_BLD_push_utf8_ptr(OSSL_PARAM_BLD *bld, const char *key, + { + OSSL_PARAM_BLD_DEF *pd; + +- if (bld == NULL || key == NULL) { ++ if (bld == NULL || key == NULL || buf == NULL) { + ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } +@@ -365,7 +365,7 @@ int OSSL_PARAM_BLD_push_octet_string(OSSL_PARAM_BLD *bld, const char *key, + OSSL_PARAM_BLD_DEF *pd; + int secure; + +- if (bld == NULL || key == NULL || buf == NULL) { ++ if (bld == NULL || key == NULL || (buf == NULL && bsize != 0)) { + ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } +@@ -383,7 +383,7 @@ int OSSL_PARAM_BLD_push_octet_ptr(OSSL_PARAM_BLD *bld, const char *key, + { + OSSL_PARAM_BLD_DEF *pd; + +- if (bld == NULL || key == NULL) { ++ if (bld == NULL || key == NULL || (buf == NULL && bsize != 0)) { + ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } +diff --git a/test/param_build_test.c b/test/param_build_test.c +index 3b90a5e..bac0afc 100644 +--- a/test/param_build_test.c ++++ b/test/param_build_test.c +@@ -117,8 +117,12 @@ static int template_public_test(int tstid) + || !TEST_true(OSSL_PARAM_BLD_push_BN(bld, "negativebignumber", nbn)) + || !TEST_true(OSSL_PARAM_BLD_push_utf8_string(bld, "utf8_s", "foo", + sizeof("foo"))) ++ || !TEST_true(OSSL_PARAM_BLD_push_octet_string(bld, "octet_s", NULL, ++ 0)) + || !TEST_true(OSSL_PARAM_BLD_push_utf8_ptr(bld, "utf8_p", "bar-boom", + 0)) ++ || !TEST_true(OSSL_PARAM_BLD_push_octet_ptr(bld, "octet_p", NULL, ++ 0)) + || !TEST_true(OSSL_PARAM_BLD_push_int(bld, "i", -6)) + || !TEST_ptr(params_blt = OSSL_PARAM_BLD_to_param(bld))) + goto err; +@@ -189,10 +193,16 @@ static int template_public_test(int tstid) + || !TEST_str_eq(p->data, "foo") + || !TEST_true(OSSL_PARAM_get_utf8_string(p, &utf, 0)) + || !TEST_str_eq(utf, "foo") ++ /* Check NULL octet string */ ++ || !TEST_ptr(p = OSSL_PARAM_locate(params, "octet_s")) ++ || !TEST_size_t_eq(p->data_size, 0) + /* Check UTF8 pointer */ + || !TEST_ptr(p = OSSL_PARAM_locate(params, "utf8_p")) + || !TEST_true(OSSL_PARAM_get_utf8_ptr(p, &cutf)) + || !TEST_str_eq(cutf, "bar-boom") ++ /* Check NULL octet ptr */ ++ || !TEST_ptr(p = OSSL_PARAM_locate(params, "octet_p")) ++ || !TEST_size_t_eq(p->data_size, 0) + /* Check BN (zero BN becomes unsigned integer) */ + || !TEST_ptr(p = OSSL_PARAM_locate(params, "zeronumber")) + || !TEST_str_eq(p->key, "zeronumber") +-- +2.45.4 + diff --git a/SPECS/openssl/openssl.spec b/SPECS/openssl/openssl.spec index f88e8cf6c0d..6bacfea3e86 100644 --- a/SPECS/openssl/openssl.spec +++ b/SPECS/openssl/openssl.spec @@ -66,6 +66,7 @@ Patch80: 0001-Replacing-deprecated-functions-with-NULL-or-highest.patch # algorithms that are used in the speed tests. This patch skips those tests. # If OpenSSL updates speed to be FIPS-tolerant, remove this patch. Patch82: filter-unsupported-algs-key-lengths-dynamically.patch +Patch83: Allow-NULL-buffer-with-0-bsize.patch Patch100: CVE-2026-31791.patch License: Apache-2.0 From 546b725a206f220a6246e3a5cde7e5c9bf49a665 Mon Sep 17 00:00:00 2001 From: jykanase Date: Tue, 9 Jun 2026 03:56:27 +0000 Subject: [PATCH 3/3] rebase --- SPECS/openssl/openssl.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPECS/openssl/openssl.spec b/SPECS/openssl/openssl.spec index 6bacfea3e86..5b55dac990a 100644 --- a/SPECS/openssl/openssl.spec +++ b/SPECS/openssl/openssl.spec @@ -366,7 +366,7 @@ install -m644 %{SOURCE9} \ %changelog * Fri Apr 24 2026 Jyoti Kanase - 3.3.7-1 - Upgrade to 3.3.7 -- remove unused patches +- Remove unused patches * Thu Apr 23 2026 Lynsey Rydberg - 3.3.5-6 - Rename FIPS provider config from fips_prov.cnf to fipsmodule.cnf to align with upstream OpenSSL.