HomeFreeBSD

MFC 346648: Fix requests for "plain" SHA digests of an empty buffer.

Description

MFC 346648: Fix requests for "plain" SHA digests of an empty buffer.

To workaround limitations in the crypto engine, empty buffers are
handled by manually constructing the final length block as the payload
passed to the crypto engine and disabling the normal "final" handling.
For HMAC this length block should hold the length of a single block
since the hash is actually the hash of the IPAD digest, but for
"plain" SHA the length should be zero instead.

Details

Provenance
jhbAuthored on
Parents
rS348199: random(4): deduplicate explicit_bzero() in harvest
Branches
Unknown
Tags
Unknown