Closed
Description
- This line of code makes sure the digest length matches the ECC508 buffer size. That means only 256-bit digests are supported (SHA256).
Longer digests could also be supported (e.g. SHA512). According the the NIST 186-4 section 6.4: "When the length of the output of the hash function is greater than the bit length of n, then the leftmost n bits of the hash function output block shall be used in any calculation using the hash function output during the generation or verification of a digital signature."
The proposed fix is to change this validation to only reject digests that are shorter than 256 bit (dgst_len < MEM_BLOCK_SIZE). This will remove the need to compile OpenSSL with -DOPENSSL_NO_SHA512.
The changed code works fine as tested with TLS client certificate authentication connecting to a plain Linux/Apache or Windows/IIS server.