HomeFreeBSD

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

Description

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.

Reported by: NIST SHA1 test failure
MFC after: 2 weeks
Sponsored by: Chelsio Communications

Details

Provenance
jhbAuthored on
Parents
rS346647: [acpi_ibm] Add support for newer Thinkpad models
Branches
Unknown
Tags
Unknown