3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-24 16:49:25 +01:00
Commit Graph

357 Commits

Author SHA1 Message Date
James Prestwood
685d105739 unit: add simple test for nl80211util 2024-06-20 10:51:00 -05:00
James Prestwood
fdbbd8b383 unit: add test for band fallback
This test uses the same country/country3 values seen by an AP vendor
which causes issues with IWD. The alpha2 is ES (Spain) and the 3rd
byte is 4, indicating to use the E-4. The issue then comes when the
neighbor report claims the BSS is under operating class 3 which is
not part of E-4.

With the fallback implemented, this test will pass since it will
try and lookup only on ES (the EU table) which operating class 3 is
part of.
2024-05-14 10:30:48 -05:00
John Brandt
49cddea10b unit: fix SAE unit tests
Don't mark either client as being the authenticator. In the current unit
tests, both instances act as clients to test functionality. This ensures
the unit does not show an error during the following commits where SAE
for AP mode is added.
2024-05-07 10:50:39 -05:00
James Prestwood
88d3261bc2 unit: fix test-band with new rate estimation returns
-ENETUNREACH is the correct return to check as this indicates either
the RSSI was too low or the local capabilities were not compatible.
2024-04-15 16:51:54 -05:00
James Prestwood
d13af0a4a2 unit: fix memory leak in test-dpp 2024-02-27 14:33:29 -06:00
Denis Kenzior
e89ba32d30 build: Fix build with openssl 3.2
make --no-print-directory all-am
openssl req -new -extensions cert_ext \
		-config ./unit/gencerts.cnf \
		-subj '/O=Foo Example Organization/CN=Foo Example Organization/emailAddress=foo@mail.example' \
		-key unit/cert-server-key.pem -out unit/cert-server.csr
Error adding request extensions from section cert_ext
4057AC4D6F7F0000:error:11000079:X509 V3 routines:v2i_AUTHORITY_KEYID:no issuer certificate:crypto/x509/v3_akid.c:156:
4057AC4D6F7F0000:error:11000080:X509 V3 routines:X509V3_EXT_nconf_int:error in extension:crypto/x509/v3_conf.c:48:section=cert_ext, name=authorityKeyIdentifier, value=keyid:always,issuer:always
make[1]: *** [Makefile:3962: unit/cert-server.csr] Error 1
2023-12-31 11:02:04 -06:00
James Prestwood
4f80e8baef unit: use authenticator_fte 2023-12-13 10:08:44 -06:00
Ronan Pigott
c574c80e27 tree-wide: correct the spelling Ghz -> GHz
This mispelling was present in the configuration, so I retained parsing
of the legacy BandModifier*Ghz options for compatibility. Without this
change anyone spelling GHz correctly in their configs would be very
confused.
2023-11-07 21:11:50 -06:00
James Prestwood
aabedeeb6c unit: add PKEX DPP tests 2023-10-29 17:21:28 -05:00
James Prestwood
b3071dfd15 unit: add DPP test for mutual authentication 2023-10-29 17:19:43 -05:00
James Prestwood
5b49ea4e2d unit: make test-dpp key derivation test more extendable
Use a new structure to hold key values so they can be changed for
different test vectors while using the same test function.
2023-10-29 17:17:55 -05:00
James Prestwood
3e0e31544e unit: correct memcpy overrun in test-dpp
The memcpy in HEX2BUF was copying the length of the buffer that was
passed in, not the actual length of the converted hexstring. This
test was segfaulting in the Alpine CI which uses clang/musl.
2023-10-26 09:32:30 -05:00
James Prestwood
2c7bf2756e unit: update test-dpp with API changes 2023-10-19 09:33:41 -05:00
James Prestwood
b7180d4d29 unit: add to test-dpp to expose ASN1 point conversion bug
Add a test to show the incorrect ASN1 conversion to and from points.
This was due to the check if Y is odd/even being inverted which
incorrectly prefixes the X coordinate with the wrong byte.

The test itself was not fully correct because it was using compliant
points rather than full points, and the spec contains the entire
Y coordinate so the full point should be used.

