diff --git a/security/openssl31-quictls/Makefile b/security/openssl31-quictls/Makefile index 11fd397b7d0a..8873c30de3ee 100644 --- a/security/openssl31-quictls/Makefile +++ b/security/openssl31-quictls/Makefile @@ -1,7 +1,6 @@ PORTNAME= openssl DISTVERSIONPREFIX= ${PORTNAME}- -DISTVERSION= 3.1.5 -PORTREVISION= 5 +DISTVERSION= 3.1.6 DISTVERSIONSUFFIX= -quic1 CATEGORIES= security devel PKGNAMESUFFIX= 31-quictls diff --git a/security/openssl31-quictls/distinfo b/security/openssl31-quictls/distinfo index ceac8ac801df..492ba36cab9c 100644 --- a/security/openssl31-quictls/distinfo +++ b/security/openssl31-quictls/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1710593356 -SHA256 (quictls-openssl-openssl-3.1.5-quic1_GH0.tar.gz) = 928a0c484fca5a5b9ae484e7b14e6691e946220d77d86ac4031cbb408655b644 -SIZE (quictls-openssl-openssl-3.1.5-quic1_GH0.tar.gz) = 15826997 +TIMESTAMP = 1725185496 +SHA256 (quictls-openssl-openssl-3.1.6-quic1_GH0.tar.gz) = 9e04f7fa98549a1c2d96b2d2299f4c32e6519958ca902d9ca9dd181337965d2e +SIZE (quictls-openssl-openssl-3.1.6-quic1_GH0.tar.gz) = 15844400 diff --git a/security/openssl31-quictls/files/patch-CVE-2024-2511 b/security/openssl31-quictls/files/patch-CVE-2024-2511 deleted file mode 100644 index ac88f50f791c..000000000000 --- a/security/openssl31-quictls/files/patch-CVE-2024-2511 +++ /dev/null @@ -1,116 +0,0 @@ -From 7e4d731b1c07201ad9374c1cd9ac5263bdf35bce Mon Sep 17 00:00:00 2001 -From: Matt Caswell -Date: Tue, 5 Mar 2024 15:43:53 +0000 -Subject: [PATCH] Fix unconstrained session cache growth in TLSv1.3 - -In TLSv1.3 we create a new session object for each ticket that we send. -We do this by duplicating the original session. If SSL_OP_NO_TICKET is in -use then the new session will be added to the session cache. However, if -early data is not in use (and therefore anti-replay protection is being -used), then multiple threads could be resuming from the same session -simultaneously. If this happens and a problem occurs on one of the threads, -then the original session object could be marked as not_resumable. When we -duplicate the session object this not_resumable status gets copied into the -new session object. The new session object is then added to the session -cache even though it is not_resumable. - -Subsequently, another bug means that the session_id_length is set to 0 for -sessions that are marked as not_resumable - even though that session is -still in the cache. Once this happens the session can never be removed from -the cache. When that object gets to be the session cache tail object the -cache never shrinks again and grows indefinitely. - -CVE-2024-2511 - -Reviewed-by: Neil Horman -Reviewed-by: Tomas Mraz -(Merged from https://github.com/openssl/openssl/pull/24044) ---- - ssl/ssl_lib.c | 5 +++-- - ssl/ssl_sess.c | 28 ++++++++++++++++++++++------ - ssl/statem/statem_srvr.c | 5 ++--- - 3 files changed, 27 insertions(+), 11 deletions(-) - -diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c -index b5cc4af2f0302..e747b7f90aa71 100644 ---- ssl/ssl_lib.c.orig -+++ ssl/ssl_lib.c -@@ -3737,9 +3737,10 @@ void ssl_update_cache(SSL *s, int mode) - - /* - * If the session_id_length is 0, we are not supposed to cache it, and it -- * would be rather hard to do anyway :-) -+ * would be rather hard to do anyway :-). Also if the session has already -+ * been marked as not_resumable we should not cache it for later reuse. - */ -- if (s->session->session_id_length == 0) -+ if (s->session->session_id_length == 0 || s->session->not_resumable) - return; - - /* -diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c -index bf84e792251b8..241cf43c46296 100644 ---- ssl/ssl_sess.c.orig -+++ ssl/ssl_sess.c -@@ -154,16 +154,11 @@ SSL_SESSION *SSL_SESSION_new(void) - return ss; - } - --SSL_SESSION *SSL_SESSION_dup(const SSL_SESSION *src) --{ -- return ssl_session_dup(src, 1); --} -- - /* - * Create a new SSL_SESSION and duplicate the contents of |src| into it. If - * ticket == 0 then no ticket information is duplicated, otherwise it is. - */ --SSL_SESSION *ssl_session_dup(const SSL_SESSION *src, int ticket) -+static SSL_SESSION *ssl_session_dup_intern(const SSL_SESSION *src, int ticket) - { - SSL_SESSION *dest; - -@@ -287,6 +282,27 @@ SSL_SESSION *ssl_session_dup(const SSL_SESSION *src, int ticket) - return NULL; - } - -+SSL_SESSION *SSL_SESSION_dup(const SSL_SESSION *src) -+{ -+ return ssl_session_dup_intern(src, 1); -+} -+ -+/* -+ * Used internally when duplicating a session which might be already shared. -+ * We will have resumed the original session. Subsequently we might have marked -+ * it as non-resumable (e.g. in another thread) - but this copy should be ok to -+ * resume from. -+ */ -+SSL_SESSION *ssl_session_dup(const SSL_SESSION *src, int ticket) -+{ -+ SSL_SESSION *sess = ssl_session_dup_intern(src, ticket); -+ -+ if (sess != NULL) -+ sess->not_resumable = 0; -+ -+ return sess; -+} -+ - const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s, unsigned int *len) - { - if (len) -diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c -index 5d59d53563ed8..8e493176f658e 100644 ---- ssl/statem/statem_srvr.c.orig -+++ ssl/statem/statem_srvr.c -@@ -2338,9 +2338,8 @@ int tls_construct_server_hello(SSL *s, WPACKET *pkt) - * so the following won't overwrite an ID that we're supposed - * to send back. - */ -- if (s->session->not_resumable || -- (!(s->ctx->session_cache_mode & SSL_SESS_CACHE_SERVER) -- && !s->hit)) -+ if (!(s->ctx->session_cache_mode & SSL_SESS_CACHE_SERVER) -+ && !s->hit) - s->session->session_id_length = 0; - - if (usetls13) { diff --git a/security/openssl31-quictls/files/patch-CVE-2024-4603 b/security/openssl31-quictls/files/patch-CVE-2024-4603 deleted file mode 100644 index 2994ec6c13a6..000000000000 --- a/security/openssl31-quictls/files/patch-CVE-2024-4603 +++ /dev/null @@ -1,172 +0,0 @@ -From 9c39b3858091c152f52513c066ff2c5a47969f0d Mon Sep 17 00:00:00 2001 -From: Tomas Mraz -Date: Wed, 8 May 2024 15:23:45 +0200 -Subject: [PATCH] Check DSA parameters for excessive sizes before validating - -This avoids overly long computation of various validation -checks. - -Fixes CVE-2024-4603 - -Reviewed-by: Paul Dale -Reviewed-by: Matt Caswell -Reviewed-by: Neil Horman -Reviewed-by: Shane Lontis -(Merged from https://github.com/openssl/openssl/pull/24346) - -(cherry picked from commit 85ccbab216da245cf9a6503dd327072f21950d9b) ---- - CHANGES.md | 17 ++++++ - crypto/dsa/dsa_check.c | 44 ++++++++++++-- - .../invalid/p10240_q256_too_big.pem | 57 +++++++++++++++++++ - 3 files changed, 114 insertions(+), 4 deletions(-) - create mode 100644 test/recipes/15-test_dsaparam_data/invalid/p10240_q256_too_big.pem - -diff --git a/crypto/dsa/dsa_check.c b/crypto/dsa/dsa_check.c -index fb0e9129a2956..122449a7bf087 100644 ---- crypto/dsa/dsa_check.c.orig -+++ crypto/dsa/dsa_check.c -@@ -19,8 +19,34 @@ - #include "dsa_local.h" - #include "crypto/dsa.h" - -+static int dsa_precheck_params(const DSA *dsa, int *ret) -+{ -+ if (dsa->params.p == NULL || dsa->params.q == NULL) { -+ ERR_raise(ERR_LIB_DSA, DSA_R_BAD_FFC_PARAMETERS); -+ *ret = FFC_CHECK_INVALID_PQ; -+ return 0; -+ } -+ -+ if (BN_num_bits(dsa->params.p) > OPENSSL_DSA_MAX_MODULUS_BITS) { -+ ERR_raise(ERR_LIB_DSA, DSA_R_MODULUS_TOO_LARGE); -+ *ret = FFC_CHECK_INVALID_PQ; -+ return 0; -+ } -+ -+ if (BN_num_bits(dsa->params.q) >= BN_num_bits(dsa->params.p)) { -+ ERR_raise(ERR_LIB_DSA, DSA_R_BAD_Q_VALUE); -+ *ret = FFC_CHECK_INVALID_PQ; -+ return 0; -+ } -+ -+ return 1; -+} -+ - int ossl_dsa_check_params(const DSA *dsa, int checktype, int *ret) - { -+ if (!dsa_precheck_params(dsa, ret)) -+ return 0; -+ - if (checktype == OSSL_KEYMGMT_VALIDATE_QUICK_CHECK) - return ossl_ffc_params_simple_validate(dsa->libctx, &dsa->params, - FFC_PARAM_TYPE_DSA, ret); -@@ -39,6 +65,9 @@ int ossl_dsa_check_params(const DSA *dsa, int checktype, int *ret) - */ - int ossl_dsa_check_pub_key(const DSA *dsa, const BIGNUM *pub_key, int *ret) - { -+ if (!dsa_precheck_params(dsa, ret)) -+ return 0; -+ - return ossl_ffc_validate_public_key(&dsa->params, pub_key, ret) - && *ret == 0; - } -@@ -50,6 +79,9 @@ int ossl_dsa_check_pub_key(const DSA *dsa, const BIGNUM *pub_key, int *ret) - */ - int ossl_dsa_check_pub_key_partial(const DSA *dsa, const BIGNUM *pub_key, int *ret) - { -+ if (!dsa_precheck_params(dsa, ret)) -+ return 0; -+ - return ossl_ffc_validate_public_key_partial(&dsa->params, pub_key, ret) - && *ret == 0; - } -@@ -58,8 +90,10 @@ int ossl_dsa_check_priv_key(const DSA *dsa, const BIGNUM *priv_key, int *ret) - { - *ret = 0; - -- return (dsa->params.q != NULL -- && ossl_ffc_validate_private_key(dsa->params.q, priv_key, ret)); -+ if (!dsa_precheck_params(dsa, ret)) -+ return 0; -+ -+ return ossl_ffc_validate_private_key(dsa->params.q, priv_key, ret); - } - - /* -@@ -72,8 +106,10 @@ int ossl_dsa_check_pairwise(const DSA *dsa) - BN_CTX *ctx = NULL; - BIGNUM *pub_key = NULL; - -- if (dsa->params.p == NULL -- || dsa->params.g == NULL -+ if (!dsa_precheck_params(dsa, &ret)) -+ return 0; -+ -+ if (dsa->params.g == NULL - || dsa->priv_key == NULL - || dsa->pub_key == NULL) - return 0; -diff --git a/test/recipes/15-test_dsaparam_data/invalid/p10240_q256_too_big.pem b/test/recipes/15-test_dsaparam_data/invalid/p10240_q256_too_big.pem -new file mode 100644 -index 0000000000000..e85e2953b7a24 ---- /dev/null -+++ test/recipes/15-test_dsaparam_data/invalid/p10240_q256_too_big.pem -@@ -0,0 +1,57 @@ -+-----BEGIN DSA PARAMETERS----- -+MIIKLAKCBQEAym47LzPFZdbz16WvjczLKuzLtsP8yRk/exxL4bBthJhP1qOwctja -+p1586SF7gDxCMn7yWVEYdfRbFefGoq0gj1XOE917XqlbnkmZhMgxut2KbNJo/xil -+XNFUjGvKs3F413U9rAodC8f07cWHP1iTcWL+vPe6u2yilK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xnGAiUcETU/jJJt9QombiuszBlYGQ5d -+ELOSm/eQSRARV9zNSt5jaQlMSjMBqenIEM09BzYqa7jDwqoztFxNdO8bcuQPuKwa -+4z3bBZ1yYm63WFdNbQqqGEwc0OYmqg1raJ0zltgHyjFyw8IGu4g/wETs+nVQcH7D -+vKuje86bePD6kD/LH3wmkA== -+-----END DSA PARAMETERS----- diff --git a/security/openssl31-quictls/files/patch-CVE-2024-4741 b/security/openssl31-quictls/files/patch-CVE-2024-4741 deleted file mode 100644 index 75fcc6311d2c..000000000000 --- a/security/openssl31-quictls/files/patch-CVE-2024-4741 +++ /dev/null @@ -1,67 +0,0 @@ -From 704f725b96aa373ee45ecfb23f6abfe8be8d9177 Mon Sep 17 00:00:00 2001 -From: Watson Ladd -Date: Wed, 24 Apr 2024 11:26:56 +0100 -Subject: [PATCH] Only free the read buffers if we're not using them - -If we're part way through processing a record, or the application has -not released all the records then we should not free our buffer because -they are still needed. - -CVE-2024-4741 - -Reviewed-by: Tomas Mraz -Reviewed-by: Neil Horman -Reviewed-by: Matt Caswell -(Merged from https://github.com/openssl/openssl/pull/24395) ---- - ssl/record/rec_layer_s3.c | 9 +++++++++ - ssl/record/record.h | 1 + - ssl/ssl_lib.c | 3 +++ - 3 files changed, 13 insertions(+) - -diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c -index 4bcffcc41e364..1569997bea2d3 100644 ---- ssl/record/rec_layer_s3.c.orig -+++ ssl/record/rec_layer_s3.c -@@ -81,6 +81,15 @@ int RECORD_LAYER_read_pending(const RECORD_LAYER *rl) - return SSL3_BUFFER_get_left(&rl->rbuf) != 0; - } - -+int RECORD_LAYER_data_present(const RECORD_LAYER *rl) -+{ -+ if (rl->rstate == SSL_ST_READ_BODY) -+ return 1; -+ if (RECORD_LAYER_processed_read_pending(rl)) -+ return 1; -+ return 0; -+} -+ - /* Checks if we have decrypted unread record data pending */ - int RECORD_LAYER_processed_read_pending(const RECORD_LAYER *rl) - { -diff --git a/ssl/record/record.h b/ssl/record/record.h -index 234656bf93942..b60f71c8cb23b 100644 ---- ssl/record/record.h.orig -+++ ssl/record/record.h -@@ -205,6 +205,7 @@ void RECORD_LAYER_release(RECORD_LAYER *rl); - int RECORD_LAYER_read_pending(const RECORD_LAYER *rl); - int RECORD_LAYER_processed_read_pending(const RECORD_LAYER *rl); - int RECORD_LAYER_write_pending(const RECORD_LAYER *rl); -+int RECORD_LAYER_data_present(const RECORD_LAYER *rl); - void RECORD_LAYER_reset_read_sequence(RECORD_LAYER *rl); - void RECORD_LAYER_reset_write_sequence(RECORD_LAYER *rl); - int RECORD_LAYER_is_sslv2_record(RECORD_LAYER *rl); -diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c -index e747b7f90aa71..9088223b9f6bb 100644 ---- ssl/ssl_lib.c.orig -+++ ssl/ssl_lib.c -@@ -5493,6 +5493,9 @@ int SSL_free_buffers(SSL *ssl) - if (RECORD_LAYER_read_pending(rl) || RECORD_LAYER_write_pending(rl)) - return 0; - -+ if (RECORD_LAYER_data_present(rl)) -+ return 0; -+ - RECORD_LAYER_release(rl); - return 1; - }