git: ac648e3affe3 - stable/13 - cryptodev: Permit CIOCCRYPT for AEAD ciphers.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 21 Oct 2021 22:04:13 UTC
The branch stable/13 has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=ac648e3affe358fb373cf369fb2ea46daceba250
commit ac648e3affe358fb373cf369fb2ea46daceba250
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2021-10-06 21:08:47 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2021-10-21 21:07:11 +0000
cryptodev: Permit CIOCCRYPT for AEAD ciphers.
A request without AAD for an AEAD cipher can be submitted via
CIOCCRYPT rather than CIOCCRYPTAEAD.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32108
(cherry picked from commit 70dbebea124236184a66a30175ba307793971f00)
---
sys/opencrypto/cryptodev.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c
index ffdf4c67d2f0..b449c7a12d9f 100644
--- a/sys/opencrypto/cryptodev.c
+++ b/sys/opencrypto/cryptodev.c
@@ -929,6 +929,13 @@ cryptodev_op(struct csession *cse, const struct crypt_op *cop)
goto bail;
}
break;
+ case CSP_MODE_AEAD:
+ if (cse->ivsize != 0 && cop->iv == NULL) {
+ SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__);
+ error = EINVAL;
+ goto bail;
+ }
+ /* FALLTHROUGH */
case CSP_MODE_ETA:
switch (cop->op) {
case COP_ENCRYPT: