]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix requests for "plain" SHA digests of an empty buffer.
authorjhb <jhb@FreeBSD.org>
Wed, 24 Apr 2019 23:18:10 +0000 (23:18 +0000)
committerjhb <jhb@FreeBSD.org>
Wed, 24 Apr 2019 23:18:10 +0000 (23:18 +0000)
commit082c6b646e9ec2830ade506a5f1946eb24d127b0
treea54c8ae4343be06bcc452d3c16ef0f42b4353a53
parenta57a65124eb733cc55aaec43c7287060e5c52bd2
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
sys/dev/cxgbe/crypto/t4_crypto.c