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
This commit is contained in:
John Baldwin 2021-10-06 14:08:47 -07:00
parent 16676123fc
commit 70dbebea12

View File

@ -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: