From nobody Wed Oct 06 21:10:34 2021 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 0551612D40BD; Wed, 6 Oct 2021 21:10:37 +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 4HPnDD08JWz3HbX; Wed, 6 Oct 2021 21:10:36 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 7BBC626BD6; Wed, 6 Oct 2021 21:10:34 +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 196LAYr1059096; Wed, 6 Oct 2021 21:10:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 196LAY2c059095; Wed, 6 Oct 2021 21:10:34 GMT (envelope-from git) Date: Wed, 6 Oct 2021 21:10:34 GMT Message-Id: <202110062110.196LAY2c059095@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: c09c379c7aa7 - main - aesni: Permit AES-CCM requests with neither payload nor AAD. 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: c09c379c7aa7337680ff3cb73691ce12d627128b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c09c379c7aa7337680ff3cb73691ce12d627128b commit c09c379c7aa7337680ff3cb73691ce12d627128b Author: John Baldwin AuthorDate: 2021-10-06 21:08:47 +0000 Commit: John Baldwin CommitDate: 2021-10-06 21:08:47 +0000 aesni: Permit AES-CCM requests with neither payload nor AAD. Reviewed by: sef Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32114 --- sys/crypto/aesni/aesni_ccm.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/crypto/aesni/aesni_ccm.c b/sys/crypto/aesni/aesni_ccm.c index 9e2fa317b2ed..34b61a633907 100644 --- a/sys/crypto/aesni/aesni_ccm.c +++ b/sys/crypto/aesni/aesni_ccm.c @@ -205,9 +205,6 @@ AES_CCM_encrypt(const unsigned char *in, unsigned char *out, uint8_t *byte_ptr; __m128i s0, rolling_mac, s_x, staging_block; - if (nbytes == 0 && abytes == 0) - return; - /* NIST 800-38c section A.1 says n is [7, 13]. */ if (nlen < 7 || nlen > 13) panic("%s: bad nonce length %d", __FUNCTION__, nlen); @@ -377,8 +374,6 @@ AES_CCM_decrypt(const unsigned char *in, unsigned char *out, __m128i s0, rolling_mac, staging_block; uint8_t *byte_ptr; - if (nbytes == 0 && abytes == 0) - return (1); // No message means no decryption! if (nlen < 0 || nlen > 15) panic("%s: bad nonce length %d", __FUNCTION__, nlen);