Skip to content

Commit 6f82e88

Browse files
exploidesolardiz
authored andcommitted
pcap2john: fix python3 incompatibility in pcap_parser_ah
see openwall#4653
1 parent 489a1ee commit 6f82e88

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

run/pcap2john.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1227,12 +1227,12 @@ def pcap_parser_ah(fname):
12271227
# zero mutable fields (tos, flags, chksum)
12281228
salt[1] = 0 # tos
12291229
salt[6] = 0 # flags
1230-
salt[10:12] = "\x00\x00" # checksum
1230+
salt[10:12] = b"\x00\x00" # checksum
12311231
icv_offset = iphdr_len + icv_length
12321232
h = salt[icv_offset:icv_offset+icv_length]
12331233
# zero ah icv
1234-
salt[icv_offset:icv_offset+icv_length] = "\x00" * icv_length
1235-
sys.stdout.write("$net-ah$0$%s$%s\n" % (hexlify(salt), hexlify(h)))
1234+
salt[icv_offset:icv_offset+icv_length] = b"\x00" * icv_length
1235+
sys.stdout.write("$net-ah$0$%s$%s\n" % (hexlify(salt).decode('ascii'), hexlify(h).decode('ascii')))
12361236

12371237
f.close()
12381238

0 commit comments

Comments
 (0)