test: fix cookie length in nts_ke_client unit test

This commit is contained in:
Miroslav Lichvar 2020-08-24 14:03:06 +02:00
parent 51172b3510
commit 9d88c028e2

View file

@ -92,7 +92,7 @@ prepare_response(NKSN_Instance session, int valid)
for (i = 0; i < NKE_MAX_COOKIES; i++) {
length = (random() % sizeof (data) + 1) / 4 * 4;
if (index == 9)
length += random() % 3 + 1;
length += (length < sizeof (data) ? 1 : -1) * (random() % 3 + 1);
TEST_CHECK(NKSN_AddRecord(session, 0, NKE_RECORD_COOKIE, data, length));
}
}