From nobody Mon Sep 25 15:45:48 2023 X-Original-To: dev-commits-src-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 4RvRzc4j3Kz4tjRf; Mon, 25 Sep 2023 15:45:48 +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 4RvRzc45K9z4hPH; Mon, 25 Sep 2023 15:45:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695656748; 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=3vJixgSpV5z80rYv4H1CgLJ1g8je1aOjh7Ym7an39SM=; b=Ds+eFjribBrt6QjHKBN9tXNUMXqCAYNQNSm5CiaVtG5xC7Iij1dP1mOh3Eg77Ulik513VK a30KPYnxTXhqF3yiENGOCNywowPLUHEBpJVi9MXncQbT5KI5VLPqdyHE0RJSYRwL8gNLyf 3jUvwYjFKPFav0HKUGe2fcCTE4IpHvhCwPUR0fSrypaHQEBDuKmF4xICcOd+D/59aQFNOr zCbySKhj+covr5L9Hgwi3P4oLcVGvlYmwArGyOriSbySjNHLvxZ4nHYdVR0/17HhRA6JAf NIRWWYCirPqd+xWa/TR8hbX92lPKWwW6qu2mnI45DV8kYFxgb/OMOiHJmOr5+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695656748; a=rsa-sha256; cv=none; b=feooSjyO93ryO8yULw4Y+6a/sJYHTc2T1l5exKvAhQAxot405pExw3xZfkCIkb/NMrBBPt y74CexzdW6epsEIvjkCVtQloiSNGZd4OJ3Bc+svpTQs3b85Iw2/Ja/cyxC2agtPTDp62O9 rcGPFIehxZxM1m7j8rAldyvLHksMuYKlJ3D4pShyY1jlgOOT6T41mAuSxMUNdVsHP7tgts mSmSUCbCKm/UO1VI9FZ3nLSEWgrUPxY9kIs1o73aQQZn6LLYs8BqILvxhIZFd9z0U/VEhd z6D5LX9q2FgbNP1yoBtcuMi1vxoIdlQYXNIYLAJ341Z137qARwssfrDvmv1+Wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695656748; 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=3vJixgSpV5z80rYv4H1CgLJ1g8je1aOjh7Ym7an39SM=; b=ZnxWq6pEGdWBYGcXab8o8PACq5hvMpPfkfMPOQKgAvafm/BtfwKOApwQjvb6df3Tlsx5cC 7ZMk/2ikyXs5mu4WupCrBJT2z2+0kC6uJ5c0hft0ejC7SVasR4g2M0rLFpFBzvWaNShDzE WX3plbphBwvkGmkcHQF88EHecmbsiTcKMCNoWyCN/o/KfAHzHAgDqGGPyt1DacloPmNMCa CHyboIzGFid1s5c3zsniAMb7+SQ9go9n4LwV0Iko8o76XCmexjHezb7rN0iAenHpWfd52N 2hZvrMmGqHPi5qw0mvq4J5s6fUD6e4xmj59PVR7CrlIF18Z3iP5sCnaAg9V2dA== 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 4RvRzc31rqz4mN; Mon, 25 Sep 2023 15:45:48 +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 38PFjm3A028080; Mon, 25 Sep 2023 15:45:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38PFjmnh028077; Mon, 25 Sep 2023 15:45:48 GMT (envelope-from git) Date: Mon, 25 Sep 2023 15:45:48 GMT Message-Id: <202309251545.38PFjmnh028077@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 6a770c04986b - main - openssl: document the update process List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a770c04986b01a95fbbdadc621e25cdfffbf7a9 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6a770c04986b01a95fbbdadc621e25cdfffbf7a9 commit 6a770c04986b01a95fbbdadc621e25cdfffbf7a9 Author: Pierre Pronchery AuthorDate: 2023-09-25 15:40:26 +0000 Commit: Ed Maste CommitDate: 2023-09-25 15:43:58 +0000 openssl: document the update process This is directly inspired from the equivalent document for OpenSSH. Sponsored by: The FreeBSD Foundation --- crypto/openssl/FREEBSD-upgrade | 130 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) diff --git a/crypto/openssl/FREEBSD-upgrade b/crypto/openssl/FREEBSD-upgrade new file mode 100644 index 000000000000..76943efdbde6 --- /dev/null +++ b/crypto/openssl/FREEBSD-upgrade @@ -0,0 +1,130 @@ + FreeBSD maintainer's guide to OpenSSL + ===================================== + + These instructions assume you have a clone of the FreeBSD git repo + main branch in src/freebsd/main, and will store vendor trees under + src/freebsd/vendor/. In addition, this assumes there is a "freebsd" + origin pointing to git(repo).freebsd.org/src.git. + +01) Switch to the vendor branch: + + $ cd src/freebsd/main + $ git worktree add ../vendor/openssl-X.Y freebsd/vendor/openssl-X.Y + $ cd ../vendor/openssl-X.Y + +02) Download the latest OpenSSL tarball and signature from the official + website (https://www.openssl.org/source/). + + $ (cd .. && fetch https://openssl.org/source/openssl-X.Y.Z.tar.gz) + $ (cd .. && fetch https://openssl.org/source/openssl-X.Y.Z.tar.gz.asc) + +03) Verify the signature: + + $ gpg --verify ../openssl-X.Y.Z.tar.gz.asc ../openssl-X.Y.Z.tar.gz + +04) Unpack the OpenSSL tarball to the parent directory: + + $ tar -x -X FREEBSD-Xlist -f ../openssl-X.Y.Z.tar.gz -C .. + +05) Copy to the vendor branch: + + $ rsync --exclude FREEBSD.* --delete -av ../openssl-X.Y.Z/* . + +06) Take care of added / deleted files: + + $ git add -A + +07) Commit: + + $ git commit -m "openssl: Vendor import of OpenSSL X.Y.Z" + +08) Tag: + + $ git tag -a -m "Tag OpenSSL X.Y.Z" vendor/openssl/X.Y.Z + + At this point the vendor branch can be pushed to the FreeBSD repo via: + + $ git push freebsd vendor/openssl-X.Y + $ git push freebsd vendor/openssl/X.Y.Z + + Note the second "git push" command is used to push the tag, which is + not pushed by default. + + It is also possible to push the branch and tag together, but use + --dry-run first to ensure that no undesired tags will be pushed: + + $ git push --dry-run --follow-tags freebsd vendor/openssl-X.Y + $ git push --follow-tags freebsd vendor/openssl-X.Y + + The update and tag could instead be pushed later, along with the merge + to main, but pushing now allows others to collaborate. + +09) Merge from the vendor branch: + + $ git subtree merge -P crypto/openssl vendor/openssl-X.Y + + A number of files have been deleted from FreeBSD's copy of OpenSSL. + If git prompts for these deleted files during the merge, choose 'd' + (leaving them deleted). + +10) Resolve conflicts. Remember to bump the version and date in + secure/lib/libcrypto/Makefile.inc and + crypto/openssl/include/openssl/opensslv.h. + +11) Diff against the vendor branch: + + $ git diff --diff-filter=M vendor/openssl/X.Y.Z HEAD:crypto/openssl + + Review the diff for any unexpected changes. + +12) Re-generate the assembly files: + + $ cd secure/lib/libcrypto + $ make cleanasm buildasm + +13) Update the appropriate makefiles to reflect changes in the vendor's + build.info files. This is especially important if source files have + been added or removed. Keep in mind that the assembly files generated + belong to sys/crypto/openssl, and will therefore affect the kernel as + well. + +14) If symbols have been added or removed, update the appropriate + Version.map to reflect these changes. + +15) Compare compilation flags, the list of files built and included, the + list of symbols generated with the corresponding port if available. + +16) Re-generate the manual files: + + $ tar xzf openssl-X.Y.Z.tar.gz + $ (cd openssl-X.Y.Z && ./Configure --prefix=/usr --openssldir=/etc/ssl && + make build_man_docs) + [...] + $ find openssl-X.Y.Z/doc/man/man1 -name '*.1' -exec cp {} secure/usr.bin/openssl/man/ \; + $ find openssl-X.Y.Z/doc/man/man3 -name '*.3' -exec cp {} secure/lib/libcrypto/man/man3/ \; + $ find openssl-X.Y.Z/doc/man/man5 -name '*.5' -exec cp {} secure/lib/libcrypto/man/man5/ \; + $ find openssl-X.Y.Z/doc/man/man7 -name '*.7' -exec cp {} secure/lib/libcrypto/man/man7/ \; + $ grep -nrF usr/local secure/lib/libcrypto/man secure/usr.bin/openssl/man + [correct the references to the prefix and OpenSSL directories] + $ git commit --amend secure/lib/libcrypto/man secure/usr.bin/openssl/man + + Review the diff and tree status for anything requiring attention. + +16) Build and install world, reboot, test. + +17) Test the legacy and fips providers as well: (here with "test" as the password) + + $ echo test | openssl rc4 -provider legacy -e -a -pbkdf2 + enter RC4 encryption password: + Verifying - enter RC4 encryption password: + U2FsdGVkX1+JvhqxLMOvlxvTi1/h + + # openssl fipsinstall -out /etc/ssl/fipsmodule.cnf -module /usr/lib/ossl-modules/fips.so + INSTALL PASSED + # vi /etc/ssl/openssl.cnf + [enable the FIPS module] + # echo test | openssl aes-256-cbc -provider fips -e -a -pbkdf2 + U2FsdGVkX19lTexiYsnMX83ZLSojBOFwv7GB0Plhgmw= + +18) Commit and hope you did not miss anything. +