From nobody Fri Oct 13 15:44:24 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 4S6W5j2NvVz4x8lk; Fri, 13 Oct 2023 15:44:25 +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 4S6W5j0cc3z3Xjg; Fri, 13 Oct 2023 15:44:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697211865; 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=u2d0S2p5MlAVmsjVJu8a3MPwvS7bZyLoA0v+Uz+vFO4=; b=AhajYER6wnbnme9dHCQxB5vJhgRWKttuRKpXfw5Bp8DBWS9DpWskSdW6JPT9gv396RZSi/ 1ysr7J0NQmL6MnJ8QPqngmhijuJvvfT9IwJ1GD7uZx6PPkiicewZ4VBtIVTpEzs760sXIF tx8ez9XUbHyQTTtCbHqw1fCs1TRH5+wJTPHC92+XFiWjc7T6Kzyb/WaddAsEfaWejJs5hv aRYKFoJI3ZgxDdR7YdT9dV8wWE3n0cPFoSPTUkWD6rLbGnWhFu8cK54D3W41JW8xWA1FPq 5AEb25R7SJbaVqrpE2+cX2KnOzHMoH/2U6IRgJkytWHPGJU+zfSrA1Xz8lfz/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697211865; a=rsa-sha256; cv=none; b=jOF/mhShy7ujmBpaf0sOtbL8/+rfmiX1Q5xiQk9p86ad7p8Ehax2jUNYvCg/BmCPpHqhOj NPeFu/mVYILZacrkZ6HevSOtKHYt79+DcCykJNGVQd3mSJy46VheYbK+V6JEjX94PKH3sn 0aWFmm6x/xd4kci3FTnXPUTCpwOyoGyAw1O2Yz3dLh18ok/nB1I+JxJHOrc7gCehnyShRS VNLpTye9FO/hAYbx14us5ccOZBv0AU0QnU6gSC9Pb2fdojvXaLLfvSe9ngWHAxDZUxq8Vy J+D3JX0hPUzeIQR7mrqUXCtXUGCSgLn33cgxhJyRTGqlWxtwAmPOIEtQu/nWag== 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=1697211865; 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=u2d0S2p5MlAVmsjVJu8a3MPwvS7bZyLoA0v+Uz+vFO4=; b=AQQHsMV++E7XJsukeveCXT9sGvl4Fw1jeVBy/V/87F2RGizpy75biC45YXBpGX8yjuQ6Q5 MAk3EpbVvWclpmExc+diZMzD1LZQ8BfsOOzjE4Ned42gjCnnsY8o5/Kv88kBeht95yL+lZ wOQi6vv7SygWayq1tmIvpnwfZJ8JuP1vHp70/bhLFOHMUqGBTzKEySldxWNonfUCN464JI x/BBeX3I+4aBGuoUurqM7Lt5AJsJi488YZ1bPo6mF0Q0aob6oEAAJ1s2zUO53iB/Mmprpn Nocd1sYII833OAUOLnR3BnnOfU5jBL6X+h7J9IzGV8NsXKuKP2haQiQCBSi5gA== 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 4S6W5h6jLdztZ2; Fri, 13 Oct 2023 15:44:24 +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 39DFiOHs015106; Fri, 13 Oct 2023 15:44:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39DFiONn015103; Fri, 13 Oct 2023 15:44:24 GMT (envelope-from git) Date: Fri, 13 Oct 2023 15:44:24 GMT Message-Id: <202310131544.39DFiONn015103@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 74e9205b5e4f - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 74e9205b5e4f4c48da06d45719eacc605878c3a9 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=74e9205b5e4f4c48da06d45719eacc605878c3a9 commit 74e9205b5e4f4c48da06d45719eacc605878c3a9 Author: Pierre Pronchery AuthorDate: 2023-09-25 15:40:26 +0000 Commit: Ed Maste CommitDate: 2023-10-13 14:13:38 +0000 openssl: document the update process This is directly inspired from the equivalent document for OpenSSH. Sponsored by: The FreeBSD Foundation (cherry picked from commit 6a770c04986b01a95fbbdadc621e25cdfffbf7a9) --- 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. +