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:
@@ -467,6 +467,14 @@ METHOD(payload_t, verify, status_t,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case COOKIE:
|
||||||
|
{
|
||||||
|
if (this->notify_data.len < 1 || this->notify_data.len > 64)
|
||||||
|
{
|
||||||
|
bad_length = TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case ADDITIONAL_IP4_ADDRESS:
|
case ADDITIONAL_IP4_ADDRESS:
|
||||||
{
|
{
|
||||||
if (this->notify_data.len != 4)
|
if (this->notify_data.len != 4)
|
||||||
|
|||||||
Reference in New Issue
Block a user