Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test failure on Big Endian systems... #1968

Closed
LocutusOfBorg opened this issue Oct 1, 2018 · 7 comments
Closed

test failure on Big Endian systems... #1968

LocutusOfBorg opened this issue Oct 1, 2018 · 7 comments
Labels
#aircrack-ng bug Something isn't working

Comments

@LocutusOfBorg
Copy link

Hello, we have now a new failing test with the 1.4 version...

libtool: link: gcc -pthread -DUSE_GCRYPT -Wall -O3 -std=gnu99 -Wpointer-arith -Wstrict-overflow=2 -Wstrict-prototypes -fvisibility=hidden -fstack-protector-strong -Wno-unused-but-set-variable -Wno-array-bounds -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -rdynamic -Wl,-z -Wl,relro -Wl,-z -Wl,now -o test-string-has-suffix test_string_has_suffix-test-string-has-suffix.o  -L../../src/aircrack-util /<<PKGBUILDDIR>>/src/aircrack-util/.libs/libaircrack-util.a -lpthread -lgcrypt -lz -lcmocka -ldl -lm -pthread
/bin/bash ../../libtool  --tag=CC   --mode=link gcc "-DLIBAIRCRACK_CRYPTO_PATH=\"/<<PKGBUILDDIR>>/src/aircrack-crypto/\"" "-DABS_TOP_SRCDIR=\"/<<PKGBUILDDIR>>\"" "-DABS_TOP_BUILDDIR=\"/<<PKGBUILDDIR>>\"" "-DLIBDIR=\"/usr/lib/s390x-linux-gnu\"" -pthread -DUSE_GCRYPT   -Wall -O3 -std=gnu99 -Wpointer-arith -Wstrict-overflow=2 -Wstrict-prototypes -fvisibility=hidden -fstack-protector-strong -Wno-unused-but-set-variable -Wno-array-bounds -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -rdynamic -Wl,-z,relro -Wl,-z,now -o test-wpapsk test_wpapsk-test-wpapsk.o  -L../../src/aircrack-crypto -laircrack-crypto -L../../src/aircrack-util -laircrack-util -lpthread -lgcrypt -lz -lcmocka -ldl -lm
/bin/bash ../../libtool  --tag=CC   --mode=link gcc "-DLIBAIRCRACK_CRYPTO_PATH=\"/<<PKGBUILDDIR>>/src/aircrack-crypto/\"" "-DABS_TOP_SRCDIR=\"/<<PKGBUILDDIR>>\"" "-DABS_TOP_BUILDDIR=\"/<<PKGBUILDDIR>>\"" "-DLIBDIR=\"/usr/lib/s390x-linux-gnu\"" -pthread -DUSE_GCRYPT   -Wall -O3 -std=gnu99 -Wpointer-arith -Wstrict-overflow=2 -Wstrict-prototypes -fvisibility=hidden -fstack-protector-strong -Wno-unused-but-set-variable -Wno-array-bounds -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -rdynamic -Wl,-z,relro -Wl,-z,now -o test-wpapsk-cmac test_wpapsk_cmac-test-wpapsk-cmac.o  -L../../src/aircrack-util -laircrack-util -lpthread -lgcrypt -lz -lcmocka -ldl -lm
libtool: link: gcc -DLIBAIRCRACK_CRYPTO_PATH=\"/<<PKGBUILDDIR>>/src/aircrack-crypto/\" -DABS_TOP_SRCDIR=\"/<<PKGBUILDDIR>>\" -DABS_TOP_BUILDDIR=\"/<<PKGBUILDDIR>>\" -DLIBDIR=\"/usr/lib/s390x-linux-gnu\" -pthread -DUSE_GCRYPT -Wall -O3 -std=gnu99 -Wpointer-arith -Wstrict-overflow=2 -Wstrict-prototypes -fvisibility=hidden -fstack-protector-strong -Wno-unused-but-set-variable -Wno-array-bounds -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -rdynamic -Wl,-z -Wl,relro -Wl,-z -Wl,now -o test-wpapsk-cmac test_wpapsk_cmac-test-wpapsk-cmac.o  -L../../src/aircrack-util /<<PKGBUILDDIR>>/src/aircrack-util/.libs/libaircrack-util.a -lpthread -lgcrypt -lz -lcmocka -ldl -lm -pthread
libtool: link: gcc -DLIBAIRCRACK_CRYPTO_PATH=\"/<<PKGBUILDDIR>>/src/aircrack-crypto/\" -DABS_TOP_SRCDIR=\"/<<PKGBUILDDIR>>\" -DABS_TOP_BUILDDIR=\"/<<PKGBUILDDIR>>\" -DLIBDIR=\"/usr/lib/s390x-linux-gnu\" -pthread -DUSE_GCRYPT -Wall -O3 -std=gnu99 -Wpointer-arith -Wstrict-overflow=2 -Wstrict-prototypes -fvisibility=hidden -fstack-protector-strong -Wno-unused-but-set-variable -Wno-array-bounds -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -rdynamic -Wl,-z -Wl,relro -Wl,-z -Wl,now -o .libs/test-wpapsk test_wpapsk-test-wpapsk.o  -L../../src/aircrack-crypto /<<PKGBUILDDIR>>/src/aircrack-crypto/.libs/libaircrack-crypto.so -L../../src/aircrack-util /<<PKGBUILDDIR>>/src/aircrack-util/.libs/libaircrack-util.a -lpthread -lgcrypt -lz -lcmocka -ldl -lm -pthread
make[4]: Leaving directory '/<<PKGBUILDDIR>>/test/unit'
make  check-TESTS
make[4]: Entering directory '/<<PKGBUILDDIR>>/test/unit'
make[5]: Entering directory '/<<PKGBUILDDIR>>/test/unit'
PASS: test-string-has-suffix
PASS: test-calc-one-pmk
PASS: test-wpapsk
PASS: test-wpapsk-cmac
============================================================================
Testsuite summary for aircrack-ng 1.4
============================================================================
# TOTAL: 4
# PASS:  4
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make[5]: Leaving directory '/<<PKGBUILDDIR>>/test/unit'
make[4]: Leaving directory '/<<PKGBUILDDIR>>/test/unit'
make[3]: Leaving directory '/<<PKGBUILDDIR>>/test/unit'
make[3]: Entering directory '/<<PKGBUILDDIR>>/test'
make  test-hex_string_to_array
make[4]: Entering directory '/<<PKGBUILDDIR>>/test'
gcc -DPACKAGE_NAME=\"aircrack-ng\" -DPACKAGE_TARNAME=\"aircrack-ng\" -DPACKAGE_VERSION=\"1.4\" -DPACKAGE_STRING=\"aircrack-ng\ 1.4\" -DPACKAGE_BUGREPORT=\"https://forum.aircrack-ng.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"aircrack-ng\" -DVERSION=\"1.4\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -D_REVISION=\"1.4\" -DHAVE_GCRYPT=1 -DGCRYPT_WITH_AES=1 -DGCRYPT_WITH_ARCFOUR=1 -DGCRYPT_WITH_BLOWFISH=1 -DGCRYPT_WITH_CAST5=1 -DGCRYPT_WITH_DES=1 -DGCRYPT_WITH_IDEA=1 -DGCRYPT_WITH_RFC2268=1 -DGCRYPT_WITH_SERPENT=1 -DGCRYPT_WITH_TWOFISH=1 -DGCRYPT_WITH_CRC=1 -DGCRYPT_WITH_MD4=1 -DGCRYPT_WITH_MD5=1 -DGCRYPT_WITH_RMD160=1 -DGCRYPT_WITH_SHA1=1 -DGCRYPT_WITH_SHA256=1 -DGCRYPT_WITH_SHA512=1 -DGCRYPT_WITH_TIGER=1 -DGCRYPT_WITH_WHIRLPOOL=1 -DGCRYPT_WITH_DSA=1 -DGCRYPT_WITH_ELGAMAL=1 -DGCRYPT_WITH_RSA=1 -DGCRYPT_WITH_CMAC_AES=1 -DHAVE_PCAP_H=1 -DHAVE_PCAP=1 -DHAVE_PCRE=1 -DHAVE_SQLITE3_H=1 -DHAVE_SQLITE3=1 -DHAVE_SQLITE=1 -DHAVE_ZLIB=1 -DHAVE_PTHREAD_PRIO_INHERIT=1 -D_REENTRANT=1 -DHAVE_PTHREAD_AFFINITY_NP=1 -DHAVE_SYS_AUXV_H=1 -DHAS_AUXV=1 -DCACHELINE_SIZE=64 -DHAVE_SYS_AUXV_H=1 -DHAS_AUXV=1 -DCACHELINE_SIZE=64 -I.  -I.. -I../src/include -I../src  -Wdate-time -D_FORTIFY_SOURCE=2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE  -Wall -O3 -std=gnu99 -Wpointer-arith -Wstrict-overflow=2 -Wstrict-prototypes -fvisibility=hidden -fstack-protector-strong -Wno-unused-but-set-variable -Wno-array-bounds -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -c -o test-hex_string_to_array.o test-hex_string_to_array.c
/bin/bash ../libtool  --tag=CC   --mode=link gcc  -Wall -O3 -std=gnu99 -Wpointer-arith -Wstrict-overflow=2 -Wstrict-prototypes -fvisibility=hidden -fstack-protector-strong -Wno-unused-but-set-variable -Wno-array-bounds -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security  -Wl,-z,relro -Wl,-z,now -o test-hex_string_to_array test-hex_string_to_array.o -L../src -laclib -L../src/aircrack-util -laircrack-util -ldl -lm
libtool: link: gcc -Wall -O3 -std=gnu99 -Wpointer-arith -Wstrict-overflow=2 -Wstrict-prototypes -fvisibility=hidden -fstack-protector-strong -Wno-unused-but-set-variable -Wno-array-bounds -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z -Wl,relro -Wl,-z -Wl,now -o test-hex_string_to_array test-hex_string_to_array.o  -L../src /<<PKGBUILDDIR>>/src/.libs/libaclib.a -Laircrack-util -L../src/aircrack-util /<<PKGBUILDDIR>>/src/aircrack-util/.libs/libaircrack-util.a -ldl -lm -pthread
make[4]: Leaving directory '/<<PKGBUILDDIR>>/test'
make  check-TESTS
make[4]: Entering directory '/<<PKGBUILDDIR>>/test'
make[5]: Entering directory '/<<PKGBUILDDIR>>/test'
PASS: test-hex_string_to_array.sh
PASS: test-aircrack-ng-0001.sh
PASS: test-aircrack-ng-0002.sh
PASS: test-aircrack-ng-0003.sh
PASS: test-aircrack-ng-0004.sh
PASS: test-aircrack-ng-0006.sh
PASS: test-aircrack-ng-0007.sh
PASS: test-aircrack-ng-0008.sh
PASS: test-aircrack-ng-0009.sh
PASS: test-aircrack-ng-0005.sh
PASS: test-aircrack-ng-0010.sh
PASS: test-aircrack-ng-0011.sh
FAIL: test-aircrack-ng-0013.sh
PASS: test-aircrack-ng-0014.sh
FAIL: test-aircrack-ng-0015.sh
FAIL: test-aircrack-ng-0016.sh
PASS: test-aircrack-ng-0017.sh
PASS: test-airdecap-ng-0001.sh
PASS: test-airdecap-ng-0002.sh
PASS: test-airdecap-ng-0003.sh
PASS: test-airdecap-ng-0004.sh
PASS: test-wpaclean-0001.sh
PASS: test-wpaclean-0002.sh
PASS: test-airolib-ng-0001.sh
PASS: test-aircrack-ng-0012.sh
==========================================
   aircrack-ng 1.4: test/test-suite.log
