nts: zero cookie placeholder
Zero the body of the cookie placeholder in client requests as recommended by the latest NTS draft.
This commit is contained in:
parent
eedabb3d27
commit
9b98247d9c
1 changed files with 4 additions and 2 deletions
|
@ -288,6 +288,7 @@ NNC_GenerateRequestAuth(NNC_Instance inst, NTP_Packet *packet,
|
||||||
{
|
{
|
||||||
NKE_Cookie *cookie;
|
NKE_Cookie *cookie;
|
||||||
int i, req_cookies;
|
int i, req_cookies;
|
||||||
|
void *ef_body;
|
||||||
|
|
||||||
if (inst->num_cookies == 0 || !inst->siv_c2s)
|
if (inst->num_cookies == 0 || !inst->siv_c2s)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -308,9 +309,10 @@ NNC_GenerateRequestAuth(NNC_Instance inst, NTP_Packet *packet,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (i = 0; i < req_cookies - 1; i++) {
|
for (i = 0; i < req_cookies - 1; i++) {
|
||||||
if (!NEF_AddField(packet, info, NTP_EF_NTS_COOKIE_PLACEHOLDER,
|
if (!NEF_AddBlankField(packet, info, NTP_EF_NTS_COOKIE_PLACEHOLDER,
|
||||||
cookie->cookie, cookie->length))
|
cookie->length, &ef_body))
|
||||||
return 0;
|
return 0;
|
||||||
|
memset(ef_body, 0, cookie->length);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!NNA_GenerateAuthEF(packet, info, inst->siv_c2s, inst->nonce, sizeof (inst->nonce),
|
if (!NNA_GenerateAuthEF(packet, info, inst->siv_c2s, inst->nonce, sizeof (inst->nonce),
|
||||||
|
|
Loading…
Reference in a new issue