Skip to content

Commit

Permalink
Fixed ESP padding in decryption
Browse files Browse the repository at this point in the history
  • Loading branch information
ppachocki authored and gpotter2 committed Feb 4, 2024
1 parent 9857163 commit 03bb705
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scapy/layers/ipsec.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,8 @@ def decrypt(self, sa, esp, key, icv_size=None, esn_en=False, esn=0):
nh = orb(data[-1])

# then use padlen to determine data and padding
data = data[:len(data) - padlen - 2]
padding = data[len(data) - padlen - 2: len(data) - 2]
data = data[:len(data) - padlen - 2]

return _ESPPlain(spi=esp.spi,
seq=esp.seq,
Expand Down

0 comments on commit 03bb705

Please sign in to comment.