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
F151999414: D26688.id77949.diff
Sun, Apr 12, 12:37 AM
F151995043: D26688.id77916.diff
Sun, Apr 12, 12:04 AM
Unknown Object (File)
Sat, Apr 11, 1:33 AM
Unknown Object (File)
Sun, Apr 5, 3:04 PM
Unknown Object (File)
Sat, Apr 4, 8:44 PM
Unknown Object (File)
Sat, Apr 4, 4:05 PM
Unknown Object (File)
Mon, Mar 30, 9:04 AM
Unknown Object (File)
Thu, Mar 26, 3:42 PM
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

Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 34006
Build 31195: arc lint + arc unit

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

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

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.