]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC 323891,323892: Support EtA requests via /dev/crypto.
authorjhb <jhb@FreeBSD.org>
Mon, 11 Mar 2019 21:35:56 +0000 (21:35 +0000)
committerjhb <jhb@FreeBSD.org>
Mon, 11 Mar 2019 21:35:56 +0000 (21:35 +0000)
commitf613d49be7a46966e4686d1d19edbba3b0a98c88
tree7ae23466a4ffb79bdf9f657bcdd1fc2a21bb932c
parent69cfc97effbccf3a9d03e41c5426515bb69fbb06
MFC 323891,323892: Support EtA requests via /dev/crypto.

323891:
Add a new COP_F_CIPHER_FIRST flag for struct crypt_op.

This requests that the cipher be performed before rather than after
the HMAC when both are specified for a single operation.

323892:
Support AEAD requests with non-GCM algorithms.

In particular, support chaining an AES cipher with an HMAC for a request
including AAD.  This permits submitting requests from userland to encrypt
objects like IPSec packets using these algorithms.

In the non-GCM case, the authentication crypto descriptor covers both the
AAD and the ciphertext.  The GCM case remains unchanged.  This matches
the requests created internally in IPSec.  For the non-GCM case, the
COP_F_CIPHER_FIRST is also supported since the ordering matters.

Note that while this can be used to simulate IPSec requests from userland,
this ioctl cannot currently be used to perform TLS requests using AES-CBC
and MAC-before-encrypt.

Sponsored by: Chelsio Communications
share/man/man4/crypto.4
sys/opencrypto/cryptodev.c
sys/opencrypto/cryptodev.h