HomeFreeBSD

cryptotest.py: Actually use NIST-KAT HMAC test vectors and test the right hashes

Description

cryptotest.py: Actually use NIST-KAT HMAC test vectors and test the right hashes

Previously, this test was entirely a no-op as no vector in the NIST-KAT file
has a precisely 20-byte key.

Additionally, not every vector in the file is SHA1. The length field
determines the hash under test, and is now decoded correctly.

Finally, due to a limitation I didn't feel like fixing in cryptodev.py, MACs
are truncated to 16 bytes in this test.

With this change and the uncommitted D12437 (to allow key sizes other than
those used in IPSec), the SHA tests in cryptotest.py actually test something
and e.g. at least cryptosoft passes the test.

Sponsored by: Dell EMC Isilon

Details

Provenance
cemAuthored on
Parents
rS323877: MFC 323025: Read max_stack_flags from correct object.
Branches
Unknown
Tags
Unknown