From nobody Tue Jun 20 14:54:08 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 4QlqQm6kkzz4gT4R; Tue, 20 Jun 2023 14:54:08 +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 4QlqQm6JXlz4Llr; Tue, 20 Jun 2023 14:54:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687272848; 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=PLaLtXBx4RvBw34LcQYSoH2cnNflYkMVtBo+z+HCkgU=; b=GeWF28voEVSHRIY+aUtP31GEMyX9MOfsQCQmaJpCxXQftqyW8CR4f+gkQu9B8FeIc0kiZX hjiq5nd5pVf1Y+alIz+PKl9gG3etwE4BiVteOZc7xRQAYRSHbr3nZvAq72QnP9hgl6/Rhu M7M+gfh7wNfsXs1dwWMRig+GMGzd4JjrJ8r25CbDBQjIzM4ATvIoNi9NWPiUUOw9yrBBEn kl6nfjuSFVi0WL19t4SKLPzL8vMhC5aHEAieuWGoMnqYznlo/EqMemZF+jgaw2lKDnEHBB N1EJbEjgpoaS7hKKqcN58Iloui7VxvEAwnSkFVrwwhMNAp+qxeaUbsGbObbOXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687272848; 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=PLaLtXBx4RvBw34LcQYSoH2cnNflYkMVtBo+z+HCkgU=; b=j339SxanQfYnee1LDUGc45ONjrpnPmzn2ajq8+pJvjl7N9yHY+/jVZJJLNnE7s+qNK1a/i rBbIW3QHJxb7VrsO6O/XFo9ccPssIc6XxhAVxVpX3nbRbLYH86zWQ1lT3fg3EpUN5PMUId QMnHc0wk2vv8Hak2vd9VhJ8PPO5cc17bme4Nmm33fhCBWe6qhcdWUZ5UsZGj1Y3IouDEJh Pyq/X1hJpob2obRgQlZ1DV6YUKi7EHNzdKD9K4vVpvPVepOYx9MgcRe/mIc+MUVK2gDIl4 m/XKgZb6OJ/pekvHEPIqHeVvmD2ELbTbKmJb6Qw7n/K+Hus/LLC5Q7Cl8EeDgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687272848; a=rsa-sha256; cv=none; b=XtIaOel2BwzC//dXWrZyQvlE8Zwe+AwQl6KFnDn5zz8pNx4//p9leT//SNyn8tdRiqLv7k MiRDCv3d58TqLuwEy1sbGPcIFxu4szpbBgQT1OMqE6J4PYWeqDMWCdUlu17r0dL8VvPltJ U59+086UzCLq779ORh7ar+lzE0+cgfAL+4e82mivJD8cbaaQDgog5qnG2S4r2Py/rJrMMu X9OKzenA8JfYB/XIY8g9wFMUdW573NAeD0wDp3Q4vFzrB5WTWfQikfe10Ln1EjJoX/Iyfp LilHVfa0j0L7y2OhUMoKHscKhEg2BUm9NNPhB/S0lrMfBN8Ya6Suung6QyzlJQ== 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 4QlqQm5PdWz13TQ; Tue, 20 Jun 2023 14:54:08 +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 35KEs8Dm095323; Tue, 20 Jun 2023 14:54:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35KEs8LQ095322; Tue, 20 Jun 2023 14:54:08 GMT (envelope-from git) Date: Tue, 20 Jun 2023 14:54:08 GMT Message-Id: <202306201454.35KEs8LQ095322@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 474d9290eb9e - main - ossl: Don't try to initialize the cipher for Chacha20+Poly1305. 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/main X-Git-Reftype: branch X-Git-Commit: 474d9290eb9e9f0e636c7f814d0d10ba5147149f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=474d9290eb9e9f0e636c7f814d0d10ba5147149f commit 474d9290eb9e9f0e636c7f814d0d10ba5147149f Author: John Baldwin AuthorDate: 2023-06-20 14:53:50 +0000 Commit: John Baldwin CommitDate: 2023-06-20 14:53:50 +0000 ossl: Don't try to initialize the cipher for Chacha20+Poly1305. Chacha20+Poly1305 doesn't use an ossl_cipher instance the way AES-GCM does, so ossl_lookup_cipher() failed causing ossl_newsession() to always fail for Chacha20+Poly1305 sessions. Reported by: gallatin (ktls_test fails with ossl.ko loaded) Fixes: 9a3444d91c70 ossl: Add a VAES-based AES-GCM implementation for amd64 Tested by: gallatin Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D40580 --- sys/crypto/openssl/ossl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/crypto/openssl/ossl.c b/sys/crypto/openssl/ossl.c index 723d1a80543d..25897cae0dca 100644 --- a/sys/crypto/openssl/ossl.c +++ b/sys/crypto/openssl/ossl.c @@ -301,7 +301,8 @@ ossl_newsession(device_t dev, crypto_session_t cses, error = ossl_newsession_cipher(s, csp); break; case CSP_MODE_AEAD: - error = ossl_newsession_cipher(s, csp); + if (csp->csp_cipher_alg != CRYPTO_CHACHA20_POLY1305) + error = ossl_newsession_cipher(s, csp); break; default: __assert_unreachable();