This patch also adds ASN1 conversions to validate that
dpp_point_from_asn1 and dpp_point_to_asn1 work properly.
2023-10-11 09:58:31 -05:00
James Prestwood
8285318228 unit: include frequency 7115 in test-band
The test was not including the last frequency in the 6ghz spectrum.
2023-09-25 09:30:32 -05:00
James Prestwood
17afcf84dc unit: update test-eapol with API change 2023-01-11 15:50:10 -06:00
James Prestwood
7c517b4fcf unit: add invalid channels/freqs to test-band
Tests some channels and frequencies that are not in E-4 and
would pass the conversion without validation.
2022-12-30 11:40:20 -06:00
James Prestwood
cfdfe9c54c unit: fix test-band for 6ghz frequencies
The 6GHz test was not incrementing the frequencies properly which
was resulting in invalid frequencies, but since the conversion
API was never linked to E-4 the test was still passing.
2022-12-30 11:39:31 -06:00
James Prestwood
98b684b417 unit: test-arc4: test RC4 both directions
Tests that the data both encrypts and decrypts.
2022-10-26 14:20:05 -05:00
Denis Kenzior
94ecdc799a ie: Rename _BIP to _BIP_CMAC 2022-10-24 11:05:24 -05:00
James Prestwood
890f212af2 unit: add HE tests to test-band
This tests for all the possible widths selected in 2.4 and 5/6GHz,
as well as some failure tests.
2022-07-20 17:19:42 -05:00
James Prestwood
7f63872dcf unit: memset band to zero after alloc
In test-band the band object was allocated using l_malloc, but not
memset to zero. This will cause problems if allocated pointers are
included in struct band once band is freed.
2022-07-19 17:45:10 -05:00
James Prestwood
bfdef282ae unit: update test-eapol to use the new ptk verify APIs 2022-06-24 18:12:45 -05:00
James Prestwood
999879c9b8 unit: add band tests for 6GHz
Tests that all valid channels/frequencies can be computed as well
as oci_verify maps each new operating class to the correct chandef.
2022-02-25 13:11:00 -06:00
James Prestwood
d6b2a3af50 unit: add DPP unit tests for URI parsing 2022-02-22 16:24:26 -06:00
James Prestwood
1ebbb1a11e unit: add checksum/random check for test-dpp 2022-01-10 17:19:29 -06:00
James Prestwood
b007909c0d unit: add checks for improper use of json_iter_parse/next
This adds checks to make sure these API's don't operate on
objects/primitives they aren't supposed to.
2022-01-06 16:43:18 -06:00
James Prestwood
380896d08a unit: add strings to several json iteration tests 2022-01-06 16:43:18 -06:00
James Prestwood
f3e2147e72 unit: add test for nested arrays 2022-01-06 16:11:35 -06:00
James Prestwood
e38dcbbdbf unit: add arrays of objects test 2022-01-06 16:11:31 -06:00
James Prestwood
01ea05d650 unit: add test for json arrays 2022-01-06 15:16:16 -06:00
James Prestwood
e321c48211 unit: add primitive json test 2022-01-06 14:10:26 -06:00
James Prestwood
385dd2d469 unit: add larger object test
This tests the previous JSON bug fix removing % sizeof(jsmntok_t)
Objects with more than 10 (sizeof(jsmntok_t)) would not parse
correctly.
2021-12-10 18:07:27 -06:00
James Prestwood
e04c363d9f unit: add JSON unit test 2021-12-10 17:33:47 -06:00
James Prestwood
0822b942af unit: fix memory leaks in test-dpp 2021-12-06 18:45:13 -06:00
James Prestwood
43037a94cf unit: add unit test for DPP crypto operations 2021-12-06 16:36:15 -06:00
Denis Kenzior
6a477061c7 unit: Consistently use network-byte-order
Commit ed10b00afa ("unit: Fix eapol IP Allocation test failure")
did not convert all instances of IP allocation settings to network byte
order.

Fixes: 5c9de0cf23 ("eapol: Store IP address in network byte order")
2021-10-25 10:39:00 -05:00
James Prestwood
ec2c060b75 unit: update tests with new TK install arguments 2021-10-08 13:27:00 -05:00
James Prestwood
0f3b2ae180 unit: update test-eapol with GTK API change 2021-09-28 17:26:10 -05:00
Denis Kenzior
9a080dffcd unit: Add additional OCI tests 2021-09-23 14:27:41 -05:00
Denis Kenzior
764376b677 unit: Add OCI verification test 2021-09-21 15:34:40 -05:00
Denis Kenzior
5760e300c3 unit: Add tests for channel to frequency conversion 2021-09-21 15:34:40 -05:00
Denis Kenzior
ed10b00afa unit: Fix eapol IP Allocation test failure
This test was failing due to a change introduced in commit
5c9de0cf23 which changed handshake state storage of IPs from host
order to network byte order.  Update the test to set IPs in network
byte-order.

Fixes: 5c9de0cf23 ("eapol: Store IP address in network byte order")
2021-08-23 08:56:07 -05:00
Denis Kenzior
b55732066d unit: Add simple ie sorting test 2021-08-04 10:46:27 -05:00
Denis Kenzior
64211c292d unit: Fix SAE unit test failure
The SAE unit test was written when group 19 was preferred by default for
all SAE connections.  However, we have now started to prefer higher
security groups.  Trick the test into using group 19 by wrapping
l_ecc_supported_ike_groups implementation to return just curve 19 as a
supported curve.
2021-07-27 14:01:12 -05:00
Denis Kenzior
e82f0d3459 unit: Update expected error code 2021-07-14 09:58:42 -05:00
Denis Kenzior
08845fb19c ie: Change ie_tlv_builder_finalize signature
ie_tlv_builder_init takes a size_t as input, yet for some reason
ie_tlv_builder_finalize takes an unsigned int argument as output.  Fix
the latter to use size_t as well.
2021-07-14 09:58:42 -05:00
Denis Kenzior
0815b85f22 unit: Add basic test for ECC PWE-from-PT derivation 2021-07-14 09:58:42 -05:00
Denis Kenzior
3f1e4cce65 unit: Add basic test for crypto_derive_sae_pt_ecc 2021-07-07 21:03:32 -05:00
Denis Kenzior
b63674dc21 unit: Update to ell ecc API changes 2021-07-07 20:57:09 -05:00