From nobody Mon Jul 31 20:49:51 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RF9Ng1DWFz4pTNn; Mon, 31 Jul 2023 20:49:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RF9NK55cgz4FPT; Mon, 31 Jul 2023 20:49:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690836593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HHGuaY4L7wIOzqjBXXvCIk66RDwHJb4dgzajjMrjydQ=; b=CkxjmLc3ECxiCCkfLKB3rEq9Pk1TPOVzQMcN6ArTQlwx7WJaU4rbEl6ZeBupR6WA6vcttv XY5tDPmiWY/XeKQe//Ff3jhou2E3SEW0P9U4JxD2a5sLQyn7EoMM9HI8EWaRIFRqAA/Rra tTsPcFw9wRv1g7RlJP25ocb9H/oLj+6fqD24EEE37waEYdQGCsfzEGXQnh1I3s187fJWv3 KWVZkA8RCLFlh3Lz3yVu1U+yR/Vx1KlirdiRrqltSPRff7QOP0188E7GDBFaRiMb1f0Q+L OTv7IGBSOforXykhvXWoJIm0/uFARkjWCp2LJ0pdlHIG3uHM4XcErgK89iQCPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690836593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HHGuaY4L7wIOzqjBXXvCIk66RDwHJb4dgzajjMrjydQ=; b=CUZ82bc9K1tUARqSmsiXrcDnqQLIifhrjwdrt/KM7hjIxqKk8dtb1Ej7EVgBrYSWBtgdLS 8ELQx95zV0zP5MtGfOy+yf6B+HZhITUUdZiARjnzWMH2+7riVZgWwyGyS5+eP3zRh9w+0q aAuLVd5bQ/NnDNpDm3OYFDrSG0bCPqj23AXvqUSRKV3kk5lrZfFrChwdt1dxCuPCva7ril Mis8ovJ+WQ38/XacIajW6rSKSpFAGlWOzuI1qTGpF8gw6PCTfMbfgnRiOp0BGMWDOCvAfC 9St1a0hQLHbViK/cyXi9Ics8dMpWR3Dgtaz91zQqQbezv6CV7H/D9gfrhqMBrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690836594; a=rsa-sha256; cv=none; b=yx/rm6L31+NJu5qn2jDAfWcr7utcMYEFspMp+uQ8WRi8m/IRe6+QU/1Huib+xDJklbmTw4 k9BN0VMLFYxEMAr2btO4GPU7UeCpJrsoucuL4OUYZl7US1wIB370yoEt59RDRb2piEjbqH qRl4DvP8RQvLUa9XbVV9RlTRuFBYTkARG2fTHOQGGfV9eUfEWaJBDLRRkOnXyPEtc5rLNK ObLZIl3EJREMC+OJGMylpsiT8t3w9WrYkDX7pEMytKovcEzuzdJ8V5L4EzhUWoeFCRAXXb EQLmiroO0Bk5NWPaoOWQgHJdZjpF9a77sFn57lAlcYlbFWmvESqMSv9ntKpF1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RF9NK2JZQz195P; Mon, 31 Jul 2023 20:49:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36VKnp38091483; Mon, 31 Jul 2023 20:49:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36VKnpWJ091482; Mon, 31 Jul 2023 20:49:51 GMT (envelope-from git) Date: Mon, 31 Jul 2023 20:49:51 GMT Message-Id: <202307312049.36VKnpWJ091482@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Bernard Spil Subject: git: f144c0373f25 - main - security/openssl30: Security update for CVE-2023-3187 (Low) List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brnrd X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f144c0373f258b4a53678f8a23ca2dbf159ab683 Auto-Submitted: auto-generated The branch main has been updated by brnrd: URL: https://cgit.FreeBSD.org/ports/commit/?id=f144c0373f258b4a53678f8a23ca2dbf159ab683 commit f144c0373f258b4a53678f8a23ca2dbf159ab683 Author: Bernard Spil AuthorDate: 2023-07-31 20:49:12 +0000 Commit: Bernard Spil CommitDate: 2023-07-31 20:49:12 +0000 security/openssl30: Security update for CVE-2023-3187 (Low) Security: bad6588e-2fe0-11ee-a0d1-84a93843eb75 --- security/openssl30/Makefile | 2 +- security/openssl30/files/patch-CVE-2023-3817 | 58 ++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/security/openssl30/Makefile b/security/openssl30/Makefile index a8b2a25904b2..2627d0fc46a1 100644 --- a/security/openssl30/Makefile +++ b/security/openssl30/Makefile @@ -1,6 +1,6 @@ PORTNAME= openssl PORTVERSION= 3.0.9 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= security devel MASTER_SITES= https://www.openssl.org/source/ \ ftp://ftp.cert.dfn.de/pub/tools/net/openssl/source/ diff --git a/security/openssl30/files/patch-CVE-2023-3817 b/security/openssl30/files/patch-CVE-2023-3817 new file mode 100644 index 000000000000..d90c0a11fb9d --- /dev/null +++ b/security/openssl30/files/patch-CVE-2023-3817 @@ -0,0 +1,58 @@ +From 9002fd07327a91f35ba6c1307e71fa6fd4409b7f Mon Sep 17 00:00:00 2001 +From: Tomas Mraz +Date: Tue, 25 Jul 2023 15:22:48 +0200 +Subject: [PATCH] DH_check(): Do not try checking q properties if it is + obviously invalid + +If |q| >= |p| then the q value is obviously wrong as q +is supposed to be a prime divisor of p-1. + +We check if p is overly large so this added test implies that +q is not large either when performing subsequent tests using that +q value. + +Otherwise if it is too large these additional checks of the q value +such as the primality test can then trigger DoS by doing overly long +computations. + +Fixes CVE-2023-3817 + +Reviewed-by: Matt Caswell +Reviewed-by: Paul Dale +Reviewed-by: Tom Cosgrove +Reviewed-by: Todd Short +(Merged from https://github.com/openssl/openssl/pull/21550) + +(cherry picked from commit 1c16253f3c3a8d1e25918c3f404aae6a5b0893de) +(cherry picked from commit 6a1eb62c29db6cb5eec707f9338aee00f44e26f5) +--- + crypto/dh/dh_check.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/crypto/dh/dh_check.c b/crypto/dh/dh_check.c +index aef6f9b1b77d..fbe279756954 100644 +--- crypto/dh/dh_check.c.orig ++++ crypto/dh/dh_check.c +@@ -143,7 +143,7 @@ int DH_check(const DH *dh, int *ret) + #ifdef FIPS_MODULE + return DH_check_params(dh, ret); + #else +- int ok = 0, r; ++ int ok = 0, r, q_good = 0; + BN_CTX *ctx = NULL; + BIGNUM *t1 = NULL, *t2 = NULL; + int nid = DH_get_nid((DH *)dh); +@@ -172,6 +172,13 @@ int DH_check(const DH *dh, int *ret) + goto err; + + if (dh->params.q != NULL) { ++ if (BN_ucmp(dh->params.p, dh->params.q) > 0) ++ q_good = 1; ++ else ++ *ret |= DH_CHECK_INVALID_Q_VALUE; ++ } ++ ++ if (q_good) { + if (BN_cmp(dh->params.g, BN_value_one()) <= 0) + *ret |= DH_NOT_SUITABLE_GENERATOR; + else if (BN_cmp(dh->params.g, dh->params.p) >= 0)