ikev2: Check the length of received COOKIE notifies

As specified by RFC 7296, section 2.6, the data associated with COOKIE
notifications MUST be between 1 and 64 octets in length (inclusive).

Fixes #3160.
This commit is contained in:
Tobias Brunner
2019-08-28 12:15:27 +02:00
parent 8cd5f33dd8
commit 902f38dd3e
@@ -467,6 +467,14 @@ METHOD(payload_t, verify, status_t,
}
break;
}
case COOKIE:
{
if (this->notify_data.len < 1 || this->notify_data.len > 64)
{
bad_length = TRUE;
}
break;
}
case ADDITIONAL_IP4_ADDRESS:
{
if (this->notify_data.len != 4)