From owner-svn-src-projects@freebsd.org Sat Oct 31 02:57:54 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07570465E6F for ; Sat, 31 Oct 2020 02:57:54 +0000 (UTC) (envelope-from rmacklem@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CNP4K6Spjz3cdv; Sat, 31 Oct 2020 02:57:53 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C103020E76; Sat, 31 Oct 2020 02:57:53 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09V2vrdl034973; Sat, 31 Oct 2020 02:57:53 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09V2vrSt034972; Sat, 31 Oct 2020 02:57:53 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202010310257.09V2vrSt034972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 31 Oct 2020 02:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r367194 - projects/nfs-over-tls X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: projects/nfs-over-tls X-SVN-Commit-Revision: 367194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Oct 2020 02:57:54 -0000 Author: rmacklem Date: Sat Oct 31 02:57:53 2020 New Revision: 367194 URL: https://svnweb.freebsd.org/changeset/base/367194 Log: Update nfs-over-tls-setup.txt to reflect the changes to using openssl-3.0.0-alpha7 instead of jhb@'s patched openssl3. It also has a fix for building the daemons identified by a tester. Modified: projects/nfs-over-tls/nfs-over-tls-setup.txt Modified: projects/nfs-over-tls/nfs-over-tls-setup.txt ============================================================================== --- projects/nfs-over-tls/nfs-over-tls-setup.txt Sat Oct 31 02:53:15 2020 (r367193) +++ projects/nfs-over-tls/nfs-over-tls-setup.txt Sat Oct 31 02:57:53 2020 (r367194) @@ -51,18 +51,14 @@ to it. # make buildkernel # make installkernel -Now, you need jhb@'s patched openssl3 source tree, so you can build it. -- If you don't already have one, get a github account. - (If you don't have git anywhere, I think "pkg install git" will get it - installed.) - - You will need perl5. +Now, you will need a recent openssl3 source tree, which has been patched +for ktls. +I downloaded the openssl-3.0.0-alpha7.tar.gz tarball from www.openssl.org. +- You will need perl5. # pkg install perl5 # cd /usr -# mkdir openssl -# cd openssl -# git clone https://github.com/bsdjhb/openssl.git -# cd openssl (or not, I can't remember if you end up with another openssl dir?) -# git checkout ktls_rx +# zcat openssl-3.0.0-alpha7.tar.gz | tar xBf - +# cd openssl-3.0.0-alpha7 # mkdir obj # cd obj # ../config --prefix=/usr/ktls --openssldir=/usr/ktls enable-ktls @@ -71,11 +67,6 @@ Now, you need jhb@'s patched openssl3 source tree, so - This installs the patched openssl3 under /usr/ktls. I only use this stuff for linking the daemons and use the regular openssl1.1.1 otherwise. -Now, you need to patch the include files in /usr/ktls/include/openssl. -(clang doesn't like the DEFINE_OR_DECLARE_STACK_OF(XX) before the typedef for XX.) -# cd /usr/ktls/include/openssl -# patch -p0 < /usr/nfs-over-tls/openssl3.patch - And now you should be able to build/install the utilities. First, make a symlink to your kernel sources in /usr/nfs-over-tls. # cd /usr/nfs-over-tls @@ -92,14 +83,9 @@ Then the makes should work. You can copy the rc.d scripts as follows: # cd /usr/nfs-over-tls/rc.d -# cp tlsclntd tlsservd /etc/rc.d -# chmod 555 /etc/rc.d/tlsclntd /etc/rc.d/tlsservd +# cp tlsclntd tlsservd ktls /etc/rc.d +# chmod 555 /etc/rc.d/tlsclntd /etc/rc.d/tlsservd /etc/rc.d/ktls -Almost done. Here's a few more things you need to do: -# cd /etc -- edit sysctl.conf and add these two lines -kern.ipc.tls.enable=1 -kern.ipc.mb_use_ext_pgs=1 Then reboot the system. You should now be finally ready to configure and run a TLS mount. @@ -162,11 +148,10 @@ Certificate Revocation List (CRL). Now, you should be ready to create/sign certificates for the NFS server/client(s). 3 - Create a key for the certificate. # openssl genrsa -out key.pem -(If this certificate is for a client laptop, you might want to use the "-aes256" - option, so the key.pem file is encrypted using a passphrase. - This implies that the passphrase will need to be entered when the - rpc.tlsclntd(8) daemon is started on the client, but that the key cannot - be used without the passphrase, if it is compromised.) +(For now, do not create a certificate that requires a passphrase, since + that makes rpc.tlsclntd crash upon startup. It worked for a previous + openssl3 patched source tree, but crashes for openssl-3.0.0-alpha7. + In other words, don't use the "-aes256" command line option, or similar.) 4 - Create a Certificate Signing Request (CSR). # openssl req -new -key key.pem -addext "subjectAltName=" -out req.pem @@ -341,10 +326,14 @@ it will log a lot of other stuff, as well. Once you have set things up, you can add line(s) to your /etc/rc.conf for the daemon(s): For the client: +ktls_enable="YES" +ktls_aesni_enable="YES" tlsclntd_enable="YES" tlsclntd_env="LD_LIBRARY_PATH=/usr/ktls/lib" For the server: +ktls_enable="YES" +ktls_aesni_enable="YES" tlsservd_enable="YES" tlsservd_env="LD_LIBRARY_PATH=/usr/ktls/lib"