nts: don't allow malformed encrypted extension fields

Require data decrypted from the NTS authenticator field to contain
correctly formatted extension fields (known or unknown).
This commit is contained in:
Miroslav Lichvar
2020-07-20 13:38:22 +02:00
parent 77bd0f83fe
commit fd8fbcd090
2 changed files with 8 additions and 4 deletions

View File

@@ -352,8 +352,10 @@ extract_cookies(NNC_Instance inst, unsigned char *plaintext, int length)
for (parsed = 0; parsed < length; parsed += ef_length) {
if (!NEF_ParseSingleField(plaintext, length, parsed,
&ef_length, &ef_type, &ef_body, &ef_body_length))
break;
&ef_length, &ef_type, &ef_body, &ef_body_length)) {
DEBUG_LOG("Could not parse encrypted EF");
return 0;
}
if (ef_type != NTP_EF_NTS_COOKIE)
continue;