HomeFreeBSD

Change return types of hash update functions in SHA-NI

Description

Change return types of hash update functions in SHA-NI

r359374 introduced crypto_apply function which takes as argument a function pointer
that is expected to return an int, however aesni hash update functions
return void.
Because of that the function pointer passed was simply cast with
its return value changed.
This resulted in undefined behavior, in particular when mbuf is used, (ipsec)
m_apply checks return value of function pointer passed to it
and in our case bogusly fails after calculating hash of the first mbuf
in chain.
Fix it by changing signatures of sha update routines in aesni and
dropping the casts.

Submitted by: Kornel Duleba
Reviewed by: jhb, cem
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D25030

Details

Provenance
mwAuthored on
Reviewer
jhb
Differential Revision
D25030: Change return types of hash update functions in SHA-NI
Parents
rS361582: Fix check for wMaxPacketSize in USB bluetooth driver,
Branches
Unknown
Tags
Unknown