Page MenuHomeFreeBSD

crypto: Refactor software support for AEAD ciphers.
ClosedPublic

Authored by jhb on Nov 30 2021, 5:18 PM.
Tags
None
Referenced Files
F137698018: D33196.id99781.diff
Mon, Nov 24, 11:27 PM
F137504106: D33196.diff
Mon, Nov 24, 12:43 AM
Unknown Object (File)
Sun, Nov 16, 9:17 AM
Unknown Object (File)
Sun, Nov 9, 11:36 AM
Unknown Object (File)
Sun, Nov 9, 11:33 AM
Unknown Object (File)
Sun, Nov 9, 2:03 AM
Unknown Object (File)
Fri, Oct 31, 1:39 AM
Unknown Object (File)
Tue, Oct 28, 5:46 AM
Subscribers

Details

Summary

Extend struct enc_xform to add new members to handle auth operations
for AEAD ciphers. In particular, AEAD operations in cryptosoft no
longer use a struct auth_hash. Instead, the setkey and reinit methods
of struct enc_xform are responsible for initializing both the cipher
and auth state.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Nov 30 2021, 5:18 PM
This revision is now accepted and ready to land.Dec 3 2021, 2:55 PM
sys/opencrypto/xform_aes_icm.c
129

So this was a bug (I forgot to change this to aes_ccm_setkey) that the compiler warned about (unused function).

I had used '-d soft' instead of '-d cryptosoft0' when testing and device aesni in GENERIC meant I was testing aesni originally.

When I retested in a VM to make sure this broke, I actually killed bhyve as the uninitialized AES_CBC_MAC state caused a wild pointer passed to a xor instruction to trigger an EPT page fault (maybe it was to an MMIO region?) and bhyve died with an abort trap. Fun times.