Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Jan 2018 07:41:31 +0000 (UTC)
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r328465 - head/sys/crypto/ccp
Message-ID:  <201801270741.w0R7fV0u018159@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801270741.w0R7fV0u018159>