Denis Kenzior
2ba7867e9f
eapol: Drop unneded check in verify_ptk_4_of_4
...
Step 4 is always sent without encrypted Key Data according to Section
11.6.6.5. In the case of WPA, Encrypted Key Data field is reserved, and
should always be 0. Thus it is safe to drop the !is_wpa condition.
2015-05-05 22:01:53 -05:00
Denis Kenzior
bb17f5df94
eapol: Add sanity checking of the install bit
2015-05-05 21:50:35 -05:00
Andrew Zaborowski
0ea28ba5ad
eapol: Generate new snonce on new 4-Way Handshake
...
Make sure that we handle PTK rekeying.
2015-05-05 21:22:38 -05:00
Andrew Zaborowski
a7846aee85
eapol: WPA-specific handshake quirks
...
To support WPA allow the legacy EAPOL-Key frame formats.
2015-05-05 21:22:31 -05:00
Andrew Zaborowski
a8c0f20510
eapol: Handle the Group Key Handshake
2015-05-05 21:10:07 -05:00
Andrew Zaborowski
169aa04570
eapol: Free eapol_sm even if callback is null
...
If deauthenticate callback was not provided, the state machine was not
being freed / removed.
2015-04-29 08:54:53 -05:00
Andrew Zaborowski
4a27563b5a
eapol: Fix key-IV check in EAPOL-Key verification
...
The comment correctly states the IV is 0 for version 2, but the
check was actually for version 1.
2015-04-29 08:54:47 -05:00
Andrzej Zaborowski
c22d22f5e5
eapol: Remove eapol_sm's from queue when destroying.
...
Prevents a double-free.
2015-04-17 10:40:10 -05:00
Denis Kenzior
bc98bc9ecb
eapol: Add functions to set own/ap WPA IEs
...
If EAPoL is being run for in WPA mode, then instead of RSN elements, the
WPA elements are required.
2015-04-10 23:46:58 -05:00
Denis Kenzior
445ad55796
eapol: Start a handshake timer
...
We start a timer. This handles the case that the Authenticator does
not send us the first message of the 4-way handshake, or disappears
before sending us the 3rd message.
2015-03-29 22:44:08 -05:00
Denis Kenzior
e2badc9828
eapol: Call deauthenticate callback
2015-03-29 22:32:09 -05:00
Denis Kenzior
9f17b71375
eapol: Add eapol_cancel
2015-03-29 20:58:40 -05:00
Denis Kenzior
cf3681efbe
eapol: Add comment for handling MIC failures
2015-03-29 20:57:58 -05:00
Denis Kenzior
f31407dd46
eapol: Add deauthenticate callback
2015-03-29 20:30:14 -05:00
Denis Kenzior
6ec364cb86
eapol: Add __eapol_set_gtk_install_func
2015-03-25 23:28:22 -05:00
Denis Kenzior
bf5a6a3999
eapol: Add __eapol_set_install_tk_func
2015-03-25 22:35:12 -05:00
Denis Kenzior
ddcbb3f2a8
eapol: Add eapol_sm_set_user_data
2015-03-25 22:34:05 -05:00
Ravi kumar Veeramally
3432cfa53e
eapol: Return if eapol_find_sm returns NULL
2015-03-23 20:08:30 -05:00
Ravi kumar Veeramally
a95b0e3a5a
eapol: Fix return value
2015-03-23 15:37:40 -05:00
Denis Kenzior
86e7883c74
eapol: Print a message if MIC calculation fails
2015-03-20 14:52:49 -05:00
Denis Kenzior
d78883a068
eapol: Add default nonce generator
2015-03-20 12:31:14 -05:00
Denis Kenzior
35e3de9cdf
eapol: Add default eapol tx path function
2015-03-20 12:30:56 -05:00
Denis Kenzior
0ee173e23f
eapol: Fix PAE socket code
...
Using SOCK_DGRAM allows us to receive just the frame payload instead
of raw ethernet framing.
2015-03-20 00:28:58 -05:00
Denis Kenzior
19c67c3b3a
eapol: Add user_data argument
...
To __eapol_rx_packet. The same argument is passed to tx_packet
function.
2015-03-19 23:57:37 -05:00
Denis Kenzior
6b84e0da1f
eapol: Rename aa_addr
...
The use of aa_addr was redundant. Use 'AA' instead. 802.11 defines
'AA' as 'Authenticator Address'.
2015-03-19 23:57:36 -05:00
Denis Kenzior
b871d904d5
eapol: Rename sta_addr
...
The use of sta_addr made no sense. Instead, use the terminology from
802.11: 'Supplicant Address (SPA)'
2015-03-19 23:57:36 -05:00
Denis Kenzior
581f4e298f
eapol: Use a queue instead of a hashmap
2015-03-19 23:57:36 -05:00
Denis Kenzior
12d529eddb
eapol: Rearrange data structure members
...
The order follows the rough order of initialization, as information
becomes available from the calling code or via steps of the 4-way
handshake.
2015-03-19 23:57:36 -05:00
Jukka Rissanen
acce7c9034
eapol: Change the interface index data type
...
The ifindex should be uint32_t instead of int.
2015-03-19 20:18:05 -05:00
Denis Kenzior
2bcfc15e96
eapol: Remove unneeded whitespace
2015-03-02 21:47:27 -06:00
Ravi kumar Veeramally
db45cd8dbf
eapol: Provide utility to open raw socket
...
Opens a raw socket to filter ETH_P_PAE based packets. Binds to specific
interface index to read/write eapol frames.
2015-02-26 10:54:05 -06:00
Denis Kenzior
41e82fba77
eapol: Optimize out rsne sizes
...
The RSN IEs contain the sizes of the element inside the data, so it is
not necessary to carry a dedicated size element.
2015-02-24 23:15:20 -06:00
Denis Kenzior
9760bcb5c3
eapol: Add checking that first RSNE is as expected
2015-02-24 22:09:35 -06:00
Denis Kenzior
7f9b8117fd
eapol: Add utility to find GTK KDEs
2015-02-24 17:11:56 -06:00
Denis Kenzior
bfdd4a2328
eapol: Pass decrypted data len
...
to eapol_handle_ptk_3_of_4
2015-02-24 16:03:42 -06:00
Denis Kenzior
c71bfcbb7c
eapol: Decryption of packets changes affects size
2015-02-24 15:59:36 -06:00
Denis Kenzior
f997816a7f
eapol: Handle Step 2 & 4 of the 4-way Handshake
2015-02-24 11:14:11 -06:00
Denis Kenzior
da1180841d
eapol: Handle Step 1 & 2 of 4-way Handshake
2015-02-24 11:13:57 -06:00
Denis Kenzior
9e6cbc5b60
eapol: Add __eapol_rx_packet
2015-02-24 11:13:19 -06:00
Denis Kenzior
4a540526fe
eapol: Add eapol_start
2015-02-24 11:12:22 -06:00
Denis Kenzior
2ee8b8e56e
eapol: Add __eapol_set_protocol_version
2015-02-24 11:11:40 -06:00
Denis Kenzior
87dc9543b2
eapol: Add tx_packet_func and setter
2015-02-24 11:10:42 -06:00
Denis Kenzior
54fa4f29c7
eapol: Add get_nonce func and setter
2015-02-24 11:09:42 -06:00
Denis Kenzior
79bf677e71
eapol: Add eapol_init and eapol_exit
2015-02-24 11:08:03 -06:00
Denis Kenzior
2e1e484f95
eapol: Add eapol_sm_set_own_rsn
2015-02-24 10:58:43 -06:00
Denis Kenzior
08b2980fd6
eapol: Add eapol_sm_set_ap_rsn
2015-02-24 10:58:03 -06:00
Denis Kenzior
f85c860cc3
eapol: Add eapol_sm_set_pmk
2015-02-24 10:57:25 -06:00
Denis Kenzior
ff92e5c5e1
eapol: Add eapol_sm_set_aa_address
2015-02-24 10:56:39 -06:00
Denis Kenzior
122dfe7025
eapol: Add eapol_sm_set_sta_address
2015-02-24 10:55:50 -06:00
Denis Kenzior
2866fbbf91
eapol: Introduce eapol_sm
2015-02-24 10:54:23 -06:00
Denis Kenzior
bf42e3e7a3
eapol: snonce not needed in create_ptk_4_of_4
2015-02-24 10:52:12 -06:00
Denis Kenzior
6ba57c9fa8
eapol: Fix eapol_verify_mic
...
The calculation was using an invalid length
2015-02-24 10:42:20 -06:00
Denis Kenzior
a0bf16c5ca
eapol: Refactor verification functions
...
Use a macro for common checks. Assume that the validate step will be
done separately.
2015-02-23 15:39:26 -06:00
Denis Kenzior
6a4b75cf8d
eapol: Add eapol_verify_mic
2015-02-18 21:13:09 -06:00
Denis Kenzior
ad3e0b6bf2
arc4: Remove and move to src/crypto.c
2015-02-18 21:11:37 -06:00
Denis Kenzior
b3e617838d
aes: Remove and move to src/crypto.c
2015-02-18 21:02:09 -06:00
Denis Kenzior
260ef5bb9d
md5: Remove and move to src/crypto.c
2015-02-18 20:56:18 -06:00
Denis Kenzior
89e4538945
eapol: Rework eapol_decrypt_key_data
...
802.11 uses AES Key Wrap and RC4 with the first 256 bytes skipped. The
IV is also initialized into the RC4 key.
2015-02-17 17:39:47 -06:00
Denis Kenzior
cd08cdfd9f
eapol: Add eapol_decrypt_key_data
2015-02-13 20:37:17 -06:00
Denis Kenzior
85e54c66fe
eapol: Add eapol_verify_ptk_4_of_4
2015-02-13 18:38:10 -06:00
Denis Kenzior
0570940cd7
eapol: Add eapol_verify_ptk_3_of_4
2015-02-13 16:36:52 -06:00
Denis Kenzior
f9515fbe97
eapol: Add additional sanity checks for step 2
2015-02-13 16:36:24 -06:00
Denis Kenzior
9b746cd3c1
eapol: Update comment
2015-02-13 16:12:43 -06:00
Denis Kenzior
54d4090542
eapol: Tweak API
...
We need to extract quite a bit of information from the EAPoL frames, so
tweak the API to just verify that a frame is of a particular type
2015-02-13 16:08:45 -06:00
Denis Kenzior
87f775475a
eapol: Handle cmac_aes in eapol_calcuate_mic
2015-02-13 14:53:16 -06:00
Denis Kenzior
63aae17aa8
eapol: Take out unneeded cast
2015-02-13 14:52:24 -06:00
Denis Kenzior
df8d60d7e1
eapol: Add eapol_create_ptk_4_of_4
2015-02-13 14:10:28 -06:00
Denis Kenzior
005fc0c0d1
eapol: Handle key_replay_counter as a uint64_t
2015-02-13 13:54:50 -06:00
Tomasz Bursztyka
8f946c0cdc
eapol: Change function signatures
...
The frame which comes in is an EAPoL-key frame, thus changing the name
accordingly (as well as the parameter names).
Also, returning the cast pointer instead of a boolean is easier to
use as there won't be any need to perform the cast ourselves afterward
2015-01-22 12:18:17 -06:00
Denis Kenzior
096165d142
eapol: Add eapol_calculate_mic
2014-12-27 23:04:14 -06:00
Denis Kenzior
27d25efc0b
eapol: Add eapol_create_ptk_2_of_4
2014-12-27 23:04:12 -06:00
Denis Kenzior
dc3331a98d
eapol: Add eapol_process_ptk_2_of_4
2014-12-27 22:58:22 -06:00
Denis Kenzior
996e32bf1d
eapol: Add eapol_process_ptk_1_of_4
2014-12-27 22:58:22 -06:00
Denis Kenzior
da8e10cc5f
eapol: Verify key_descriptor_version
2014-12-27 22:34:39 -06:00
Denis Kenzior
5da6ca89e4
eapol: Add eapol_verify
2014-12-27 22:34:39 -06:00
Denis Kenzior
2cc842a302
eapol: Add beginnings of EAPoL utilities
2014-12-18 18:10:10 -06:00