royhills / ike-scan

The IKE Scanner
GNU General Public License v3.0
363 stars 59 forks source link

malformed test fails on big endian #20

Open xnox opened 7 years ago

xnox commented 7 years ago

malformed test fails compare ste on big endian

Checking ike-scan malformed packet against ./pkt-malformed.dat ...
/tmp/ike-scan-test.12963.tmp ./pkt-malformed.dat
CMP FAILED
FAIL check-packet (exit status: 1)

Binary attachments of produced result & pkg-malformed.dat that fail comparison are attached at https://bugs.launchpad.net/ubuntu/+source/ike-scan/+bug/1699072

This build fails on s390x.

royhills commented 7 years ago

Many thanks for reporting this.

I can see that the files generated on the s390x system are different from the reference file:

rsh@jessie:/tmp$ md5sum pkt-malformed.dat b29f37cfd4439e4cad653957651c2d84 pkt-malformed.dat rsh@jessie:/tmp$ md5sum ike-scan-test.12963.tmp eb32580b5f095837a2646db2072c8e5a ike-scan-test.12963.tmp

Looking at the hex dump, the differences appear to be consistent with an endian assumption:

rsh@jessie:/tmp$ xxd pkt-malformed.dat
0000000: dead beef dead beef dead beef dead beef  ................
0000010: 3932 067f 0000 04d2 0000 0205 0700 01d8  92..............
0000020: 0000 0002 0000 0003 0000 01cc 0104 0408  ................
0000030: 2f6b 0731 0300 0038 0105 0000 8001 0005  /k.1...8........
0000040: 8002 0002 8003 0003 8004 0002 800b 0001  ................
0000050: 000c 0004 0000 0020 800b 0002 000c 0004  ....... ........
0000060: 0000 0040 4000 0004 dead beef 0300 0038  ...@@..........8
0000070: 0205 0000 8001 0005 8002 0001 8003 0003  ................
0000080: 8004 0002 800b 0001 000c 0004 0000 0020  ...............
0000090: 800b 0002 000c 0004 0000 0040 4000 0004  ...........@@...
00000a0: dead beef 0300 0038 0305 0000 8001 0001  .......8........
00000b0: 8002 0002 8003 0003 8004 0002 800b 0001  ................
00000c0: 000c 0004 0000 0020 800b 0002 000c 0004  ....... ........
00000d0: 0000 0040 4000 0004 dead beef 0300 0038  ...@@..........8
00000e0: 0405 0000 8001 0001 8002 0001 8003 0003  ................
00000f0: 8004 0002 800b 0001 000c 0004 0000 0020  ...............
0000100: 800b 0002 000c 0004 0000 0040 4000 0004  ...........@@...
0000110: dead beef 0300 0038 0505 0000 8001 0005  .......8........
0000120: 8002 0002 8003 0003 8004 0001 800b 0001  ................
0000130: 000c 0004 0000 0020 800b 0002 000c 0004  ....... ........
0000140: 0000 0040 4000 0004 dead beef 0300 0038  ...@@..........8
0000150: 0605 0000 8001 0005 8002 0001 8003 0003  ................
0000160: 8004 0001 800b 0001 000c 0004 0000 0020  ...............
0000170: 800b 0002 000c 0004 0000 0040 4000 0004  ...........@@...
0000180: dead beef 0300 0038 0705 0000 8001 0001  .......8........
0000190: 8002 0002 8003 0003 8004 0001 800b 0001  ................
00001a0: 000c 0004 0000 0020 800b 0002 000c 0004  ....... ........
00001b0: 0000 0040 4000 0004 dead beef 0000 0038  ...@@..........8
00001c0: 0805 0000 8001 0001 8002 0001 8003 0003  ................
00001d0: 8004 0001 800b 0001 000c 0004 0000 0020  ...............
00001e0: 800b 0002 000c 0004 0000 0040 4000 0004  ...........@@...
00001f0: dead beef 0000 0007 2030 40              ........ 0@
rsh@jessie:/tmp$ xxd ike-scan-test.12963.tmp
0000000: dead beef dead beef dead beef dead beef  ................
0000010: 3932 067f 0000 04d2 0000 0205 0700 01d8  92..............
0000020: 0000 0002 0000 0003 0000 01cc 0104 0408  ................
0000030: 2f6b 0731 0300 0038 0105 0000 8001 0005  /k.1...8........
0000040: 8002 0002 8003 0003 8004 0002 800b 0001  ................
0000050: 000c 0004 0000 0000 800b 0002 000c 0004  ................
0000060: 0000 0000 4000 0004 dead beef 0300 0038  ....@..........8
0000070: 0205 0000 8001 0005 8002 0001 8003 0003  ................
0000080: 8004 0002 800b 0001 000c 0004 0000 0000  ................
0000090: 800b 0002 000c 0004 0000 0000 4000 0004  ............@...
00000a0: dead beef 0300 0038 0305 0000 8001 0001  .......8........
00000b0: 8002 0002 8003 0003 8004 0002 800b 0001  ................
00000c0: 000c 0004 0000 0000 800b 0002 000c 0004  ................
00000d0: 0000 0000 4000 0004 dead beef 0300 0038  ....@..........8
00000e0: 0405 0000 8001 0001 8002 0001 8003 0003  ................
00000f0: 8004 0002 800b 0001 000c 0004 0000 0000  ................
0000100: 800b 0002 000c 0004 0000 0000 4000 0004  ............@...
0000110: dead beef 0300 0038 0505 0000 8001 0005  .......8........
0000120: 8002 0002 8003 0003 8004 0001 800b 0001  ................
0000130: 000c 0004 0000 0000 800b 0002 000c 0004  ................
0000140: 0000 0000 4000 0004 dead beef 0300 0038  ....@..........8
0000150: 0605 0000 8001 0005 8002 0001 8003 0003  ................
0000160: 8004 0001 800b 0001 000c 0004 0000 0000  ................
0000170: 800b 0002 000c 0004 0000 0000 4000 0004  ............@...
0000180: dead beef 0300 0038 0705 0000 8001 0001  .......8........
0000190: 8002 0002 8003 0003 8004 0001 800b 0001  ................
00001a0: 000c 0004 0000 0000 800b 0002 000c 0004  ................
00001b0: 0000 0000 4000 0004 dead beef 0000 0038  ....@..........8
00001c0: 0805 0000 8001 0001 8002 0001 8003 0003  ................
00001d0: 8004 0001 800b 0001 000c 0004 0000 0000  ................
00001e0: 800b 0002 000c 0004 0000 0000 4000 0004  ............@...
00001f0: dead beef 0000 0007 2030 40              ........ 0@

I don't have a big endian system at the moment, having disposed of my last SPARC system a couple of years ago. But I know that earlier versions used to compile and run tests on Solaris / UltraSPARC, so this is either a regression, or a test that's been added since I last tested on a Big Endian system.