From owner-svn-src-all@freebsd.org Sat Jan 27 07:41:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 389E1E74510; Sat, 27 Jan 2018 07:41:32 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2FB07B049; Sat, 27 Jan 2018 07:41:31 +0000 (UTC) (envelope-from cem@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 DDD7027736; Sat, 27 Jan 2018 07:41:31 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0R7fV0L018160; Sat, 27 Jan 2018 07:41:31 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0R7fV0u018159; Sat, 27 Jan 2018 07:41:31 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201801270741.w0R7fV0u018159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 27 Jan 2018 07:41:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328465 - head/sys/crypto/ccp X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/crypto/ccp X-SVN-Commit-Revision: 328465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jan 2018 07:41:32 -0000 Author: cem Date: Sat Jan 27 07:41:31 2018 New Revision: 328465 URL: https://svnweb.freebsd.org/changeset/base/328465 Log: ccp(4): Store IV in output buffer in GCM software fallback when requested Apply r328361 to duplicate copy of ccr_gcm_soft in ccp(4). Properly honor the lack of the CRD_F_IV_PRESENT flag in the GCM software fallback case for encryption requests. Modified: head/sys/crypto/ccp/ccp.c Modified: head/sys/crypto/ccp/ccp.c ============================================================================== --- head/sys/crypto/ccp/ccp.c Sat Jan 27 07:18:02 2018 (r328464) +++ head/sys/crypto/ccp/ccp.c Sat Jan 27 07:41:31 2018 (r328465) @@ -130,6 +130,9 @@ ccp_gcm_soft(struct ccp_session *s, struct cryptop *cr memcpy(iv, crde->crd_iv, 12); else arc4rand(iv, 12, 0); + if ((crde->crd_flags & CRD_F_IV_PRESENT) == 0) + crypto_copyback(crp->crp_flags, crp->crp_buf, + crde->crd_inject, 12, iv); } else { if (crde->crd_flags & CRD_F_IV_EXPLICIT) memcpy(iv, crde->crd_iv, 12);