diff options
author | Daniel NĂ©ri <dne+alpine@mayonnaise.net> | 2024-09-03 19:33:54 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2024-09-03 19:12:55 +0000 |
commit | 303ffd690f0ec9555e4645bb30fb58f675be9129 (patch) | |
tree | 9b8ce6df59fb6cca8644904f19d88c50f0e95e07 /main | |
parent | ad646b56ea565ae0dad4ea31e6a1870045ca9290 (diff) | |
download | aports-303ffd690f0ec9555e4645bb30fb58f675be9129.zip |
main/openssl: security upgrade to 3.3.2
Fix CVE-2024-6119: Applications performing certificate name
checks (e.g., TLS clients checking server certificates) may attempt to
read an invalid memory address resulting in abnormal termination of
the application process.
- https://openssl-library.org/news/secadv/20240903.txt
Diffstat (limited to 'main')
-rw-r--r-- | main/openssl/APKBUILD | 18 | ||||
-rw-r--r-- | main/openssl/CVE-2024-5535.patch | 108 | ||||
-rw-r--r-- | main/openssl/fix-fips-24661.patch | 53 | ||||
-rw-r--r-- | main/openssl/fix-memleak.patch | 31 | ||||
-rw-r--r-- | main/openssl/fix-tserver.patch | 31 |
5 files changed, 6 insertions, 235 deletions
diff --git a/main/openssl/APKBUILD b/main/openssl/APKBUILD index b237561dad3..7e7b0d399de 100644 --- a/main/openssl/APKBUILD +++ b/main/openssl/APKBUILD @@ -2,9 +2,9 @@ # Contributor: Timo Teras <timo.teras@iki.fi> # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=openssl -pkgver=3.3.1 +pkgver=3.3.2 _abiver=${pkgver%.*.*} -pkgrel=3 +pkgrel=0 pkgdesc="Toolkit for Transport Layer Security (TLS)" url="https://www.openssl.org/" arch="all" @@ -15,17 +15,15 @@ makedepends_host="linux-headers" makedepends="$makedepends_host $makedepends_build" subpackages="$pkgname-dbg $pkgname-libs-static $pkgname-dev $pkgname-doc $pkgname-misc::noarch libcrypto$_abiver:_libcrypto libssl$_abiver:_libssl" -source="https://www.openssl.org/source/openssl-$pkgver.tar.gz - CVE-2024-5535.patch +source="https://github.com/openssl/openssl/releases/download/openssl-$pkgver/openssl-$pkgver.tar.gz auxv.patch - fix-memleak.patch - fix-tserver.patch man-section.patch - fix-fips-24661.patch " builddir="$srcdir/openssl-$pkgver" # secfixes: +# 3.3.2-r0: +# - CVE-2024-6119 # 3.3.1-r1: # - CVE-2024-5535 # 3.3.0-r3: @@ -238,11 +236,7 @@ _libssl() { } sha512sums=" -d3682a5ae0721748c6b9ec2f1b74d2b1ba61ee6e4c0d42387b5037a56ef34312833b6abb522d19400b45d807dd65cc834156f5e891cb07fbaf69fcf67e1c595d openssl-3.3.1.tar.gz -a208a2b43cb7a26367d380b4f68832392f38102fe811a3ec5772a2a69197c6441d48446db004aad891995f9b3cab7d1a96044b316e1c823596987fe1ca259d95 CVE-2024-5535.patch +5ae47bf1aed2740a33ba5df7dc7345a6738aa6bfa3c9c4de5e51742485e24b25192988d7a2c1b8201ef70056ad8abd0ca78b3d55abe24c0b0373d83b47ed9b74 openssl-3.3.2.tar.gz 63f7b46f11c222d2c49200f252937516cbca0bfeb475f008a18ad1abeb1d73110ba7a0506898353c8c6c760c5cb446215da7c83a420afa57e0d73f7fb8c3af7a auxv.patch -489f76eb9d96bee98182094dc10e8148f412876d9a6a3cbc230a0f1266c1f1972a401e10f7b4bad6cdfad02fbb9faffee457da3711b9e136b871f7e33aefb685 fix-memleak.patch -8e3fc2f77294cc75e74b4210be37f2b277ac0612baee4cbc5e709b96af5cc37c09ceb3fa0103e3cff70e163bc3b67320a3331cd9309086f22c7cc2ca7a0dc985 fix-tserver.patch 8c44e990fe8a820f649631b9f81cf28225b7516065169a7f68e2dd7c067b30df9b2c6cb88fa826afbc9fcdaf156360aabf7c498d2d9ed452968815b12b004809 man-section.patch -4504118a65bfc93532d1b47950503e92e97ab294c7a0e1bf19e5adf2adf456d3a08ef15cf945cf8ed3dfc1d9f35893dde39c212de082bc9f5cef7271bcfc2007 fix-fips-24661.patch " diff --git a/main/openssl/CVE-2024-5535.patch b/main/openssl/CVE-2024-5535.patch deleted file mode 100644 index 2d0f822b25e..00000000000 --- a/main/openssl/CVE-2024-5535.patch +++ /dev/null @@ -1,108 +0,0 @@ -From e86ac436f0bd54d4517745483e2315650fae7b2c Mon Sep 17 00:00:00 2001 -From: Matt Caswell <matt@openssl.org> -Date: Fri, 31 May 2024 11:14:33 +0100 -Subject: [PATCH] Fix SSL_select_next_proto - -Ensure that the provided client list is non-NULL and starts with a valid -entry. When called from the ALPN callback the client list should already -have been validated by OpenSSL so this should not cause a problem. When -called from the NPN callback the client list is locally configured and -will not have already been validated. Therefore SSL_select_next_proto -should not assume that it is correctly formatted. - -We implement stricter checking of the client protocol list. We also do the -same for the server list while we are about it. - -CVE-2024-5535 - -Reviewed-by: Tomas Mraz <tomas@openssl.org> -Reviewed-by: Neil Horman <nhorman@openssl.org> -(Merged from https://github.com/openssl/openssl/pull/24716) - -(cherry picked from commit 2ebbe2d7ca8551c4cb5fbb391ab9af411708090e) ---- - ssl/ssl_lib.c | 63 ++++++++++++++++++++++++++++++++------------------- - 1 file changed, 40 insertions(+), 23 deletions(-) - -diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c -index 5ec6ac4b63dc5..4c20ac4bf1fe7 100644 ---- a/ssl/ssl_lib.c -+++ b/ssl/ssl_lib.c -@@ -3530,37 +3530,54 @@ int SSL_select_next_proto(unsigned char **out, unsigned char *outlen, - unsigned int server_len, - const unsigned char *client, unsigned int client_len) - { -- unsigned int i, j; -- const unsigned char *result; -- int status = OPENSSL_NPN_UNSUPPORTED; -+ PACKET cpkt, csubpkt, spkt, ssubpkt; -+ -+ if (!PACKET_buf_init(&cpkt, client, client_len) -+ || !PACKET_get_length_prefixed_1(&cpkt, &csubpkt) -+ || PACKET_remaining(&csubpkt) == 0) { -+ *out = NULL; -+ *outlen = 0; -+ return OPENSSL_NPN_NO_OVERLAP; -+ } -+ -+ /* -+ * Set the default opportunistic protocol. Will be overwritten if we find -+ * a match. -+ */ -+ *out = (unsigned char *)PACKET_data(&csubpkt); -+ *outlen = (unsigned char)PACKET_remaining(&csubpkt); - - /* - * For each protocol in server preference order, see if we support it. - */ -- for (i = 0; i < server_len;) { -- for (j = 0; j < client_len;) { -- if (server[i] == client[j] && -- memcmp(&server[i + 1], &client[j + 1], server[i]) == 0) { -- /* We found a match */ -- result = &server[i]; -- status = OPENSSL_NPN_NEGOTIATED; -- goto found; -+ if (PACKET_buf_init(&spkt, server, server_len)) { -+ while (PACKET_get_length_prefixed_1(&spkt, &ssubpkt)) { -+ if (PACKET_remaining(&ssubpkt) == 0) -+ continue; /* Invalid - ignore it */ -+ if (PACKET_buf_init(&cpkt, client, client_len)) { -+ while (PACKET_get_length_prefixed_1(&cpkt, &csubpkt)) { -+ if (PACKET_equal(&csubpkt, PACKET_data(&ssubpkt), -+ PACKET_remaining(&ssubpkt))) { -+ /* We found a match */ -+ *out = (unsigned char *)PACKET_data(&ssubpkt); -+ *outlen = (unsigned char)PACKET_remaining(&ssubpkt); -+ return OPENSSL_NPN_NEGOTIATED; -+ } -+ } -+ /* Ignore spurious trailing bytes in the client list */ -+ } else { -+ /* This should never happen */ -+ return OPENSSL_NPN_NO_OVERLAP; - } -- j += client[j]; -- j++; - } -- i += server[i]; -- i++; -+ /* Ignore spurious trailing bytes in the server list */ - } - -- /* There's no overlap between our protocols and the server's list. */ -- result = client; -- status = OPENSSL_NPN_NO_OVERLAP; -- -- found: -- *out = (unsigned char *)result + 1; -- *outlen = result[0]; -- return status; -+ /* -+ * There's no overlap between our protocols and the server's list. We use -+ * the default opportunistic protocol selected earlier -+ */ -+ return OPENSSL_NPN_NO_OVERLAP; - } - - #ifndef OPENSSL_NO_NEXTPROTONEG diff --git a/main/openssl/fix-fips-24661.patch b/main/openssl/fix-fips-24661.patch deleted file mode 100644 index 9be663304e3..00000000000 --- a/main/openssl/fix-fips-24661.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 185da370be3b6284c4ba96471045745a140cb2cf Mon Sep 17 00:00:00 2001 -From: Tomas Mraz <tomas@openssl.org> -Date: Mon, 17 Jun 2024 16:48:26 +0200 -Subject: [PATCH] Fix regression of EVP_PKEY_CTX_add1_hkdf_info() with older - providers - -If there is no get_ctx_params() implemented in the key exchange -provider implementation the fallback will not work. Instead -check the gettable_ctx_params() to see if the fallback should be -performed. - -Fixes #24611 ---- - crypto/evp/pmeth_lib.c | 11 +++++++++-- - 1 file changed, 9 insertions(+), 2 deletions(-) - -diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c -index 0a561323f166e..71485c949cefd 100644 ---- a/crypto/evp/pmeth_lib.c -+++ b/crypto/evp/pmeth_lib.c -@@ -1008,6 +1008,7 @@ static int evp_pkey_ctx_add1_octet_string(EVP_PKEY_CTX *ctx, int fallback, - int datalen) - { - OSSL_PARAM os_params[2]; -+ const OSSL_PARAM *gettables; - unsigned char *info = NULL; - size_t info_len = 0; - size_t info_alloc = 0; -@@ -1031,6 +1032,12 @@ static int evp_pkey_ctx_add1_octet_string(EVP_PKEY_CTX *ctx, int fallback, - return 1; - } - -+ /* Check for older provider that doesn't support getting this parameter */ -+ gettables = EVP_PKEY_CTX_gettable_params(ctx); -+ if (gettables == NULL || OSSL_PARAM_locate_const(gettables, param) == NULL) -+ return evp_pkey_ctx_set1_octet_string(ctx, fallback, param, op, ctrl, -+ data, datalen); -+ - /* Get the original value length */ - os_params[0] = OSSL_PARAM_construct_octet_string(param, NULL, 0); - os_params[1] = OSSL_PARAM_construct_end(); -@@ -1038,9 +1045,9 @@ static int evp_pkey_ctx_add1_octet_string(EVP_PKEY_CTX *ctx, int fallback, - if (!EVP_PKEY_CTX_get_params(ctx, os_params)) - return 0; - -- /* Older provider that doesn't support getting this parameter */ -+ /* This should not happen but check to be sure. */ - if (os_params[0].return_size == OSSL_PARAM_UNMODIFIED) -- return evp_pkey_ctx_set1_octet_string(ctx, fallback, param, op, ctrl, data, datalen); -+ return 0; - - info_alloc = os_params[0].return_size + datalen; - if (info_alloc == 0) diff --git a/main/openssl/fix-memleak.patch b/main/openssl/fix-memleak.patch deleted file mode 100644 index db5a2eb08a3..00000000000 --- a/main/openssl/fix-memleak.patch +++ /dev/null @@ -1,31 +0,0 @@ -From fbd6609bb21b125c9454d07c484d166a33b4815b Mon Sep 17 00:00:00 2001 -From: sgzmd <sigizmund@gmail.com> -Date: Tue, 25 Jun 2024 15:53:32 +0100 -Subject: [PATCH] Free appname if it was set after initializing crypto. - -Fixes #24729 - -CLA: trivial - -Reviewed-by: Neil Horman <nhorman@openssl.org> -Reviewed-by: Paul Dale <ppzgs1@gmail.com> -Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> -Reviewed-by: Tomas Mraz <tomas@openssl.org> -(Merged from https://github.com/openssl/openssl/pull/24730) ---- - crypto/conf/conf_sap.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/crypto/conf/conf_sap.c b/crypto/conf/conf_sap.c -index 3019bcf31af81..bfe3a5f6f4d5e 100644 ---- a/crypto/conf/conf_sap.c -+++ b/crypto/conf/conf_sap.c -@@ -38,6 +38,8 @@ void OPENSSL_config(const char *appname) - settings.appname = strdup(appname); - settings.flags = DEFAULT_CONF_MFLAGS; - OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, &settings); -+ -+ free(settings.appname); - } - #endif - diff --git a/main/openssl/fix-tserver.patch b/main/openssl/fix-tserver.patch deleted file mode 100644 index aebe2f01fe1..00000000000 --- a/main/openssl/fix-tserver.patch +++ /dev/null @@ -1,31 +0,0 @@ -From fc8ff75814767d6c55ea78d05adc72cd346d0f0a Mon Sep 17 00:00:00 2001 -From: Matt Caswell <matt@openssl.org> -Date: Fri, 31 May 2024 11:22:13 +0100 -Subject: [PATCH] Use correctly formatted ALPN data in tserver - -The QUIC test server was using incorrectly formatted ALPN data. With the -previous implementation of SSL_select_next_proto this went unnoticed. With -the new stricter implemenation it was failing. - -Follow on from CVE-2024-5535 - -Reviewed-by: Tomas Mraz <tomas@openssl.org> -Reviewed-by: Neil Horman <nhorman@openssl.org> -(Merged from https://github.com/openssl/openssl/pull/24716) ---- - ssl/quic/quic_tserver.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ssl/quic/quic_tserver.c b/ssl/quic/quic_tserver.c -index b9de60aea15fc..4f30eb14cec8d 100644 ---- a/ssl/quic/quic_tserver.c -+++ b/ssl/quic/quic_tserver.c -@@ -63,7 +63,7 @@ static int alpn_select_cb(SSL *ssl, const unsigned char **out, - - if (srv->args.alpn == NULL) { - alpn = alpndeflt; -- alpnlen = sizeof(alpn); -+ alpnlen = sizeof(alpndeflt); - } else { - alpn = srv->args.alpn; - alpnlen = srv->args.alpnlen; |