nts: reset NAK indicator with new request

Don't restart NTS-KE if a spoofed NAK response was received and no valid
response is received for a subsequent request.
This commit is contained in:
Miroslav Lichvar
2020-07-20 16:31:49 +02:00
parent fd8fbcd090
commit cc20ead3dc
3 changed files with 7 additions and 4 deletions

View File

@@ -82,9 +82,11 @@ get_request(NNC_Instance inst)
info.mode = MODE_CLIENT;
info.length = random() % (sizeof (packet) + 1);
inst->num_cookies = 0;
if (inst->num_cookies > 0 && random() % 2) {
inst->num_cookies = 0;
TEST_CHECK(!NNC_GenerateRequestAuth(inst, &packet, &info));
TEST_CHECK(!NNC_GenerateRequestAuth(inst, &packet, &info));
}
while (!NNC_PrepareForAuth(inst)) {
inst->next_nke_attempt = SCH_GetLastEventMonoTime() + random() % 10 - 7;