==========================================

# TOTAL: 25
# PASS:  22
# SKIP:  0
# XFAIL: 0
# FAIL:  3
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: test-aircrack-ng-0013.sh
==============================

FAIL test-aircrack-ng-0013.sh (exit status: 1)

FAIL: test-aircrack-ng-0015.sh
==============================

Segmentation fault
FAIL test-aircrack-ng-0015.sh (exit status: 1)

FAIL: test-aircrack-ng-0016.sh
==============================

Reading packets, please wait...
Opening /<<PKGBUILDDIR>>/test/wpa2-psk-linksys.cap
�[0KRead 499 packets.

Reading packets, please wait...
Opening /<<PKGBUILDDIR>>/test/wpa2-psk-linksys.cap
�[0KRead 499 packets.

1 potential targets



Building Hashcat (3.60+) file...

[*] ESSID (length: 7): linksys
[*] Key version: 2
[*] BSSID: 00:0B:86:C2:A4:85
[*] STA: 00:13:CE:55:98:EF
[*] anonce:
    1A 9B DF 0C C8 9E 5E 32 20 F7 1A A7 4F E3 2D F6 
    5B B8 C1 C5 B8 66 4B 9D 98 AE F7 09 B9 64 4D 29 
[*] snonce:
    E8 DF A1 6B 87 69 95 7D 82 49 A4 EC 68 D2 B7 64 
    1D 37 82 16 2E F0 DC 37 B0 14 CC 48 34 3E 8D D4 
[*] Key MIC:
    0E 71 A6 25 FA AD E7 CE 9C 82 21 F7 B1 DB CE 46
[*] eapol:
    01 03 00 75 02 01 0A 00 00 00 00 00 00 00 00 00 
    05 E8 DF A1 6B 87 69 95 7D 82 49 A4 EC 68 D2 B7 
    64 1D 37 82 16 2E F0 DC 37 B0 14 CC 48 34 3E 8D 
    D4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
    00 00 16 30 14 01 00 00 0F AC 04 01 00 00 0F AC 
    04 01 00 00 0F AC 02 28 00 

Successfully written to test.hccapx


Quitting aircrack-ng...
Unsupported file format (not a pcap or IVs file).
FAIL test-aircrack-ng-0016.sh (exit status: 1)

============================================================================
Testsuite summary for aircrack-ng 1.4
============================================================================
# TOTAL: 25
# PASS:  22
# SKIP:  0
# XFAIL: 0
# FAIL:  3
# XPASS: 0
# ERROR: 0
============================================================================
See test/test-suite.log
Please report to https://forum.aircrack-ng.org

full log here:
https://buildd.debian.org/status/fetch.php?pkg=aircrack-ng&arch=s390x&ver=1%3A1.4-1&stamp=1538370516&raw=0

@aircrack-ng aircrack-ng added bug Something isn't working #aircrack-ng labels Oct 1, 2018
@aircrack-ng
Copy link
Owner

Unrelated and out of curiosity, is there any reason hwloc isn't used/installed?

@ChrisLundquist
Copy link
Contributor

Good news: This is a new test to catch this!
Bad news: 1.3 probably had this bug and we didn't know.

Capturing the segfault stack trace would be interesting. (Crashing saying, "I can't open that" seems better. Ideally we would work correctly)

This almost certainly has to do with searching for magic file numbers and not finding what we expect.

I wonder if we could use htonl or something along those lines?

I know we have a few different approaches in different tools.
I think the PCAP stuff in the same file has PCAP_MAGIC and PCAP_CIGAM.
We can go that route, too. htonl seems like it could be nice though?

@samueloph
Copy link
Contributor

@aircrack-ng AFAIK hwloc is not used only because we don't make it so.

If this helps debug this and future problems we can enable it, only during build time,right? aircrack does not need hwloc to run after it has been built with it available?

Also, it won't impact the end binary if hwloc is available, right? I'm just asking that to confirm that enabling hwloc won't make aircrack specific to the machine in which was built, as we need to make sure it can run on any machine of that architecture (eg.: we can't use things like -march=native).

@ChrisLundquist
Copy link
Contributor

hwloc (hardware locality web page) will improve your performance on high core count systems, by automagically tuning cache read sizes, and such.

It is a library, that you usually dynamically link against.
I'm not sure if we have a static linking option for it in our configure scripts (of if that would be desirable for you)
So, you'd have to add it as a package dependency at install time (if you went the dynamic route).
I could be mistaken and other folks would know for sure one way or the other.

hwloc (probably) won't help debug this, but could give your target arch a significant perf boost.
hwloc is portable (so as long as you have a reasonable package for your arch), it won't break things like -march=native

This issue is just because of endianness when looking at magic bytes for files.

@samueloph
Copy link
Contributor

@ChrisLundquist Nice, if its dynamically linked and will not lock the usage of aircrack to the machine which built it, that's ok. I already enabled it for the next upload on Debian.

@jbenden
Copy link
Collaborator

jbenden commented Oct 10, 2018

I made the corrections to pass all tests, but feel that gremlins may be still present... Beware! :)

@samueloph
Copy link
Contributor

samueloph commented Oct 10, 2018

@jbenden Already on Debian, and now with hwloc (should hit Kali soon). The builds on big endian are all ok, thanks!

Oh, and thank you for reporting @LocutusOfBorg :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#aircrack-ng bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants