aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2021-10-06 21:08:48 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2021-10-06 21:08:48 +0000
commit366ae4a000b1483390ddbf28e3dc420ebac894a0 (patch)
treeee803b83c6d4074b110dbb838cbdb43608b3b924 /sys
parent2ec2e4df094ba632e5e74268a8818f71903a4537 (diff)
downloadsrc-366ae4a000b1483390ddbf28e3dc420ebac894a0.tar.gz
src-366ae4a000b1483390ddbf28e3dc420ebac894a0.zip
safexcel: Support truncated tags for AES-CCM.
Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32119
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/safexcel/safexcel.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/dev/safexcel/safexcel.c b/sys/dev/safexcel/safexcel.c
index 042fac5fc2b8..b844a167b078 100644
--- a/sys/dev/safexcel/safexcel.c
+++ b/sys/dev/safexcel/safexcel.c
@@ -1735,7 +1735,7 @@ safexcel_instr_ccm(struct safexcel_request *req, struct safexcel_instr *instr,
memset(b0, 0, blen);
b0[0] =
(L - 1) | /* payload length size */
- ((CCM_CBC_MAX_DIGEST_LEN - 2) / 2) << 3 /* digest length */ |
+ ((req->sess->digestlen - 2) / 2) << 3 /* digest length */ |
(crp->crp_aad_length > 0 ? 1 : 0) << 6 /* AAD present bit */;
memcpy(&b0[1], req->iv, csp->csp_ivlen);
b0[14] = crp->crp_payload_length >> 8;
@@ -2314,9 +2314,6 @@ safexcel_probesession(device_t dev, const struct crypto_session_params *csp)
return (EINVAL);
break;
case CRYPTO_AES_CCM_16:
- if (csp->csp_auth_mlen != 0 &&
- csp->csp_auth_mlen != AES_CBC_MAC_HASH_LEN)
- return (EINVAL);
break;
default:
return (EINVAL);