From nobody Tue Jun 27 09:53:52 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 4Qr0R45Xt6z4hjwP; Tue, 27 Jun 2023 09:53:52 +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 4Qr0R4533Rz4MJ1; Tue, 27 Jun 2023 09:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687859632; 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=sp1KqfSdhQPfQVsHFAq9ic+AP9awt3CceaWvCPvp0+g=; b=todkox8O037laQJnxt6UQvqYc676nYUOIW9rap4djeDPiabdhwyiegA2ornpg4JHz01ut9 LZ1s0HPsHTPTWky6R7f50ifypc5tDw8VywnM6wmbcLtK9Hyj7+9rme/CxRCmYnu48rVzAd rjhmLJW/TpmBBmlkIlVX7o6uLihy2F633jgSQvp2Cjo8YDkxB7uCISXeXnfebJM7c2jNjf O1Ie95nl/ETdsmRQxj9ttHr1Ttk86QS1JNA1ckmWYK7W97CxJwiq06sPuG3Jko3EYsA2Hq QPgx8SThii3hXPo7EWr4t1l0yPKuBpY6LOgZ7cQBFE/L4sWYKgTamBvAjS/PAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687859632; 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=sp1KqfSdhQPfQVsHFAq9ic+AP9awt3CceaWvCPvp0+g=; b=qa/T3Y6k4ZoPiKU0v6XB7rnDKM9OMyTV8npqehJlukn1ZReh0AKEbN3WXgl+vpwRI17zdd Ekzjl3rX7fJl065Tto1oCNKwwfkcWX+oJzsc9MOJto2ig6CL+HOmUXPj1rTiE9kfJ9vutR FQdeoi0EtgiZWXjclVD42Hdjnq1UguyGPqiuRIFYG84lJzIx+HKr9yhnA3G3JRCK4oR/hP uFiXiSfcZqsA0ENsP0AQs7DpLubnGdIS29H+vDSE8tZ/vZBlzcfR1FGBoRPivT/IsURcHK b+7qLw/aTui6gQ/bVmuchlAZtKzChgDz7mNhEAJl9xM/a8+B+sf85c9wBZcItw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687859632; a=rsa-sha256; cv=none; b=V6+kf4TWf24pIYAnFLxnu4yeUJloYt7KhBYdHEezZcWrlID0boJmkp70g+rRVRSqUvz43w kkXF/GE+4cjq20EI1dOXkXOgcoCctGaWjGfvDmMIytaV7en/gEkXmQvzzjqnOl/5tVvQw5 MiT8Ll2NywKrskii8kJ62FuKWyUVh/TBqNg/DurN1aKO41amToa+Bl3HLO266GfZ/7B3F4 6aoZQmWQp55q4Y+CfUO1jyZvVq5xl3v9DTpir4V+V43T8dF2i1CA1+HCFrtsGCDXRE6coF cvtT15Pejxxen0ANQAYlsiiG60nXQ3ZXrvBl1QaOrLmRG3jbgXLFVSRSaPEIGQ== 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 4Qr0R441Przn8c; Tue, 27 Jun 2023 09:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 35R9rqcR070858; Tue, 27 Jun 2023 09:53:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35R9rqcm070857; Tue, 27 Jun 2023 09:53:52 GMT (envelope-from git) Date: Tue, 27 Jun 2023 09:53:52 GMT Message-Id: <202306270953.35R9rqcm070857@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Baptiste Daroussin Subject: git: f23812a6dad5 - main - pkg: revert openssl3 support 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: bapt X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f23812a6dad55f203800721af9378320e52c4f22 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/ports/commit/?id=f23812a6dad55f203800721af9378320e52c4f22 commit f23812a6dad55f203800721af9378320e52c4f22 Author: Baptiste Daroussin AuthorDate: 2023-06-27 09:52:01 +0000 Commit: Baptiste Daroussin CommitDate: 2023-06-27 09:52:01 +0000 pkg: revert openssl3 support This change makes pkg generate a signature that is incompatible with previous keys, it is better to have pkg broken for openssl3 and die instead of having a backward incompatibility --- ports-mgmt/pkg-devel/Makefile | 2 +- ports-mgmt/pkg-devel/files/patch-openssl3 | 98 ------------------------------- ports-mgmt/pkg/Makefile | 2 +- ports-mgmt/pkg/files/patch-openssl3 | 98 ------------------------------- 4 files changed, 2 insertions(+), 198 deletions(-) diff --git a/ports-mgmt/pkg-devel/Makefile b/ports-mgmt/pkg-devel/Makefile index a4b9ce544941..7b634b2e356a 100644 --- a/ports-mgmt/pkg-devel/Makefile +++ b/ports-mgmt/pkg-devel/Makefile @@ -1,7 +1,7 @@ PORTNAME= pkg DISTVERSION= 1.19.99.2 _PKG_VERSION= ${DISTVERSION} -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= ports-mgmt PKGNAMESUFFIX= -devel diff --git a/ports-mgmt/pkg-devel/files/patch-openssl3 b/ports-mgmt/pkg-devel/files/patch-openssl3 deleted file mode 100644 index d04226e68c50..000000000000 --- a/ports-mgmt/pkg-devel/files/patch-openssl3 +++ /dev/null @@ -1,98 +0,0 @@ -diff --git libpkg/rsa.c libpkg/rsa.c -index 41a12466..eea6e0bb 100644 ---- libpkg/rsa.c -+++ libpkg/rsa.c -@@ -37,31 +37,6 @@ - #include "private/event.h" - #include "private/pkg.h" - --#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) --/* -- * This matches the historical usage for pkg. Older versions sign the hex -- * encoding of the SHA256 checksum. If we ever deprecated RSA, this can go -- * away. -- */ --static EVP_MD *md_pkg_sha1; -- --static EVP_MD * --EVP_md_pkg_sha1(void) --{ -- -- if (md_pkg_sha1 != NULL) -- return (md_pkg_sha1); -- -- md_pkg_sha1 = EVP_MD_meth_dup(EVP_sha1()); -- if (md_pkg_sha1 == NULL) -- return (NULL); -- -- EVP_MD_meth_set_result_size(md_pkg_sha1, -- pkg_checksum_type_size(PKG_HASH_TYPE_SHA256_HEX)); -- return (md_pkg_sha1); --} --#endif /* OPENSSL_VERSION_NUMBER >= 0x10100000L */ -- - struct pkg_key { - pkg_password_cb *pw_cb; - char *path; -@@ -217,6 +192,7 @@ rsa_verify_cert(unsigned char *key, int keylen, - OpenSSL_add_all_algorithms(); - OpenSSL_add_all_ciphers(); - -+ - ret = pkg_emit_sandbox_call(rsa_verify_cert_cb, fd, &cbdata); - if (need_close) - close(fd); -@@ -232,6 +208,7 @@ rsa_verify_cb(int fd, void *ud) - char errbuf[1024]; - EVP_PKEY *pkey = NULL; - #if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) -+ const EVP_MD *md; - EVP_PKEY_CTX *ctx; - #else - RSA *rsa; -@@ -276,7 +253,8 @@ rsa_verify_cb(int fd, void *ud) - return (EPKG_FATAL); - } - -- if (EVP_PKEY_CTX_set_signature_md(ctx, EVP_md_pkg_sha1()) <= 0) { -+ md = EVP_sha1(); -+ if (EVP_PKEY_CTX_set_signature_md(ctx, md) <= 0) { - EVP_PKEY_CTX_free(ctx); - EVP_PKEY_free(pkey); - free(sha256); -@@ -284,7 +262,7 @@ rsa_verify_cb(int fd, void *ud) - } - - ret = EVP_PKEY_verify(ctx, cbdata->sig, cbdata->siglen, sha256, -- pkg_checksum_type_size(PKG_HASH_TYPE_SHA256_HEX)); -+ EVP_MD_size(md)); - #else - rsa = EVP_PKEY_get1_RSA(pkey); - -@@ -360,6 +338,7 @@ rsa_sign(char *path, struct pkg_key *keyinfo, unsigned char **sigret, - char errbuf[1024]; - int max_len = 0, ret; - #if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) -+ const EVP_MD *md; - EVP_PKEY_CTX *ctx; - size_t siglen; - #else -@@ -403,15 +382,15 @@ rsa_sign(char *path, struct pkg_key *keyinfo, unsigned char **sigret, - return (EPKG_FATAL); - } - -- if (EVP_PKEY_CTX_set_signature_md(ctx, EVP_md_pkg_sha1()) <= 0) { -+ md = EVP_sha1(); -+ if (EVP_PKEY_CTX_set_signature_md(ctx, md) <= 0) { - EVP_PKEY_CTX_free(ctx); - free(sha256); - return (EPKG_FATAL); - } -- - siglen = max_len; - ret = EVP_PKEY_sign(ctx, *sigret, &siglen, sha256, -- pkg_checksum_type_size(PKG_HASH_TYPE_SHA256_HEX)); -+ EVP_MD_size(md)); - #else - rsa = EVP_PKEY_get1_RSA(keyinfo->key); - diff --git a/ports-mgmt/pkg/Makefile b/ports-mgmt/pkg/Makefile index fde39894a485..9dd8690d94c6 100644 --- a/ports-mgmt/pkg/Makefile +++ b/ports-mgmt/pkg/Makefile @@ -1,6 +1,6 @@ PORTNAME= pkg DISTVERSION= 1.19.1 -PORTREVISION= 2 +PORTREVISION= 3 _PKG_VERSION= ${DISTVERSION} CATEGORIES= ports-mgmt diff --git a/ports-mgmt/pkg/files/patch-openssl3 b/ports-mgmt/pkg/files/patch-openssl3 deleted file mode 100644 index d04226e68c50..000000000000 --- a/ports-mgmt/pkg/files/patch-openssl3 +++ /dev/null @@ -1,98 +0,0 @@ -diff --git libpkg/rsa.c libpkg/rsa.c -index 41a12466..eea6e0bb 100644 ---- libpkg/rsa.c -+++ libpkg/rsa.c -@@ -37,31 +37,6 @@ - #include "private/event.h" - #include "private/pkg.h" - --#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) --/* -- * This matches the historical usage for pkg. Older versions sign the hex -- * encoding of the SHA256 checksum. If we ever deprecated RSA, this can go -- * away. -- */ --static EVP_MD *md_pkg_sha1; -- --static EVP_MD * --EVP_md_pkg_sha1(void) --{ -- -- if (md_pkg_sha1 != NULL) -- return (md_pkg_sha1); -- -- md_pkg_sha1 = EVP_MD_meth_dup(EVP_sha1()); -- if (md_pkg_sha1 == NULL) -- return (NULL); -- -- EVP_MD_meth_set_result_size(md_pkg_sha1, -- pkg_checksum_type_size(PKG_HASH_TYPE_SHA256_HEX)); -- return (md_pkg_sha1); --} --#endif /* OPENSSL_VERSION_NUMBER >= 0x10100000L */ -- - struct pkg_key { - pkg_password_cb *pw_cb; - char *path; -@@ -217,6 +192,7 @@ rsa_verify_cert(unsigned char *key, int keylen, - OpenSSL_add_all_algorithms(); - OpenSSL_add_all_ciphers(); - -+ - ret = pkg_emit_sandbox_call(rsa_verify_cert_cb, fd, &cbdata); - if (need_close) - close(fd); -@@ -232,6 +208,7 @@ rsa_verify_cb(int fd, void *ud) - char errbuf[1024]; - EVP_PKEY *pkey = NULL; - #if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) -+ const EVP_MD *md; - EVP_PKEY_CTX *ctx; - #else - RSA *rsa; -@@ -276,7 +253,8 @@ rsa_verify_cb(int fd, void *ud) - return (EPKG_FATAL); - } - -- if (EVP_PKEY_CTX_set_signature_md(ctx, EVP_md_pkg_sha1()) <= 0) { -+ md = EVP_sha1(); -+ if (EVP_PKEY_CTX_set_signature_md(ctx, md) <= 0) { - EVP_PKEY_CTX_free(ctx); - EVP_PKEY_free(pkey); - free(sha256); -@@ -284,7 +262,7 @@ rsa_verify_cb(int fd, void *ud) - } - - ret = EVP_PKEY_verify(ctx, cbdata->sig, cbdata->siglen, sha256, -- pkg_checksum_type_size(PKG_HASH_TYPE_SHA256_HEX)); -+ EVP_MD_size(md)); - #else - rsa = EVP_PKEY_get1_RSA(pkey); - -@@ -360,6 +338,7 @@ rsa_sign(char *path, struct pkg_key *keyinfo, unsigned char **sigret, - char errbuf[1024]; - int max_len = 0, ret; - #if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) -+ const EVP_MD *md; - EVP_PKEY_CTX *ctx; - size_t siglen; - #else -@@ -403,15 +382,15 @@ rsa_sign(char *path, struct pkg_key *keyinfo, unsigned char **sigret, - return (EPKG_FATAL); - } - -- if (EVP_PKEY_CTX_set_signature_md(ctx, EVP_md_pkg_sha1()) <= 0) { -+ md = EVP_sha1(); -+ if (EVP_PKEY_CTX_set_signature_md(ctx, md) <= 0) { - EVP_PKEY_CTX_free(ctx); - free(sha256); - return (EPKG_FATAL); - } -- - siglen = max_len; - ret = EVP_PKEY_sign(ctx, *sigret, &siglen, sha256, -- pkg_checksum_type_size(PKG_HASH_TYPE_SHA256_HEX)); -+ EVP_MD_size(md)); - #else - rsa = EVP_PKEY_get1_RSA(keyinfo->key); -