mirror of
https://github.com/ipxe/ipxe
synced 2026-10-07 15:05:42 +03:00
[test] Allow for HMAC tests with partial expected output digest values
Some public HMAC test vectors provide expected output digest values that are shorter than the digest size. Allow HMAC tests to provide expected output digest values of any non-zero length up to and including the digest size, so that we can use these public test vectors without needing to synthesize the remainder of the output digest value. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -108,7 +108,8 @@ static void hmac_okx ( struct hmac_test *test, const char *file,
|
||||
okx ( sizeof ( ctx ) == ( digest->ctxsize + digest->blocksize ),
|
||||
file, line );
|
||||
okx ( sizeof ( key ) == digest->blocksize, file, line );
|
||||
okx ( test->expected_len == digest->digestsize, file, line );
|
||||
okx ( test->expected_len > 0, file, line );
|
||||
okx ( test->expected_len <= digest->digestsize, file, line );
|
||||
|
||||
/* Calculate HMAC */
|
||||
DBGC ( test, "HMAC-%s key:\n", digest->name );
|
||||
|
||||
Reference in New Issue
Block a user