From nobody Tue Oct 24 19:25:54 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 4SFMVC0J88z4yPqD; Tue, 24 Oct 2023 19:25:55 +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 4SFMVB6Sgkz4Mwj; Tue, 24 Oct 2023 19:25:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698175554; 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=h7H1jFfyf9w+Lte4nZ++GGBLkZBKfPxdADeAp9BOFRg=; b=aXPhMjeUx5JN/y+1H8ugDrAirkkrsmf/lzb/oKRxE2n1S659VmXovdTnbD6yrxcFdlFRbO ByamA0BjdjDkQLfiIdXBD3N4978gL6PYcfQQuVQaEYrdxtdduOf4vDVwMdvU3i6JlUMnTK b06WGT8fc5kjX+hq1uP9TiI+CAywbwh9Ltu/R0qEfDJTHL3ohLCjTTDoYMdF4M8BuCmiy4 /nfI6XbAnTfrdEE/eiwVWLnXbpV+or/cDXHDvTvz+rrO9n2ykrKExQ85jiFmOMoRa+0hlT 8U+2OnbyexIX+i4ss1C/uoFhmRKopy7gQ3pnFc/Dz2wwgE1G+BLUZqPtAyYFRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698175554; a=rsa-sha256; cv=none; b=BkLmXIPspMa/kRiFkXG2g+Fpls/YNBD/0y0cYGMx4rMOa7wsqXgzon1mPDyCXry4Xo9P8m 3YX+TkgbAhk00zSSzWnch+70mTTLfO3Cl36PPiOMeDT6si6pAf/mlIYLZgPaCK8Kgvwrip eeeG86wsGLZD/TD9XbIL5zSX5y6NqwHTLt0tnC47SkOmJKhsZYYR7GrG0jLXSR5964nZKQ uW685oY33l4Cn4AuVB2u1naXq52qnbe8Mb0/CcIkcqfaX/hO0PzoJ0cF6PTrq6gv0HgfYW 1E2POPsfjnOMHFzlaiVQACMSMniI/yj0w4os1As9KkTpuhQTQtuZAGG0rOlXGg== 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=1698175554; 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=h7H1jFfyf9w+Lte4nZ++GGBLkZBKfPxdADeAp9BOFRg=; b=LD4NNaLN5hR2DbE/SIDXoBqGPXtiDKqOqbUaBIrjVOYG9G1rLeb1f/KzOBBW8yN8HbGgsT U7CPGj73W2aqbFgQkBgtqPHrD3QQ81gVArC9/juw7g9jK8ZBkrOV+TjCwqQmcp+MbcklM2 oZ/HD4qcFe6/gzSasJDguXU7lKNNFYxc7VGVh+Rhi2Sdn+XAIZrlWin/tyHDRuGV8stVx9 QktvOrh47VQ7WP7BDUMfj6+qmq3LGLJ5j5AolbHMS5Y/6usKAPTS5p0lh9uABzgUlMXJk3 j4w1r/YLqa22lTocXydyxxqlfMn5/KkdaT2oRZdFAwGUJCOWDcpsfw/6+P5uVg== 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 4SFMVB5S23zbF9; Tue, 24 Oct 2023 19:25:54 +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 39OJPswL074099; Tue, 24 Oct 2023 19:25:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39OJPsJt074096; Tue, 24 Oct 2023 19:25:54 GMT (envelope-from git) Date: Tue, 24 Oct 2023 19:25:54 GMT Message-Id: <202310241925.39OJPsJt074096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c8cf2d161390 - stable/14 - Add support for Chacha20-Poly1305 to kernel TLS on FreeBSD. 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c8cf2d16139042dd9eb3ba0324c88c4cfffe7d93 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c8cf2d16139042dd9eb3ba0324c88c4cfffe7d93 commit c8cf2d16139042dd9eb3ba0324c88c4cfffe7d93 Author: John Baldwin AuthorDate: 2020-12-23 22:09:51 +0000 Commit: John Baldwin CommitDate: 2023-10-24 19:02:09 +0000 Add support for Chacha20-Poly1305 to kernel TLS on FreeBSD. FreeBSD's kernel TLS supports Chacha20 for both TLS 1.2 and TLS 1.3. Obtained from: OpenSSL commit 77f3936928068bee9d7e0c6939709ac179cb1059 (cherry picked from commit 3de4f78d46c58f23017942967ec74cbc3d2e175d) --- crypto/openssl/include/internal/ktls.h | 5 +++++ crypto/openssl/ssl/ktls.c | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/crypto/openssl/include/internal/ktls.h b/crypto/openssl/include/internal/ktls.h index 95492fd0659f..3c82cae26b47 100644 --- a/crypto/openssl/include/internal/ktls.h +++ b/crypto/openssl/include/internal/ktls.h @@ -40,6 +40,11 @@ # define OPENSSL_KTLS_AES_GCM_128 # define OPENSSL_KTLS_AES_GCM_256 # define OPENSSL_KTLS_TLS13 +# ifdef TLS_CHACHA20_IV_LEN +# ifndef OPENSSL_NO_CHACHA +# define OPENSSL_KTLS_CHACHA20_POLY1305 +# endif +# endif typedef struct tls_enable ktls_crypto_info_t; diff --git a/crypto/openssl/ssl/ktls.c b/crypto/openssl/ssl/ktls.c index ddbfd1447c54..daa758294a4c 100644 --- a/crypto/openssl/ssl/ktls.c +++ b/crypto/openssl/ssl/ktls.c @@ -37,6 +37,10 @@ int ktls_check_supported_cipher(const SSL *s, const EVP_CIPHER *c, case SSL_AES128GCM: case SSL_AES256GCM: return 1; +# ifdef OPENSSL_KTLS_CHACHA20_POLY1305 + case SSL_CHACHA20POLY1305: + return 1; +# endif case SSL_AES128: case SSL_AES256: if (s->ext.use_etm) @@ -74,6 +78,12 @@ int ktls_configure_crypto(const SSL *s, const EVP_CIPHER *c, EVP_CIPHER_CTX *dd, else crypto_info->iv_len = EVP_GCM_TLS_FIXED_IV_LEN; break; +# ifdef OPENSSL_KTLS_CHACHA20_POLY1305 + case SSL_CHACHA20POLY1305: + crypto_info->cipher_algorithm = CRYPTO_CHACHA20_POLY1305; + crypto_info->iv_len = EVP_CIPHER_CTX_get_iv_length(dd); + break; +# endif case SSL_AES128: case SSL_AES256: switch (s->s3.tmp.new_cipher->algorithm_mac) {