ikev1: Accept IPComp proposals with 4 octet long CPI values
While they SHOULD be sent as 16-bit values according to RFC 3173 a responder MUST be able to accept CPI values encoded in four bytes.
This commit is contained in:
parent
42e0a317c6
commit
4141f01671
|
@ -345,7 +345,7 @@ METHOD(payload_t, verify, status_t,
|
|||
switch (this->protocol_id)
|
||||
{
|
||||
case PROTO_IPCOMP:
|
||||
if (this->spi.len != 2)
|
||||
if (this->spi.len != 2 && this->spi.len != 4)
|
||||
{
|
||||
DBG1(DBG_ENC, "invalid CPI length in IPCOMP proposal");
|
||||
return FAILED;
|
||||
|
@ -536,7 +536,7 @@ METHOD(proposal_substructure_t, get_cpi, bool,
|
|||
{
|
||||
if (cpi)
|
||||
{
|
||||
*cpi = *((u_int16_t*)this->spi.ptr);
|
||||
*cpi = htons(untoh16(this->spi.ptr + this->spi.len - 2));
|
||||
}
|
||||
enumerator->destroy(enumerator);
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in New Issue