From nobody Thu Oct 21 17:06:53 2021 X-Original-To: dev-commits-src-branches@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 26FA018067D8; Thu, 21 Oct 2021 17:06:54 +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 4HZv655f9lz4gwF; Thu, 21 Oct 2021 17:06:53 +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 7ECE61F097; Thu, 21 Oct 2021 17:06:53 +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 19LH6r6W080122; Thu, 21 Oct 2021 17:06:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19LH6rlo080121; Thu, 21 Oct 2021 17:06:53 GMT (envelope-from git) Date: Thu, 21 Oct 2021 17:06:53 GMT Message-Id: <202110211706.19LH6rlo080121@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: c3eec459b643 - stable/13 - cryptosoft: Support per-op keys for AES-GCM and AES-CCM. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: c3eec459b643f08a9af479b28a0789b655207617 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c3eec459b643f08a9af479b28a0789b655207617 commit c3eec459b643f08a9af479b28a0789b655207617 Author: John Baldwin AuthorDate: 2021-02-18 17:24:35 +0000 Commit: John Baldwin CommitDate: 2021-10-21 15:51:23 +0000 cryptosoft: Support per-op keys for AES-GCM and AES-CCM. Reviewed by: cem Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D28752 (cherry picked from commit a10020cfe2830e9626ac58ae97ecd12afb3553be) --- sys/opencrypto/cryptosoft.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c index 6ac628b9c21f..a09f085a1eef 100644 --- a/sys/opencrypto/cryptosoft.c +++ b/sys/opencrypto/cryptosoft.c @@ -537,6 +537,9 @@ swcr_gcm(struct swcr_session *ses, struct cryptop *crp) } } + if (crp->crp_cipher_key != NULL) + exf->setkey(swe->sw_kschedule, crp->crp_cipher_key, + crypto_get_params(crp->crp_session)->csp_cipher_klen); exf->reinit(swe->sw_kschedule, iv); /* Do encryption with MAC */ @@ -755,6 +758,9 @@ swcr_ccm(struct swcr_session *ses, struct cryptop *crp) if (error) return (error); + if (crp->crp_cipher_key != NULL) + exf->setkey(swe->sw_kschedule, crp->crp_cipher_key, + crypto_get_params(crp->crp_session)->csp_cipher_klen); exf->reinit(swe->sw_kschedule, iv); /* Do encryption/decryption with MAC */