Page MenuHomeFreeBSD

Place the AAD before the plaintext/ciphertext for CIOCRYPTAEAD.
ClosedPublic

Authored by jhb on Jul 27 2017, 9:41 PM.
Tags
None
Referenced Files
F165285354: D11758.id.diff
Fri, Aug 7, 10:17 AM
Unknown Object (File)
Sun, Aug 2, 11:00 PM
Unknown Object (File)
Fri, Jul 31, 1:44 AM
Unknown Object (File)
Tue, Jul 28, 11:44 PM
Unknown Object (File)
Mon, Jul 27, 1:03 AM
Unknown Object (File)
Sat, Jul 25, 1:41 AM
Unknown Object (File)
Thu, Jul 23, 9:41 AM
Unknown Object (File)
Thu, Jul 16, 2:33 AM

Details

Summary

Place the AAD before the plaintext/ciphertext for CIOCRYPTAEAD.

Software crypto implementations don't care how the buffer is laid out,
but hardware implementations may assume that the AAD is always before
the plain/cipher text and that the hash/tag is immediately after the end
of the plain/cipher text.

In particular, this arrangement matches the layout of both IPSec packets
and TLS frames. Linux's crypto framework also assumes this layout for
AEAD requests.

Test Plan
  • tested IPSec-like requests using the cryptocheck tool against the Chelsio ccr(4) driver and out-of-tree Intel qat(4) driver. Also verified no regressions with aesni0 or cryptosoft
  • note that I hacked ccr(4) to play crazy games with sglists to work around this issue (it will construct a S/G list that places the AAD first), but it is non-ideal as it results in more complicated S/G lists

Diff Detail

Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 10707
Build 11107: arc lint + arc unit