aboutsummaryrefslogtreecommitdiff
path: root/sys/opencrypto
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2021-12-09 19:52:41 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2021-12-09 19:52:41 +0000
commit6e17a2e00d62fd3041e0bb511fe925079ad1c0d7 (patch)
tree56cbe69a74e6b10de1c360f8e4bee12bb5947e17 /sys/opencrypto
parentec498562b71a5e2baee3556eed7e22947f7abc5d (diff)
Diffstat (limited to 'sys/opencrypto')
-rw-r--r--sys/opencrypto/crypto.c5
-rw-r--r--sys/opencrypto/cryptosoft.c3
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c
index cc0e5860c882..1fe8a1377157 100644
--- a/sys/opencrypto/crypto.c
+++ b/sys/opencrypto/crypto.c
@@ -851,7 +851,10 @@ check_csp(const struct crypto_session_params *csp)
return (false);
break;
case CRYPTO_AES_NIST_GCM_16:
- if (csp->csp_auth_mlen > 16)
+ if (csp->csp_auth_mlen > AES_GMAC_HASH_LEN)
+ return (false);
+
+ if (csp->csp_ivlen != AES_GCM_IV_LEN)
return (false);
break;
case CRYPTO_CHACHA20_POLY1305:
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) {