This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new d222f245a testing/crypto: fix HMAC-SHA224 long-key expected values
d222f245a is described below
commit d222f245a6c3bfc37d43e870fabd4dbaef92d324
Author: makejian <[email protected]>
AuthorDate: Mon Nov 9 22:12:53 2026 +0800
testing/crypto: fix HMAC-SHA224 long-key expected values
Commit c91322216b38 ("testing/crypto: add SHA2-224 HMAC test case")
added the SHA224 expected digests to sha224_result[]. The values for
the two 131-byte key cases do not match HMAC-SHA224, so the hmac test
reports a mismatch for both even though /dev/crypto returns the correct
value.
Replace them with the values from RFC 4231 test cases 6 and 7, which use
the same key and data. All other expected values in the test already
match.
Fixes: c91322216b38 ("testing/crypto: add SHA2-224 HMAC test case")
Signed-off-by: makejian <[email protected]>
---
testing/drivers/crypto/hmac.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/testing/drivers/crypto/hmac.c b/testing/drivers/crypto/hmac.c
index 3f1955b24..c4a35b0f1 100644
--- a/testing/drivers/crypto/hmac.c
+++ b/testing/drivers/crypto/hmac.c
@@ -137,10 +137,10 @@ FAR char *sha224_result[] =
"\x8b\xbe\xa2\xa3\x9e\x61\x48\x00\x8f\xd0\x5e\x44",
"\xcb\xff\x7c\x27\x16\xbb\xaa\x7c\x77\xbe\xd4\xf4\x91\xd3\xe8\x45"
"\x6c\xb6\xc5\x74\xe9\x2f\x67\x2b\x29\x1a\xcf\x5b",
- "\x1b\xf1\xc2\x0e\x5b\x2e\x25\x3f\x51\x39\x5e\x1f\x22\xe1\x52\x06"
- "\xb3\x99\x24\x1d\x72\xa9\xa1\xa4\x60\x2d\x3e\x31",
- "\x76\x7d\xf3\x5c\x24\xcd\x61\xa4\xd7\xd3\xf0\xf4\xc3\xa2\xf2\x53"
- "\x99\x8a\x1e\x4a\x4e\x54\x22\x3c\x19\x95\x14\x10"
+ "\x95\xe9\xa0\xdb\x96\x20\x95\xad\xae\xbe\x9b\x2d\x6f\x0d\xbc\xe2"
+ "\xd4\x99\xf1\x12\xf2\xd2\xb7\x27\x3f\xa6\x87\x0e",
+ "\x3a\x85\x41\x66\xac\x5d\x9f\x02\x3f\x54\xd5\x17\xd0\xb3\x9d\xbd"
+ "\x94\x67\x70\xdb\x9c\x2b\x95\xc9\xf6\xf5\x65\xd1"
};
FAR char *sha256_result[] =