Skip to content

Commit

Permalink
fixup! IKEv2: improve dissection of IKEv2 redirect notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
mspncp committed Mar 5, 2023
1 parent 1fd673b commit eb97f7b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scapy/contrib/ikev2.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,10 @@ class IKEv2_Notify(IKEv2_Payload):
FieldLenField("SPIsize", None, "SPI", "B"),
ShortEnumField("type", 0, IKEv2NotifyMessageTypes),
XStrLenField("SPI", "", length_from=lambda pkt: pkt.SPIsize),
XStrLenField("notify", "", length_from=lambda pkt: pkt.length - 8),
ConditionalField(
XStrLenField("notify", "", length_from=lambda pkt: pkt.length - 8),
lambda pkt: pkt.type not in (16407, 16408)
),
ConditionalField(
# REDIRECT, REDIRECTED_FROM (RFC 5685)
ByteEnumField("gw_id_type", 1, IKEv2GatewayIDTypes),
Expand Down

0 comments on commit eb97f7b

Please sign in to comment.