]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
cryptotest.py: Actually use NIST-KAT HMAC test vectors and test the right hashes
authorConrad Meyer <cem@FreeBSD.org>
Thu, 21 Sep 2017 21:07:21 +0000 (21:07 +0000)
committerConrad Meyer <cem@FreeBSD.org>
Thu, 21 Sep 2017 21:07:21 +0000 (21:07 +0000)
commit005fdbbc692736b34f73a955a660edc167923e28
treebc69554e57c4157686434f73177566680437807c
parenta0fcc37122c34f8d011c9ca69e6b876c1b29fcb9
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
tests/sys/opencrypto/cryptotest.py