[Git][NTPsec/ntpsec][master] tests/ntpd/nts_extens.c: check AES_SIV_CTX_new() in build_request()

Matt Selsky (@selsky) gitlab at mg.gitlab.com
Fri Oct 23 00:46:29 UTC 2026



Matt Selsky pushed to branch master at NTPsec / ntpsec


Commits:
937ae9dc by Matt Selsky at 2026-10-22T20:18:30-04:00
tests/ntpd/nts_extens.c: check AES_SIV_CTX_new() in build_request()

build_request() passed the result of AES_SIV_CTX_new() to
AES_SIV_Encrypt() without checking it, so a failed allocation would
crash the test instead of failing it (Coverity CID 658510).

- - - - -


1 changed file:

- tests/ntpd/nts_extens.c


Changes:

=====================================
tests/ntpd/nts_extens.c
=====================================
@@ -253,6 +253,7 @@ static int build_request(uint8_t *pkt, size_t pktlen,
 	nonce = buf.next;
 	memset(nonce, 0xA5, noncelen);
 	ctx = AES_SIV_CTX_new();
+	TEST_ASSERT_NOT_NULL(ctx);
 	TEST_ASSERT_TRUE(AES_SIV_Encrypt(ctx, nonce + noncepad, &outlen,
 					 c2s, 32, nonce, noncelen,
 					 plain, plainlen, pkt, adlength));



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/937ae9dc31e43e3237b84372505495948ec6f02d

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/937ae9dc31e43e3237b84372505495948ec6f02d
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20261023/309d8df3/attachment.htm>


More information about the vc mailing list