Merge pull request #250 from 6WIND/ipsec-fuzz

layers/ipsec: fix padding problems with fuzzed packets
This commit is contained in:
Pierre Lalet 2016-09-23 09:30:11 +00:00 committed by GitHub
commit 5c74229bcf
1 changed files with 2 additions and 4 deletions

View File

@ -606,9 +606,6 @@ if AES and XCBCMAC:
icv_size=12, icv_size=12,
key_size=(16,)) key_size=(16,))
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
def split_for_transport(orig_pkt, transport_proto): def split_for_transport(orig_pkt, transport_proto):
""" """
@ -621,7 +618,8 @@ def split_for_transport(orig_pkt, transport_proto):
@return: a tuple (header, nh, payload) where nh is the protocol number of @return: a tuple (header, nh, payload) where nh is the protocol number of
payload. payload.
""" """
header = orig_pkt.copy() # force resolution of default fields to avoid padding errors
header = orig_pkt.__class__(str(orig_pkt))
next_hdr = header.payload next_hdr = header.payload
nh = None nh = None