From 6e17a2e00d62fd3041e0bb511fe925079ad1c0d7 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 9 Dec 2021 11:52:41 -0800 Subject: crypto: Validate AES-GCM IV length in check_csp(). This centralizes the check for valid nonce lengths for AES-GCM. While here, remove some duplicate checks for valid AES-GCM tag lengths from ccp(4) and ccr(4). Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33194 --- sys/opencrypto/cryptosoft.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'sys/opencrypto/cryptosoft.c') diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c index f8dfef5323d5..5013cf145288 100644 --- a/sys/opencrypto/cryptosoft.c +++ b/sys/opencrypto/cryptosoft.c @@ -1308,9 +1308,6 @@ swcr_setup_gcm(struct swcr_session *ses, struct swcr_auth *swa; const struct auth_hash *axf; - if (csp->csp_ivlen != AES_GCM_IV_LEN) - return (EINVAL); - /* First, setup the auth side. */ swa = &ses->swcr_auth; switch (csp->csp_cipher_klen * 8) { -- cgit v1.3