Page MenuHomeFreeBSD

Simplify swcr_authcompute() after removal of deprecated algorithms.
ClosedPublic

Authored by jhb on Oct 5 2020, 8:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 22 2024, 4:43 PM
Unknown Object (File)
Sep 20 2024, 6:07 AM
Unknown Object (File)
Sep 17 2024, 4:52 AM
Unknown Object (File)
Sep 8 2024, 8:31 AM
Unknown Object (File)
Sep 6 2024, 3:17 PM
Unknown Object (File)
Sep 4 2024, 10:13 PM
Unknown Object (File)
Aug 19 2024, 2:02 AM
Unknown Object (File)
Aug 18 2024, 8:13 AM
Subscribers

Details

Summary
  • Just use sw->octx != NULL to handle the HMAC case when finalizing the MAC.
  • Explicitly zero the on-stack auth context.
Test Plan
  • cryptocheck -d soft -all -z
  • also tested with some KTLS changes which used HMAC with AES-CBC

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Oct 5 2020, 8:41 PM
jhb created this revision.
markj added inline comments.
sys/opencrypto/cryptosoft.c
361 ↗(On Diff #77916)

We are now doing some extra work for CRYPTO_NULL_HMAC, but I doubt it matters in any meaningful way.

This revision is now accepted and ready to land.Oct 6 2020, 12:32 PM
sys/opencrypto/cryptosoft.c
361 ↗(On Diff #77916)

Ah, the correct fix for that would be to not allocate a sw_octx for NULL_HMAC then. However, it's probably not worth fixing. I do think the real solution for NULL_CBC and NULL_HMAC is that IPsec should handle NULL ciphers explicitly and not (ab)use OCF. That would avoid the need for having to deal with the context switches, etc.