opengnsys_ipxe/src/tests
Michael J. Bazzinotti 0de5e60144 [libc] Fix memcmp() to return proper values
Fix memcmp() to return proper standard positive/negative values for
unequal comparisons.  Current implementation is backwards (i.e. the
functions are returning negative when should be positive and
vice-versa).

Currently most consumers of these functions only check the return value
for ==0 or !=0 and so we can safely change the implementation without
breaking things.

However, there is one call that checks the polarity of this function,
and that is prf_sha1() for wireless WPA 4-way handshake.  Due to the
incorrect memcmp() polarity, the WPA handshake creates an incorrect
PTK, and the handshake would fail after step 2.  Undoubtedly, the AP
noticed the supplicant failed the mic check.  This commit fixes that
issue.

Similar to commit 3946aa9 ("[libc] Fix strcmp()/strncmp() to return
proper values").

Signed-off-by: Michael Bazzinotti <bazz@bazz1.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2020-07-21 15:29:18 +01:00
..
aes_test.c [test] Add NIST self-tests for AES192 in ECB and CBC modes 2015-07-27 17:25:37 +01:00
asn1_test.c [crypto] Add DER image format 2016-07-29 01:12:58 +01:00
asn1_test.h [crypto] Add DER image format 2016-07-29 01:12:58 +01:00
base16_test.c [base16] Add buffer size parameter to base16_encode() and base16_decode() 2015-04-24 14:41:32 +01:00
base64_test.c [base64] Add buffer size parameter to base64_encode() and base64_decode() 2015-04-24 15:32:04 +01:00
bigint_test.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
bitops_test.c [bitops] Fix typo in test case 2016-05-05 23:42:57 +01:00
bofm_test.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
byteswap_test.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
cipher_test.c [test] Generalise cipher tests and use okx() 2015-07-27 16:04:38 +01:00
cipher_test.h [test] Generalise cipher tests and use okx() 2015-07-27 16:04:38 +01:00
cms_test.c [build] Fix the REQUIRE_SYMBOL mechanism 2015-03-05 00:59:38 +00:00
crc32_test.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
deflate_test.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
der_test.c [crypto] Add DER image format 2016-07-29 01:12:58 +01:00
digest_test.c [test] Simplify digest algorithm self-tests 2015-04-12 17:01:10 +01:00
digest_test.h [test] Simplify digest algorithm self-tests 2015-04-12 17:01:10 +01:00
dns_test.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
entropy_sample.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
hash_df_test.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
hmac_drbg_test.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
iobuf_test.c [iobuf] Improve robustness of I/O buffer allocation 2016-02-11 19:04:23 +00:00
ipv4_test.c [ipv4] Redefine IP address constants to avoid unnecessary byte swapping 2015-07-28 13:48:29 +01:00
ipv6_test.c [ipv6] Allow for multiple routers 2016-07-25 15:20:22 +01:00
linebuf_test.c [linebuf] Support buffering of multiple lines 2015-07-28 16:59:11 +01:00
list_test.c [list] Add list_is_first_entry() and list_is_last_entry() 2018-03-24 21:32:06 +00:00
math_test.c [libc] Add ffs(), ffsl(), and ffsll() 2015-03-16 15:40:53 +00:00
md4_test.c [crypto] Add MD4 message digest algorithm 2017-11-12 18:52:03 +00:00
md5_test.c [test] Simplify digest algorithm self-tests 2015-04-12 17:01:10 +01:00
memcpy_test.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
memset_test.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
ntlm_test.c [ntlm] Add support for NTLM authentication mechanism 2017-11-12 18:52:03 +00:00
ocsp_test.c [crypto] Generalise X.509 "valid" field to a "flags" field 2016-08-25 15:41:57 +01:00
pccrc_test.c [peerdist] Include trimmed range within content information block 2015-07-28 15:22:26 +01:00
pem_test.c [crypto] Add PEM image format 2016-07-29 01:13:27 +01:00
pixbuf_test.c [image] Detect image type when image is first registered 2015-08-21 16:25:11 +01:00
pixbuf_test.h [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
png_test.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
pnm_test.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
profile_test.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
pubkey_test.h [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
rsa_test.c [crypto] Ensure that test code drags in required ASN.1 object identifiers 2020-06-16 23:41:43 +01:00
setjmp_test.c [build] Avoid implicit-fallthrough warnings on GCC 7 2017-03-29 10:36:45 +03:00
settings_test.c [pci] Support systems with multiple PCI root bridges 2016-06-09 09:36:28 +01:00
sha1_test.c [test] Simplify digest algorithm self-tests 2015-04-12 17:01:10 +01:00
sha256_test.c [crypto] Add SHA-224 algorithm 2015-04-12 17:01:10 +01:00
sha512_test.c [crypto] Add SHA-512/224 algorithm 2015-04-12 17:02:11 +01:00
string_test.c [libc] Fix memcmp() to return proper values 2020-07-21 15:29:18 +01:00
tcpip_test.c [tcpip] Avoid generating positive zero for transmitted UDP checksums 2015-09-10 14:46:54 +01:00
test.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
tests.c [ntlm] Add support for NTLM authentication mechanism 2017-11-12 18:52:03 +00:00
time_test.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
umalloc_test.c [ioapi] Move get_memmap() to the I/O API group 2010-08-16 16:54:03 +01:00
uri_test.c [uri] Support "file:" URIs describing relative paths 2016-03-14 18:03:13 +00:00
vsprintf_test.c [libc] Print "<NULL>" for wide-character NULL strings 2016-04-12 11:53:06 +01:00
x509_test.c [build] Fix the REQUIRE_SYMBOL mechanism 2015-03-05 00:59:38 +00:00