Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 May 2019 21:52:24 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r348202 - stable/12/sys/opencrypto
Message-ID:  <201905232152.x4NLqOJV077670@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu May 23 21:52:24 2019
New Revision: 348202
URL: https://svnweb.freebsd.org/changeset/base/348202

Log:
  MFC 346649: Don't panic for empty CCM requests.
  
  A request to encrypt an empty payload without any AAD is unusual, but
  it is defined behavior.  Removing this assertion removes a panic and
  instead returns the correct tag for an empty buffer.

Modified:
  stable/12/sys/opencrypto/cbc_mac.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/opencrypto/cbc_mac.c
==============================================================================
--- stable/12/sys/opencrypto/cbc_mac.c	Thu May 23 21:23:18 2019	(r348201)
+++ stable/12/sys/opencrypto/cbc_mac.c	Thu May 23 21:52:24 2019	(r348202)
@@ -82,9 +82,6 @@ AES_CBC_MAC_Reinit(struct aes_cbc_mac_ctx *ctx, const 
 	uint8_t *bp = b0, flags = 0;
 	uint8_t L = 0;
 	uint64_t dataLength = ctx->cryptDataLength;
-	
-	KASSERT(ctx->authDataLength != 0 || ctx->cryptDataLength != 0,
-	    ("Auth Data and Data lengths cannot both be 0"));
 
 	KASSERT(nonceLen >= 7 && nonceLen <= 13,
 	    ("nonceLen must be between 7 and 13 bytes"));



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