git: 70dbebea1242 - main - cryptodev: Permit CIOCCRYPT for AEAD ciphers.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 06 Oct 2021 21:10:27 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=70dbebea124236184a66a30175ba307793971f00
commit 70dbebea124236184a66a30175ba307793971f00
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2021-10-06 21:08:47 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2021-10-06 21:08:47 +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
---
sys/opencrypto/cryptodev.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c
index 6614c8f60676..3224ed3f900c 100644
--- a/sys/opencrypto/cryptodev.c
+++ b/sys/opencrypto/cryptodev.c
@@ -864,6 +864,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: