From nobody Mon Jul 31 20:51:14 2023 X-Original-To: dev-commits-ports-all@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 4RF9Pz21J8z4pTqY; Mon, 31 Jul 2023 20:51:15 +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 4RF9Pt5HXXz4FVc; Mon, 31 Jul 2023 20:51:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690836674; 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=+pVAs1eTwdOxDLeyRV926AmV8rnoN5KiwopkqO6yCwg=; b=yL94J+8hR34Vu7BioBtjIvFRAPAkmmeYlBZ/fLXo+MmO17xSjslNfV1izNjzd6n4+2paj9 V8Cau7Etjz8LQnlKEAwOIpRsrhdnl1kMQ4RUbZEpNJvuWVAqoHu/1nTcUMsZXG9q4t8kF6 SEM8pyMeEkVd8j7kac3vN9vxzHVWiFvXfhE62Quq4xZ44kqQ9LNmEvlD9wOX/fzvOrAtAV P51xFaofH4JqhREXg2KhKEO6lkgpTgbPjrBnBCIg75Yfvs5DMfVSTz3g/4/bO6Fykgaxzv F7moi6FJ6P2mQFyD39EPFbAG5fasDwkqDpICXrUbNz/mElWHtPzIvb00Nk5Kiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690836674; 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=+pVAs1eTwdOxDLeyRV926AmV8rnoN5KiwopkqO6yCwg=; b=LfIaYnMC/AI8NYxYpze2mnVpBkIIFxjUlCmWlHuDV6VIZDq3bk5ITzPqP7iTI1jz8mnzLH lHQeBu0Em6WEd+sNBjDAnkp/KZQZOOJYflC4FwVkJ58PCml9FWIL+Cu7WcKpY5YvIAEXF1 U24fHzQVIpZ6icPYGMI68XMQkg+iQCAM8K+GVbO5rc5S6t9TM9xLNXN4g6F0kn9kNJOD7z y2DEfMBqaHG7mfhgFZ8DdId8G6SSGppR3d86LJORYakjuiZgJsFZFDVn/B1La3zYGRwoqs QOnER3e4aJehbRAZzWm6mkcj6dPIlfr4ySASlrhPNhIts7vXaTF/R1WmoFONPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690836674; a=rsa-sha256; cv=none; b=tPbhhv7BbmX8fgsbsXInPEhMkF2zY0NR4Fa90+lENbvjZx5j/kpIXefjFBJxN1wD1aLYrn l9jkTQqnX+fFxepu0FFs236F0KE8GXU1uGZVxgvGsd6BWSX2/OS8SRzEm/AAmdRtt9rGWd vMq/fP4yWMvotG5Nykj08hiP0mjIg9Gjbrjp0eb2pGjotyL4LFzZuwrSENMeCTUoEplbei CXfAZaY39pEs/bkEHnrCMrI8X6dRveOfZmGgZTL+8+JThrk5m848UPgUw2NbODnan81LdL PnuekL3jxpnkZECstViprN/xryJlgULxCcSAkrutgYsaM6Y30Jj9dmJuRhsFcw== 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 4RF9Pt31t4z19Sq; Mon, 31 Jul 2023 20:51:14 +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 36VKpEVu005877; Mon, 31 Jul 2023 20:51:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36VKpED3005876; Mon, 31 Jul 2023 20:51:14 GMT (envelope-from git) Date: Mon, 31 Jul 2023 20:51:14 GMT Message-Id: <202307312051.36VKpED3005876@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: 5cb624204c36 - main - security/openssl31: Security update for CVE-2023-3817 (Low) List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@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: 5cb624204c36be8911c7fd5eca62a6bff17df155 Auto-Submitted: auto-generated The branch main has been updated by brnrd: URL: https://cgit.FreeBSD.org/ports/commit/?id=5cb624204c36be8911c7fd5eca62a6bff17df155 commit 5cb624204c36be8911c7fd5eca62a6bff17df155 Author: Bernard Spil AuthorDate: 2023-07-31 20:50:33 +0000 Commit: Bernard Spil CommitDate: 2023-07-31 20:50:33 +0000 security/openssl31: Security update for CVE-2023-3817 (Low) Security: bad6588e-2fe0-11ee-a0d1-84a93843eb75 --- security/openssl31/Makefile | 2 +- security/openssl31/files/patch-CVE-2023-3817 | 57 ++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/security/openssl31/Makefile b/security/openssl31/Makefile index 29221630a1e3..0625a0573716 100644 --- a/security/openssl31/Makefile +++ b/security/openssl31/Makefile @@ -1,6 +1,6 @@ PORTNAME= openssl PORTVERSION= 3.1.1 -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/openssl31/files/patch-CVE-2023-3817 b/security/openssl31/files/patch-CVE-2023-3817 new file mode 100644 index 000000000000..cbb1a7ae0128 --- /dev/null +++ b/security/openssl31/files/patch-CVE-2023-3817 @@ -0,0 +1,57 @@ +From 6a1eb62c29db6cb5eec707f9338aee00f44e26f5 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) +--- + 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)