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

4093 Commits

Author SHA1 Message Date
Andrew Zaborowski
1b1bf3cf65 eapol: On EAP success save the second 256 bits of MSK 2016-09-06 14:07:35 -05:00
Andrew Zaborowski
443e363c20 crypto: Implement crypto_derive_ft_ptk 2016-09-06 13:50:17 -05:00
Andrew Zaborowski
efbbe9870b crypto: Implement crypto_derive_pmk_r1 2016-09-06 13:48:50 -05:00
Andrew Zaborowski
994ffd94c5 crypto: Implement crypto_derive_pmk_r0 2016-09-06 13:47:18 -05:00
Andrew Zaborowski
955c88a64a ie: Consistently set group_management_cipher
RSNE_ADVANCE may return and if it is before the assignment of
info.group_management_cipher, that assignment will be dependent on where
the RSNE ends.
2016-09-05 23:10:29 -05:00
Andrew Zaborowski
316752c5e4 ie: Error in tlv_iter_next if no space to length byte
When parsing the EAPoL-Key key data field we don't strip the 0xdd /
0x00 padding from the decrypted data so there may be trailing padding
after the IE sequence and valgrind will report an invalid read of the
length byte.  Same thing may happen if we're sent garbage.
2016-09-05 23:00:01 -05:00
Denis Kenzior
b67e3f26b5 wscutil: Add wsc_parse_credential 2016-08-31 22:36:21 -05:00
Denis Kenzior
d83bf50a39 wscutil: Add wsc_parse_m8_encrypted_settings 2016-08-31 21:59:52 -05:00
Denis Kenzior
addba697da wscutil: Add wsc_build_m8 2016-08-31 14:14:11 -05:00
Denis Kenzior
ead40f0431 wscutil: Add wsc_parse_m8 2016-08-31 14:14:01 -05:00
Denis Kenzior
34ed84dc41 eap-wsc: Send M7 messages 2016-08-31 12:50:44 -05:00
Denis Kenzior
9bb4ba42dd wscutil: Add wsc_build_m7_encrypted_settings 2016-08-31 11:39:06 -05:00
Denis Kenzior
8df0f9fa28 wscutil: Add wsc_parse_m7_encrypted_settings 2016-08-31 11:38:52 -05:00
Denis Kenzior
a113cba4f2 wscutil: Add wsc_build_m7 2016-08-31 11:32:51 -05:00
Denis Kenzior
b7d44d302a wscutil: Add wsc_parse_m7 2016-08-31 11:32:21 -05:00
Denis Kenzior
6dae861ce2 eap-wsc: Handle M6 messages 2016-08-31 11:18:21 -05:00
Denis Kenzior
2ac78e1306 eap-wsc: split out R_Hash verification
So it can be used in M6 processing
2016-08-31 11:17:29 -05:00
Denis Kenzior
11550b2756 wscutil: Add wsc_m6_build_encrypted_settings 2016-08-31 11:15:35 -05:00
Denis Kenzior
3719e78094 wscutil: Add wsc_parse_m6_encrypted_settings 2016-08-31 11:15:12 -05:00
Denis Kenzior
4e0c932dc9 wscutil: Add wsc_build_m6 2016-08-31 11:14:48 -05:00
Denis Kenzior
815f685c2d wscutil: Add wsc_parse_m6 2016-08-31 11:14:48 -05:00
Denis Kenzior
ba55afa3f4 eap-wsc: Generate M5 messages 2016-08-30 23:20:24 -05:00
Denis Kenzior
c0de9d1790 eap-wsc: optionally load IV1 & IV2 for debugging
When we send M5 & M7, we need to generate a random IV.  For testing
purposes, the IV can be provided in settings, otherwise it will be
generated randomly.
2016-08-30 23:18:53 -05:00
Denis Kenzior
62623e0eb3 eap-wsc: Handle M4 messages 2016-08-30 21:52:24 -05:00
Denis Kenzior
48c3f4a55a eap-wsc: Store PSK1 & PSK2
We will need to use PSK1 & PSK2 when computing R_Hash1 & R_Hash2 when
processing M4 & M6.
2016-08-30 21:51:14 -05:00
Denis Kenzior
9a47f98ccd eap-wsc: Store M2 for future use
We need quite a bit of attributes of M2 for the duration of the WSC
handshake.  Most importantly, we need to use the peer's public key when
processing M4 and M6.  RegistrarNonce is also needed for generating any
ACK/NACK messages as needed.

Also, peer's device attributes such as Model, Manufacturer, etc might be
useful to report upon successful handshake.
2016-08-30 21:10:57 -05:00
Denis Kenzior
633389f2f4 eap-wsc: Add utility to decrypt EncryptedSettings 2016-08-30 14:43:49 -05:00
Denis Kenzior
b78bef2be8 eap-wsc: Add utility to check KeyWrapAuthenticator 2016-08-30 14:42:43 -05:00
Denis Kenzior
046c7b8994 eap-wsc: clear out intermediate key data 2016-08-30 14:41:58 -05:00
Denis Kenzior
39d6acb07d eap-wsc: Don't store AuthKey | KeyWrapKey | EMSK
AuthKey is already uploaded into auth_key_hmac.  KeyWrapKey is now
uploaded into the AES-CBC(128) cipher.  We currently have no use for
EMSK.

So we no longer need to keep the wsc_session_key structure around.
2016-08-30 14:34:03 -05:00
Denis Kenzior
24dfe6e436 wscutil: Add wsc_build_m5_encrypted_settings 2016-08-30 14:10:20 -05:00
Denis Kenzior
7bdb1a0225 wscutil: Add wsc_parse_m5_encrypted_settings 2016-08-30 14:07:53 -05:00
Denis Kenzior
d59086c791 wscutil: Add wsc_build_m4_encrypted_settings 2016-08-30 13:57:28 -05:00
Denis Kenzior
11e56031c0 wscutil: Add wsc_parse_m4_encrypted_settings 2016-08-30 13:38:08 -05:00
Denis Kenzior
757e4dbb90 wscutil: Prepare for parsing of Encrypted Settings
Encrypted Settings TLVs are structured similarly to the various WSC
messages.  However, they lack a version2 extension field and use a Key
Wrap Authenticator element instead of Authenticator.
2016-08-30 13:33:17 -05:00
Denis Kenzior
642804f9d7 wscutil: Handle Key Wrap Authenticator 2016-08-30 13:30:06 -05:00
Denis Kenzior
7810a45a9c eap-wsc: Rework state logic a bit
Mostly so repetitive code is not required
2016-08-30 10:10:11 -05:00
Denis Kenzior
a8580c7ed0 wscutil: Add wsc_build_m5 2016-08-30 09:45:39 -05:00
Denis Kenzior
0081bf4f64 wscutil: Add wsc_parse_m5 2016-08-30 09:34:34 -05:00
Denis Kenzior
05c230c46a eap-wsc: Send M3 2016-08-30 09:22:35 -05:00
Denis Kenzior
397a7d18c2 eap-wsc: Add TX message Authenticator calculation 2016-08-30 09:22:35 -05:00
Denis Kenzior
5951bc220b eap-wsc: Handle M2 messages 2016-08-30 09:22:35 -05:00
Denis Kenzior
33b0034678 eap-wsc: Add util to verify RX frame Authenticator 2016-08-30 09:22:35 -05:00
Denis Kenzior
097e775659 eap-wsc: Add basic logic to send M1 messages 2016-08-30 09:22:33 -05:00
Denis Kenzior
c2cb35b4c9 eap-wsc: store sent pdu
This is needed for authenticator computation
2016-08-29 22:16:34 -05:00
Denis Kenzior
2cbbcb7434 eap-wsc: Load settings related to DevicePassword
DevicePassword is the PIN, either static, dynamically generated or
entered by the user.  For PushButton mode, DevicePassword is set to
'00000000'.  It can also be provided via external means, such as NFC.

This patch allows DevicePassword to be externally configured into the
EAP-WSC layer.  Optionally, the secret nonce values can also be
provided for testing purposes.  If omitted, they will be generated using
l_getrandom.
2016-08-29 12:12:13 -05:00
Denis Kenzior
ce596058cd eap-wsc: Implement load_settings method
We use the load_settings method to bootstrap the internal state of the
EAP WSC state machine.  We require certain information to be provided by
the higher layers, namely:

Global Device parameters
 - Manufacturer
 - Model Name
 - Model Number
 - Serial Number
 - Device Name
 - Primary Device Type
 - OS Version

Session specific parameters
 - MAC Address
 - Configuration Methods
 - RF Bands

The following parameters are auto-generated for each new session, but
can be over-ridden if desired
 - Private Key
 - Enrollee Nonce
2016-08-28 02:47:09 -05:00
Denis Kenzior
b650b16d6f wscutil: Check authenticator more strictly
Make sure Authenticator is the last data in the WSC PDU, with no
extraneous data afterwards
2016-08-28 02:47:09 -05:00
Denis Kenzior
00dac648aa wscutil: Add wsc_build_nack 2016-08-26 17:14:36 -05:00
Denis Kenzior
334ccfce0f wscutil: Add wsc_parse_nack 2016-08-26 17:14:36 -05:00
Denis Kenzior
fdeed24591 eap-wsc: Properly set vendor-id & vendor-type 2016-08-24 21:37:42 -05:00
Denis Kenzior
887119c82f wscutil: Expose WSC WFA OUI 2016-08-24 21:35:41 -05:00
Denis Kenzior
0a314004ce eap: expanded methods start packets at opcode
Expanded EAP methods should get their packets for handling starting at
the op-code field.  They're not really interested in
type/vendor-id/vendor-type fields.
2016-08-24 21:32:16 -05:00
Denis Kenzior
63b5c60743 util: Add util_string_to_address 2016-08-24 21:31:54 -05:00
Denis Kenzior
c2b1351396 wscutil: Add WSC KDF function 2016-08-23 13:52:52 -05:00
Denis Kenzior
0a6ffdf029 netdev: Fix double-free
We should only call eapol_cancel if netdev_connect_free was not
triggered as a result of handshake failure.
2016-08-23 13:15:00 -05:00
Denis Kenzior
5d2c5b3b71 crypto: Add some missing whitespace 2016-08-22 15:54:24 -05:00
Denis Kenzior
9c457de8d5 wscutil: Add M4 builder 2016-08-19 15:24:29 -05:00
Denis Kenzior
d3ee7c71be wscutil: Add M4 parser 2016-08-19 15:14:24 -05:00
Denis Kenzior
ca41b21e15 wscutil: Add extractor for R_HASH1 & R_HASH2 2016-08-19 15:03:44 -05:00
Denis Kenzior
4e4820e2a5 wscutil: Add encrypted settings extractor 2016-08-19 15:03:25 -05:00
Denis Kenzior
f116659ab3 wscutil: Macro-ize WFA extension building 2016-08-18 18:02:08 -05:00
Denis Kenzior
6f0b31b3a4 wscutil: Add M3 builder 2016-08-18 17:58:34 -05:00
Denis Kenzior
b6e7b7a4d6 wscutil: Add M3 parser 2016-08-18 17:48:04 -05:00
Denis Kenzior
dc310bfc49 wscutil: Add e_hash 1 & 2 extractor 2016-08-18 17:47:36 -05:00
Denis Kenzior
a867076c3e wscutil: Relax OS_VERSION parser
Apple implementations seem to not set the MSB bit to 1.
2016-08-18 17:29:16 -05:00
Denis Kenzior
f2e11f5e7c wscutil: Fix memset 2016-08-18 16:22:48 -05:00
Denis Kenzior
af7224a973 wscutil: More strictly handle AUTHENTICATOR tlv
This element must be the TLV in the message
2016-08-18 12:53:06 -05:00
Denis Kenzior
f59f7564ce wscutil: Fix flags
For some reason they weren't setup to be used in a bitfield
2016-08-18 12:52:36 -05:00
Denis Kenzior
f11868d59d wscutil: Add builder for M2 messages 2016-08-17 22:20:46 -05:00
Denis Kenzior
ea8fddb897 wscutil: Move builders to proper alphabetical order 2016-08-17 22:20:46 -05:00
Denis Kenzior
966f0a974f wscutil: Add parser for M2 messages 2016-08-17 21:57:50 -05:00
Denis Kenzior
f389b2ffbc wscutil: Extract REGISTRAR_NONCE 2016-08-16 16:20:57 -05:00
Denis Kenzior
d4c41103d9 wscutil: Add extractor for UUID_R 2016-08-16 16:20:34 -05:00
Denis Kenzior
1c9e82001b wscutil: Fix incorrect return value 2016-08-16 16:12:19 -05:00
Denis Kenzior
e91846bbc5 wscutil: Add extractor for AUTHENTICATOR 2016-08-16 16:11:51 -05:00
Denis Kenzior
5f087aa0ea wscutil: Add builder for M1 messages 2016-08-16 15:27:46 -05:00
Denis Kenzior
e9d1ca7f7b wscutil: Don't include request_to_enroll if false 2016-08-16 15:27:16 -05:00
Denis Kenzior
2133a5edb3 wscutil: Rename WSC_CONFIG_STATE to WSC_STATE 2016-08-16 12:30:24 -05:00
Denis Kenzior
0f1372f866 wscutil: move extract_wsc_state
To proper alphabetical order
2016-08-16 12:25:55 -05:00
Denis Kenzior
349bc26d41 eap-wsc: Init DH5 prime & generator keys 2016-08-15 10:47:36 -05:00
Denis Kenzior
eb539ddd82 crypto: Add D-H MODP Group 5 prime & generator 2016-08-15 10:47:36 -05:00
Denis Kenzior
f7338c45c5 wscutil: Add M1 parser 2016-08-11 16:39:30 -05:00
Denis Kenzior
9ef4a40f0f wscutil: Add parsers for various flag types 2016-08-11 16:38:50 -05:00
Denis Kenzior
3d29f510e1 wscutil: Add parser for OS_VERSION 2016-08-11 16:38:33 -05:00
Denis Kenzior
e3626018d2 wscutil: Add parser for PUBLIC_KEY 2016-08-11 16:18:57 -05:00
Denis Kenzior
c787a4c5b8 wscutil: Add parser for ENROLLEE_NONCE 2016-08-11 16:17:24 -05:00
Denis Kenzior
2aaff15987 wscutil: Add parser for MAC_ADDRESS 2016-08-11 16:15:55 -05:00
Denis Kenzior
29a0d9f066 wscutil: Simplify uuid extractor 2016-08-11 16:15:14 -05:00
Denis Kenzior
da7477435e wscutil: Add parser for MESSAGE_TYPE 2016-08-11 16:09:46 -05:00
Denis Kenzior
f97d5778ea wscutil: Use macro magic to make more readable 2016-08-11 12:47:03 -05:00
Denis Kenzior
7a19a10528 eap-wsc: Add skeleton 2016-08-10 16:59:15 -05:00
Denis Kenzior
bcfaad2b62 eapol: Make EAP packets use sm->protocol_version
Instead of hard-coding the EAPoL version to 2004 for all EAP packets,
use the version from eapol_sm.
2016-08-10 16:37:39 -05:00
Denis Kenzior
abc44fe98a eapol: Use switch-case instead of if
The if statement was shorter, but a bit less readable.
2016-08-10 16:36:14 -05:00
Denis Kenzior
34a537652a eapol: Store protocol version in eapol_sm
Instead of one global protocol_version, we now store it inside eapol_sm.
This allows us to use the same protocol version for our response as the
request from the authenticator.

For unit tests where we had protocol version mismatches, a new method is
introduced to explicitly set the protocol version to use.
2016-08-10 16:32:45 -05:00
Denis Kenzior
bd357cb63c eap: Add initial support for expanded types 2016-08-10 14:38:21 -05:00
Denis Kenzior
5b3be6fcd4 eap: Make enums fit with our coding guidelines 2016-08-10 13:06:47 -05:00
Andrew Zaborowski
2c88c37f99 netdev: Cancel the CMD_CONNECT genl command on disconnect
CMD_DISCONNECT fails on some occasions when CMD_CONNECT is still
running.  When this happens the DBus disconnect command receives an
error reply but iwd's device state is left as disconnected even though
there's a connection at the kernel level which times out a few seconds
later.  If the CMD_CONNECT is cancelled I couldn't reproduce this so far.

src/network.c:network_connect()
src/network.c:network_connect_psk()
src/network.c:network_connect_psk() psk:
69ae3f8b2f84a438cf6a44275913182dd2714510ccb8cbdf8da9dc8b61718560
src/network.c:network_connect_psk() len: 32
src/network.c:network_connect_psk() ask_psk: false
src/device.c:device_enter_state() Old State: disconnected, new state:
connecting
src/scan.c:scan_notify() Scan notification 33
src/device.c:device_netdev_event() Associating
src/netdev.c:netdev_mlme_notify() MLME notification 60
MLME notification is missing ifindex attribute
src/device.c:device_dbus_disconnect()
src/device.c:device_connect_cb() 6, result: 5
src/device.c:device_enter_state() Old State: connecting, new state:
disconnecting
src/device.c:device_disconnect_cb() 6, success: 0
src/device.c:device_enter_state() Old State: disconnecting, new state:
disconnected
src/scan.c:scan_notify() Scan notification 34
src/netdev.c:netdev_mlme_notify() MLME notification 19
src/netdev.c:netdev_mlme_notify() MLME notification 60
MLME notification is missing ifindex attribute
src/netdev.c:netdev_mlme_notify() MLME notification 37
src/netdev.c:netdev_authenticate_event()
src/scan.c:get_scan_callback() get_scan_callback
src/scan.c:get_scan_done() get_scan_done
src/netdev.c:netdev_mlme_notify() MLME notification 60
MLME notification is missing ifindex attribute
src/netdev.c:netdev_mlme_notify() MLME notification 19
MLME notification is missing ifindex attribute
src/netdev.c:netdev_mlme_notify() MLME notification 38
src/netdev.c:netdev_associate_event()
src/netdev.c:netdev_mlme_notify() MLME notification 46
src/netdev.c:netdev_connect_event()

<delay>

src/netdev.c:netdev_mlme_notify() MLME notification 60
MLME notification is missing ifindex attribute
src/netdev.c:netdev_mlme_notify() MLME notification 20
MLME notification is missing ifindex attribute
src/netdev.c:netdev_mlme_notify() MLME notification 20
src/netdev.c:netdev_mlme_notify() MLME notification 39
src/netdev.c:netdev_deauthenticate_event()
2016-08-05 11:07:29 -05:00
Andrew Zaborowski
c0b81662e4 wiphy: Add a Model and Vendor properties
Use the ell hwdb api to find the device model and vendor and expose
these as DBus properties.
2016-08-04 12:35:20 -05:00
Andrew Zaborowski
11d322aad7 netdev: Call netdev_free in netdev_shutdown
This is to make sure device_remove and netdev_connect_free are called
early so we don't continue setting up a connection and don't let DBus
clients power device back up after we've called netdev_set_powered.
2016-08-04 12:22:43 -05:00
Denis Kenzior
b601c99123 device: Modify disconnect_cb logic
Calling device_disassociated inside disconnect_cb was mostly pointless.
Most attributes were already cleared by device_disconnect() when
initiating the disconnection procedure.

This patch also modifies the logic for triggering the autoconnect.  If
the user initiated the disconnect call, then autoconnect should not be
triggered.  If the disconnect was triggered by other means, then iwd
will still enter autoconnect mode.
2016-08-04 12:22:43 -05:00
Denis Kenzior
30947414e4 device: Simplify method return logic 2016-08-04 12:22:43 -05:00
Denis Kenzior
694c62985a device: on abort, don't call device_disassociated
All of the abortion logic is invoked when device_disconnect is called.
So there's no point calling device_disassociated in this case.  This
also prevents us from entering into autoconnect mode too early.
2016-08-04 12:22:43 -05:00
Denis Kenzior
8248c1c7d2 netdev: Clear connect_cb when connected
Prevents situations like this:
src/device.c:device_enter_state() Old State: connecting, new state:
connected
src/scan.c:scan_periodic_stop() Stopping periodic scan for ifindex: 3
src/device.c:device_dbus_disconnect()
src/device.c:device_connect_cb() 3
src/device.c:device_disassociated() 3
src/device.c:device_enter_state() Old State: connected, new state:
autoconnect
2016-08-04 12:22:43 -05:00
Denis Kenzior
cec2104ffa device: Add additional debugs 2016-08-04 12:22:43 -05:00
Denis Kenzior
d95f9a29c5 device: Simplify reply logic in device_connect_cb
Also, remove the check for device->state == DEVICE_STATE_CONNECTING.
device_connect_cb should always called when the state is CONNECTING.
If this is not so, it indicates a bug inside the netdev layer.
2016-08-04 12:22:43 -05:00
Denis Kenzior
f4201d06c2 device: Remove pointless check
This was introduced by commit f468fceb02.
However, after commit 2d78f51fac66b9beff03a56f12e5fb8456625f07, the
connect_cb is called from inside netdev_disconnect.  This in turn causes
the dbus-reply to be sent out if needed.  So by the time we get to the
code in question, connect_pending is always NULL.
2016-08-04 12:22:42 -05:00
Andrew Zaborowski
c4eab62ba4 netdev: Improve netdev_connect error/cancel logic
Try to make the connect and disconnect operations look more like a
transaction where the callback is always called eventually, also with a
clear indication if the operation is in profress.  The connected state
lasts from the start of the connection attempt until the disconnect.

1. Non-null netdev->connected or disconnect_cb indicate that the operation
   is active.
2. Every entry-point in netdev.c checks if connected is still set
   before executing the next step of the connection setup.  CMD_CONNECT and
   the subsequent commands may succeed even if CMD_DISCONNECT is called
   in the middle so they can't only rely on the error value for that.
3. netdev->connect_cb and other elements of the connection state are
   reset by netdev_connect_free which groups the clean-up operations to
   make sure we don't miss anything.  Since the callback pointers are
   reset device.c doesn't need to check that it receives a spurious
   event in those callbacks for example after calling netdev_disconnect.
2016-08-04 12:21:44 -05:00
Andrew Zaborowski
8f90df6f44 device: Only build autoconnect_list in autoconnect mode 2016-08-02 15:49:43 -05:00
Andrew Zaborowski
f76a86d2b0 netdev: Add a NETDEV_RESULT_ABORTED
To be used so that the callback passed to netdev_connect can still
be called when the connection attempt is being aborted.
2016-08-01 13:18:24 -05:00
Andrew Zaborowski
3863f6d2bb netdev: Allow ERFKILL during initial bring up
If initial bring up returns ERFKILL proceed and the inteface can be
explicitly brought up by the client once rfkill is disabled.

Also fix the error number returned to netdev_set_powered callback to be
negative as expected by netdev_initial_up_cb.
2016-08-01 13:13:24 -05:00
Andrew Zaborowski
50b5234976 netdev: Fix use of l_genl_msg_unref in netdev_connect
Also drop netdev.associate_msg which is now unused.
2016-08-01 12:49:07 -05:00
Denis Kenzior
169222fb96 eapol: warn if state machine list isn't empty 2016-07-20 15:34:21 -05:00
Andrew Zaborowski
9f5c08f3df device: Add a State read-only property 2016-07-20 15:30:17 -05:00
Andrew Zaborowski
f316614f59 rfkill: Fix wiphy ID lookup
map_wiphy made the assumption that phy names follow the "phyN" pattern
but phys created or renamed by the "iw" command can have arbitrary
names.  It seems that /sys/class/rfkill/rfkill%u/name is not updated on
a phy rename, so we can't use it to subsequently read
/sys/class/ieee80211/<name>/index but both
/sys/class/rfkill/rfkill%u/../index and
/sys/class/rfkill/rfkill%u/device/index point to that file.
2016-07-20 15:29:39 -05:00
Denis Kenzior
fba5ada1a1 netdev: Make enum naming consistent with guidelines 2016-07-19 18:03:21 -05:00
Denis Kenzior
1c5438d3ab netdev: simplify 2016-07-19 17:52:36 -05:00
Denis Kenzior
480332226d netdev: Fix memory leak:
==3059== 7 bytes in 1 blocks are still reachable in loss record 1 of 2
==3059==    at 0x4C2C970: malloc (vg_replace_malloc.c:296)
==3059==    by 0x50BB319: strndup (in /lib64/libc-2.22.so)
==3059==    by 0x417B4D: l_strndup (util.c:180)
==3059==    by 0x417E1B: l_strsplit (util.c:311)
==3059==    by 0x4057FC: netdev_init (netdev.c:1658)
==3059==    by 0x402E26: nl80211_appeared (main.c:112)
==3059==    by 0x41F577: get_family_callback (genl.c:1038)
==3059==    by 0x41EE3F: process_unicast (genl.c:390)
==3059==    by 0x41EE3F: received_data (genl.c:506)
==3059==    by 0x41C6F4: io_callback (io.c:120)
==3059==    by 0x41BAA9: l_main_run (main.c:381)
==3059==    by 0x402B9C: main (main.c:234)
2016-07-19 17:48:21 -05:00
Denis Kenzior
295ccf62d5 netdev: Properly cleanup removed interfaces 2016-07-19 17:45:48 -05:00
Denis Kenzior
22b599df5a device: Print warning if device list isn't empty 2016-07-19 16:49:37 -05:00
Denis Kenzior
de6dddce76 netdev: Remove redundant associate_msg 2016-07-19 16:22:24 -05:00
Denis Kenzior
c977b8092c netdev: Skip non-STA interfaces 2016-07-19 16:03:26 -05:00
Denis Kenzior
94f204b994 netdev: Act on NEW_INTERFACE & DEL_INTERFACE cmds 2016-07-19 16:02:37 -05:00
Denis Kenzior
37ea99d09e netdev: Remove netdev_new_wiphy_hint 2016-07-19 15:49:22 -05:00
Andrew Zaborowski
fc0fd49cbd device: Emit property changed signals for Name 2016-07-14 19:00:36 -05:00
Andrew Zaborowski
940f4fce46 netdev: Track interface name changes 2016-07-14 19:00:14 -05:00
Andrew Zaborowski
6fbc9d59cc device: Unregister netdev watch in device_free 2016-07-14 18:58:24 -05:00
Andrew Zaborowski
d08874f842 wsc: Remove WSC dbus interface when device disappears
Previously device.c would remove the whole object at the path of the
Device and the WSC interfaces but now the watches are called without the
whole object appearing and disappearing.
2016-07-14 09:56:40 -05:00
Andrew Zaborowski
19fa024bd8 netdev: Reset interface state on init and exit
Take any managed interface down when iwd detects it and bring it back
up to start with a clean state.  On exit take interfaces down.
2016-07-13 12:36:35 -05:00
Andrew Zaborowski
2e845b5ee2 wiphy: Powered property setter 2016-07-13 12:33:30 -05:00
Andrew Zaborowski
bafafbf080 wiphy: Add a read-only Powered property 2016-07-13 10:34:23 -05:00
Andrew Zaborowski
4ebdf4e2ca wiphy: Add Adapter objects above Device
Change the path for net.connman.iwd.Device objects to /phyX/Y and
register net.connman.iwd.Adapter at /phyX grouping devices of the same
wiphy.

Turns out no changes to the test/* scripts are needed.
2016-07-13 10:32:49 -05:00
Andrew Zaborowski
28fc8e613d device: Add a Scanning property
The boolean property indicates if a scan is ongoing.  Only the scans
triggered by device.c are reflected (not the ones from WSC) because only
those scans affect the list of networks seen by Dbus.
2016-07-13 10:32:10 -05:00
Andrew Zaborowski
eac4b2fd0f device: Make Powered property writable 2016-07-13 10:31:31 -05:00
Andrew Zaborowski
6f51950f46 netdev: Add netdev_set_powered 2016-07-13 10:27:41 -05:00
Andrew Zaborowski
377df7662c Add rfkill enable/disable and watch support
Add rfkill.c/rfkill.h to be used for watching per-wiphy RFkill state.
It uses both /dev/rfkill and /sys because /dev/rfkill is the recommended
way of interfacing with rfkill but at the same time it doesn't provide
the information on mapping to wiphy IDs.
2016-07-07 13:21:08 -05:00
Andrew Zaborowski
0095b1d9e4 device: PropertyChanged events when interface goes down 2016-07-07 12:37:25 -05:00
Andrew Zaborowski
fe6485147c network: Disconnect from known network in Forget()
Note that the autoconnect_list may still contain the network.  Currently
only the top entry from the list is ever used and only on
new_scan_results(), i.e. at the same time the list is being created.
If at some point it becomes part of actual device state it needs to also
be reset when a network is being forgotten.
2016-07-07 12:26:16 -05:00
Andrew Zaborowski
a2771d22f4 device: Add public device_disconnect function 2016-07-07 12:26:16 -05:00
Andrew Zaborowski
f468fceb02 device: Handle disconnect calls while connecting
If Disconnect is called during an ongoing connection attempt send a
CMD_DEAUTHENTICATE command same as when we're already connected, and
send a reply to potential dbus Connect call.
2016-07-07 12:26:16 -05:00
Andrew Zaborowski
9c99166e7a netdev: Fix command length passed to l_netlink_send
Quiet the following dmesg warning:
netlink: 16 bytes leftover after parsing attributes in process `iwd'.
2016-07-06 10:38:55 -05:00
Denis Kenzior
e421af2a58 netdev: React to removed netdevs 2016-07-01 14:49:34 -05:00
Denis Kenzior
0cffac45d4 wiphy: Notify netdev when a new wiphy has been added 2016-07-01 14:42:18 -05:00
Denis Kenzior
005213a3d4 netdev: Implement new_wiphy hint
When a new wiphy is added, the kernel usually adds a default STA
interface as well.  This interface is currently not signaled over
nl80211 in any way.

This implements a selective dump of the wiphy interfaces in order to
obtain the newly added netdev.  Selective dump is currently not
supported by the kernel, so all netdevs will be returned.  A patch on
linux-wireless is pending that implements the selective dump
functionality.
2016-07-01 14:39:25 -05:00
Denis Kenzior
943acddb49 eapol: Refactor eapol tx path 2016-06-28 18:45:49 -05:00
Denis Kenzior
de84aff10b netdev: Cleanup EAPoL state machine
In case of disconnection by AP or lost beacon, cancel EAPoL state
machine
2016-06-28 18:28:39 -05:00
Denis Kenzior
45dabb9e44 netdev: Call eapol_cancel if operstate fails 2016-06-28 18:24:53 -05:00
Denis Kenzior
830af391e2 netdev: Fix memory leak
==24934== 16 bytes in 1 blocks are definitely lost in loss record 1 of 1
==24934==    at 0x4C2C970: malloc (vg_replace_malloc.c:296)
==24934==    by 0x41675D: l_malloc (util.c:62)
==24934==    by 0x4033B3: netdev_set_linkmode_and_operstate
(netdev.c:149)
==24934==    by 0x4042B9: netdev_free (netdev.c:221)
==24934==    by 0x41735D: l_queue_clear (queue.c:107)
==24934==    by 0x4173A8: l_queue_destroy (queue.c:82)
==24934==    by 0x40543D: netdev_exit (netdev.c:1459)
==24934==    by 0x402D6F: nl80211_vanished (main.c:126)
==24934==    by 0x41E607: l_genl_family_unref (genl.c:1057)
==24934==    by 0x402B50: main (main.c:237)
2016-06-28 18:18:50 -05:00
Denis Kenzior
efe5bed7c5 netdev: Move eapol_read to eapol.c 2016-06-28 18:18:47 -05:00
Denis Kenzior
746b0e5cb1 netdev: Free sm if connect fails 2016-06-28 17:26:03 -05:00
Denis Kenzior
b6d651dda8 eapol: Move eapol_start 2016-06-28 17:26:03 -05:00
Denis Kenzior
e059ee01a7 eapol: Move eapol_cancel 2016-06-28 17:26:03 -05:00
Andrew Zaborowski
6819cb8907 scan: Add a trigger callback to scan_periodic_start 2016-06-27 20:27:12 -05:00
Andrew Zaborowski
4ac1cd0ac0 device: Device watch notifications on interface up/down
Instead of calling the device added or removed callback when the
interface is detected, call it when interface goes up or down.  This
only affects the addition and removal of the WSC interface now.
2016-06-27 20:20:14 -05:00
Andrew Zaborowski
a0b4b4cb2e device: Fix Powered property getter 2016-06-27 20:18:49 -05:00
Denis Kenzior
5c6024185d netdev: Use CMD_CONNECT 2016-06-27 18:55:56 -05:00
Denis Kenzior
e81af82313 wiphy: React to new_wiphy events 2016-06-24 23:32:15 -05:00
Denis Kenzior
3bd0c9ae13 wiphy: React to del_wiphy events 2016-06-24 23:31:58 -05:00
Denis Kenzior
1500756144 wiphy: Print wiphy id 2016-06-24 23:31:02 -05:00
Denis Kenzior
ed18ab4fc0 wiphy: Rework wiphy dump parser 2016-06-24 23:30:05 -05:00
Denis Kenzior
0d9ec3b5ed wiphy: Rework printing basic wiphy info 2016-06-24 23:30:05 -05:00
Denis Kenzior
49abd4556f netdev: Remove device when netdev is freed 2016-06-24 23:17:06 -05:00
Denis Kenzior
105f5f8d8e netdev: Rearrange netdev structure
Keep flags co-located
2016-06-24 23:17:06 -05:00
Andrew Zaborowski
c508d9e4df device: Make sure connected network is not freed
During the network_info refactoring the adding of the connected BSS to
device->bss_list in case it is not in the scan results has moved to
after the l_hashmap_foreach_remove call meaning that the network could
be removed even though it is still pointed at by
device->connected networks.  Reverse the order to what it was before.

Alternatively network_process network could take not of the fact the
network is connected and not call network_remove on it leaving it with
an empty bss_list.
2016-06-24 14:57:43 -05:00
Andrew Zaborowski
8f0d68139e device: Reset connected_network when disconnect operation starts
It is probably rare that a disconnect should fail but if it happens the
device->state is not returned to CONNECTED and I'm not sure if it should
be, so the ConnectedNetwork property and other bits should probably be
reset at the start of the disconnection instead of at the end.

Also check if state is CONNECTED before calling network_disconnected
because network_connected may have not been called yet.
2016-06-24 14:56:26 -05:00
Denis Kenzior
e76daf224c netdev: Implement interface filtering 2016-06-23 17:34:47 -05:00
Denis Kenzior
0eee94a264 netdev: Fix some uninitialized warnings 2016-06-23 17:34:11 -05:00
Denis Kenzior
04de3af41f main: Add command line options for white/black list
--interfaces (-i) tells iwd which interfaces to manage.  If the option
is ommitted, all interfaces will be managed.

--nointerfaces (-I) tells iwd which interfaces to blacklist.  If the
option is ommitted, no interfaces will be blacklisted.
2016-06-23 15:49:05 -05:00
Denis Kenzior
cda2026b23 netdev: Actually set rekey_offload into eapol 2016-06-22 19:18:38 -05:00
Rahul Rahul
5853440dfa netdev: support for REKEY_OFFLOAD and its event handling 2016-06-22 18:44:46 -05:00
Rahul Rahul
fb339bcc76 eapol: helper functions for REKEY_OFFLOAD 2016-06-22 18:44:17 -05:00
Denis Kenzior
dc721a6ae2 netdev: Set callbacks for operstate
When setting operstate to dormant or down, give it a callback for debug
purposes.  It looks like that operstate down message does not have a
chance to go out currently.
2016-06-21 15:18:50 -05:00
Andrew Zaborowski
844c0a256c device: Add a read-only Powered property 2016-06-21 14:08:27 -05:00
Andrew Zaborowski
6667176ec9 device: React to netdev state changes 2016-06-21 14:08:24 -05:00
Andrew Zaborowski
b6c22fc1b9 netdev: netdev watch support 2016-06-21 14:08:21 -05:00
Andrew Zaborowski
aa7a6a4619 netdev: Track interface UP flag 2016-06-21 14:08:19 -05:00
Andrew Zaborowski
c3f863f2da knownnetworks: Implement KnownNetworks interface
knownnetworks.c/.h implements the KnownNetworks interface and loads the
known networks from storage on startup.  The list of all the networks
including information on whether a network is known is managed in
network.c to avoid having two separate lists of network_info structures
and keeping them in sync.  That turns out to be difficult because the
network.c list is sorted by connected_time and connected_time changes
can be triggered in both network.c or knownnetworks.c.  Both can also
trigger a network_info to be removed completely.
2016-06-21 11:41:37 -05:00
Andrew Zaborowski
694c91db44 network: track whether network is known
network_info gets a is_known flag that is used for the
GetOrderedNetworks tracking and to implement the KnownNetworks
interface - loading of the list of known networks on startup and
forgetting networks.
2016-06-21 11:36:31 -05:00
Andrew Zaborowski
9daf1f3fcf network: Refactor network_info usage
For simplicity and future use (possibly performance), every struct network
gets a pointer to a network_info structure, there's one network_info for
every network being by any interface, not only known networks.  The SSID
and security type information is removed from struct network because the
network_info holds that information.

network_info also gets a seen_count field to count how many references
from network.info fields it has, so as to fix the removal of
network_info structures.  Previously, once they were added to the
networks list, they'd stay there forever possibly skewing the network
ranking results.

This also fixed the network ranking used by GetOrderedNetwork which
wasn't working due to a missing assignment of *index in
network_find_info also triggering valgrind alerts.
2016-06-20 23:39:42 -05:00
Denis Kenzior
311a6cf5b1 device: Make device object opaque 2016-06-16 16:37:14 -05:00
Denis Kenzior
74add19057 device: Move the rest of device specific code
.. out of wiphy.c
2016-06-16 16:37:14 -05:00
Denis Kenzior
0fe815f870 netdev: Move deauthenticate handling out of wiphy.c 2016-06-16 16:37:14 -05:00
Denis Kenzior
48c0a216d7 wiphy: Rearrange / remove #includes 2016-06-16 16:37:14 -05:00
Denis Kenzior
c28e652570 device: Move device_list management out of wiphy.c 2016-06-16 16:37:14 -05:00
Denis Kenzior
49c7515ac1 netdev: Move eapol_io handling 2016-06-16 16:37:12 -05:00
Denis Kenzior
75ce550de9 netdev: Move operstate operations out of wiphy.c
Also make netdev_set_linkmode_and_operstate static
2016-06-16 15:13:43 -05:00
Denis Kenzior
dd4b0dc3d3 netdev: Move key setting logic out of wiphy.c 2016-06-16 15:13:43 -05:00
Denis Kenzior
c714b20102 wiphy: Move handshake_failed handler out of wiphy.c 2016-06-16 15:13:43 -05:00
Denis Kenzior
64d382cc89 netdev: Move disconnect event handling
.. out of wiphy.c
2016-06-16 15:13:43 -05:00
Denis Kenzior
0eeb71e4eb netdev: Move CQM event handling out of wiphy.c 2016-06-16 15:13:43 -05:00
Denis Kenzior
d526dbc175 netdev: Move associate event handling
.. out of wiphy.c
2016-06-16 15:13:39 -05:00
Denis Kenzior
1ab6415e8c device: Handle successful connections 2016-06-16 10:53:26 -05:00
Denis Kenzior
d82754636b netdev: Move deauthenticate event handling
.. out of wiphy.c
2016-06-15 14:02:24 -05:00
Denis Kenzior
f5a7e204e7 device: Fix valgrind warning
Device removal should probably be managed by netdev objects going away,
but for now, silence the warning
2016-06-15 11:01:44 -05:00
Denis Kenzior
31a0e42772 wiphy: Move association logic out of wiphy.c
The eapol state machine parameters are now built inside device.c when
the network connection is attempted.  The reason is that the device
object knows about network settings, wiphy constraints and should
contain the main 'management' logic.

netdev now manages the actual low-level process of building association
messages, detecting authentication events, etc.
2016-06-15 10:54:13 -05:00
Denis Kenzior
b93ae37325 eapol: Add eapol_sm_get_own_ie 2016-06-14 19:57:21 -05:00
Denis Kenzior
6d81e0a172 eapol: Add eapol_sm_get_group_cipher 2016-06-14 19:57:21 -05:00
Denis Kenzior
c1ff686ed6 eapol: Add eapol_sm_get_pairwise_cipher 2016-06-14 19:57:21 -05:00
Denis Kenzior
d297fbb215 netdev: Add stubs for netdev_disconnect 2016-06-14 19:57:21 -05:00
Denis Kenzior
b2d8616ca4 device: Move device_get_address out of wiphy.c 2016-06-14 19:57:21 -05:00
Denis Kenzior
c18cf173c3 device: Move device_get_ifindex out of wiphy.c 2016-06-14 19:57:21 -05:00
Denis Kenzior
74c8af9180 device: Move device_get_wiphy out of wiphy.c 2016-06-14 19:57:21 -05:00
Denis Kenzior
e23ea59f95 device: Move device_is_busy out of wiphy.c 2016-06-14 19:57:21 -05:00
Denis Kenzior
6e57e4a00c device: Move device_get_path out of wiphy.c 2016-06-14 19:57:21 -05:00
Denis Kenzior
e0c27a2ca8 device: Move device_get_connected_network
out of wiphy.c
2016-06-14 19:57:21 -05:00
Denis Kenzior
aedbdd01ae device: Migrate authentication to netdev api
This also moves device_connect_network to device.c where it belongs
2016-06-14 19:57:21 -05:00
Denis Kenzior
51f89e34e9 netdev: Add initial netdev_connect logic 2016-06-14 19:57:18 -05:00
Denis Kenzior
6bd71066ff device: Move device_disassociated out of wiphy.c 2016-06-14 11:16:07 -05:00
Denis Kenzior
64604ed59c device: Expose device_enter_state 2016-06-14 11:13:34 -05:00
Denis Kenzior
1e99fc182e device: Group declarations inside header 2016-06-14 11:12:35 -05:00
Denis Kenzior
9d4baab8bd device: Move device structure definition
Temporarily move device structure definition into device.h and out of
wiphy.c.  Eventually the device structure should be opaque to device.c
2016-06-14 11:11:06 -05:00
Denis Kenzior
432ec3e69f storage: Return const char * 2016-06-10 09:59:59 -05:00
Andrew Zaborowski
9cef1490c5 network: Basic last seen time tracking 2016-06-10 09:33:54 -05:00
Andrew Zaborowski
a0468fb9be device: Implement GetOrderedNetworks()
Keep an updated sorted list of networks in addition to the "networks"
hashmap.  The list can be queried through the GetOrderedNetworks dbus
method.

We also take advantage of that list to get rid of a single
l_hashmap_foreach in new_scan_results.
2016-06-10 09:33:13 -05:00
Andrew Zaborowski
ca3cd12fb0 network: General network rank calculation
A function that calculates a new rank type to order all networks
currently seen by a netdev.  The order is designed for displaying the
list to user so that the networks most likely to be wanted by the user
are first on the list.
2016-06-10 09:29:43 -05:00
Andrew Zaborowski
99f99e0bc0 agent: Add reason parameter to Cancel
Add a parameter the UI can use to show user an explanation of why a
password prompt is disappearing.
2016-06-10 09:26:56 -05:00
Andrew Zaborowski
b6c9508912 storage: Add storage_network_ssid_from_path
The operation opposite to get_network_file_path.
2016-06-09 15:01:32 -05:00
Andrew Zaborowski
11f23d500c network: Add network_get_signal_strength 2016-06-09 14:40:18 -05:00
Andrew Zaborowski
dae897854b network: return boolean from network_rankmod
Since the rankmod value only makes sense for autoconnectable networks,
change network_rankmod to return an indication of whether the rankmod is
valid as a boolean instead of as a double, as discussed before.
2016-06-09 14:16:06 -05:00
Andrew Zaborowski
e07b24e5d8 wiphy: Move NULL check to device_disassociated
Do nothing in device_disassociated if device->connected_network
indicates we are not associated.  This may happen if the device was
connected since before iwd was started, this should possibly be fixed
separately by querying device state when device is detected.
2016-06-09 14:14:20 -05:00
Andrew Zaborowski
3fa9a21a39 network: Add network_disconnected
Let network handle anything that needs to be done on a disconnection,
this way keep the settings opening and closing logic in network.c.
2016-06-09 14:13:58 -05:00
Denis Kenzior
454f7d7867 iwd: Update to the new l_main api 2016-06-09 09:56:40 -05:00
Andrew Zaborowski
ab15413294 storage: Add storage_network_remove 2016-06-08 11:33:57 -05:00
Andrew Zaborowski
8be78588e2 common: Add security_from_str
The reverse operation of security_to_str.
2016-06-08 11:08:10 -05:00
Andrew Zaborowski
0cb233cdde agent: Drop unused declaration 2016-06-08 11:06:28 -05:00
Andrew Zaborowski
2285ad24ab network: Create a settings file on connection
Make sure networks of all 4 security types have a settings file created
or updated with a new modification time on a successful connect so that
autoconnect and network sorting works for networks other than PSK too.

By doing this on storage_network_touch failure we make sure we don't
overwrite anything dropped into the settings directory while we were
connecting.
2016-06-08 11:03:53 -05:00
Andrew Zaborowski
33d2ae60e9 network: Use security_to_str instead of switch(security)
Convert switch (network->security) statements to security_to_str to be
consistent across network.c in how the settings file name ending is
obtained.
2016-06-08 11:01:35 -05:00
Denis Kenzior
b2bcf97373 scan: Remove unused scan_bss_address_to_string 2016-06-06 18:25:12 -05:00
Denis Kenzior
c96d43a6da wiphy: Use util_address_to_string 2016-06-06 18:25:00 -05:00
Denis Kenzior
22e1c2f592 wsc: Use util_address_to_string 2016-06-06 18:24:49 -05:00
Denis Kenzior
64c388fe76 wiphy: Fix crash in device address property getter
Address is being returned as a string, even though it is actually an
array of 6 uint8_t elements
2016-06-06 18:23:53 -05:00
Denis Kenzior
92c943998f util: Add util_address_to_string 2016-06-06 18:23:17 -05:00
Denis Kenzior
dcfbc74326 wiphy: Remove addr from device struct 2016-06-06 12:05:24 -05:00
Denis Kenzior
cedb980f92 wiphy: Remove name from device struct 2016-06-06 12:05:20 -05:00
Denis Kenzior
d6c6e4acda netdev: Move netdev enumeration to netdev.c 2016-06-06 12:03:23 -05:00
Denis Kenzior
833ed20b9a netdev: Add netdev_get_name 2016-06-03 09:53:47 -05:00
Denis Kenzior
1573bf7d99 netdev: Add netdev_get_iftype 2016-06-03 09:53:47 -05:00
Denis Kenzior
1bd7baf44b netdev: Add netdev_find 2016-06-03 09:53:46 -05:00
Denis Kenzior
8e7829e1ab netdev: Add netdev_get_address 2016-06-03 09:53:46 -05:00
Denis Kenzior
7a3f823d26 netdev: Add netdev_get_ifindex 2016-06-03 09:53:46 -05:00
Denis Kenzior
7c359ee2c2 netdev: Add netdev struct definition 2016-06-03 09:53:46 -05:00
Denis Kenzior
8113f4c64e wiphy: Add wiphy_find 2016-06-03 09:53:46 -05:00
Denis Kenzior
61b50cf81f netdev: Parse NEW_INTERFACE and DEL_INTERFACE 2016-06-03 09:53:46 -05:00
Denis Kenzior
e5821f6ade netdev: Remove unneeded comment 2016-06-03 09:53:46 -05:00
Denis Kenzior
280f2d40ad netdev: Make netdev_init accept nl80211 2016-06-03 09:53:46 -05:00
Denis Kenzior
7b929181ca wiphy: Remove unused wiphy_notify_dellink 2016-06-01 13:07:04 -05:00
Denis Kenzior
3563c65111 netdev: Don't track NEWLINK & DELLINK
The plan is to use the much more reliable NEW_WIPHY, DEL_WIPHY,
NEW_INTERFACE, DEL_INTERFACE events.
2016-06-01 13:07:04 -05:00
Denis Kenzior
0b0fd5639f wiphy: Parse NEW_WIPHY and DEL_WIPHY events 2016-06-01 13:07:04 -05:00
Denis Kenzior
e48ca5a5a6 wiphy: Rename netdev to device 2016-06-01 13:06:59 -05:00
Denis Kenzior
af9ca22360 wiphy: Remove extraneous return 2016-05-31 11:29:48 -05:00
Andrew Zaborowski
1ba2630216 networks: Simplify parameters
for network_seen and network_connected

Only accept a struct network pointer instead of separately the ssid and
security type.  This is needed so we can do some more simplification in
the next patch by having access to the network struct.
2016-05-30 21:46:45 -05:00
Andrew Zaborowski
9fbdba0957 network: Add "const" to the getter argument types 2016-05-30 21:46:08 -05:00
Andrew Zaborowski
2e4848673a network: Check for duplicates in network_seen
It looks like with multiple netdev seeing the same networks we'd create
multiple network_info structures for each network.  Since the
"networks" list (of network_info structs) is global that's probbaly not
the intention here.
2016-05-30 21:45:52 -05:00
Andrew Zaborowski
2901cb1169 main: Restore agent_exit call before main loop exit 2016-05-25 09:57:58 -05:00
Andrew Zaborowski
176a5bcf76 storage: Encode SSIDs in file names if necessary
SSIDs with characters other than A-Z0-9_- and space are encoded with
l_util_hexstring and prefixed with a = sign to differentiate them.
2016-05-24 11:14:33 -05:00
Rahul Rahul
fc7ca17558 wiphy: added hw address property to device 2016-05-23 14:54:27 -05:00
Andrew Zaborowski
7950e2d5d3 wiphy: Emit PropertyChanged signals
for Device and Network
2016-05-23 11:55:06 -05:00
Andrew Zaborowski
ab1319a9d5 wiphy: Drop Device.GetNetworks and related signals
Drop the Device interface methods and properties made redundant by
the ObjectManager.
2016-05-23 11:48:41 -05:00
Andrew Zaborowski
15bab067fc dbus: Remove Manager interface, add AgentManager
Move the Agent-related methods to a new interface, AgentManager, and
drop the remaining methods and signals made redundant by the
ObjectManager.
2016-05-23 11:46:59 -05:00
Andrew Zaborowski
3e2562a5a8 dbus: Enable the ObjectManager interface 2016-05-23 11:43:13 -05:00
Denis Kenzior
74689303df network: Make network object opaque 2016-05-16 16:14:26 -05:00
Denis Kenzior
0e106d8534 wiphy: Use network_bss_* api 2016-05-16 16:14:15 -05:00
Denis Kenzior
44d9746e5f network: Add network_bss_list_clear 2016-05-16 16:13:52 -05:00
Denis Kenzior
b4cebf918a network: Add network_bss_list_isempty 2016-05-16 16:13:36 -05:00
Denis Kenzior
f177f75f92 network: Add network_bss_add 2016-05-16 16:06:41 -05:00
Denis Kenzior
cefba4d735 wiphy: Use network_connect_failed 2016-05-16 16:03:17 -05:00
Denis Kenzior
ad722cf004 network: Add network_connect_failed 2016-05-16 16:03:14 -05:00
Denis Kenzior
dcadf4d2f8 wiphy: Use network_autoconnect 2016-05-16 16:00:21 -05:00
Denis Kenzior
8e8b2caa9a network: Add network_autoconnect 2016-05-16 16:00:10 -05:00
Denis Kenzior
c619a71652 wiphy: Use network accessor methods 2016-05-16 15:44:27 -05:00
Denis Kenzior
b79453952c network: Add network_get_settings 2016-05-16 14:37:45 -05:00
Denis Kenzior
93c8a4f090 network: Add network_get_psk 2016-05-16 14:22:24 -05:00
Denis Kenzior
9bfa0aa768 merge: device_connect_network 2016-05-16 13:48:10 -05:00
Denis Kenzior
d4feeebdc1 network: Move network related code into network.c
away from wiphy.c
2016-05-16 12:37:48 -05:00
Denis Kenzior
5e4c675175 network: Use device_get_wiphy 2016-05-16 12:32:44 -05:00
Denis Kenzior
66610f1248 device: Add device_get_wiphy() 2016-05-16 12:26:00 -05:00
Denis Kenzior
68a79b23fb device: Add device_is_busy() 2016-05-16 12:24:41 -05:00
Denis Kenzior
a9e9be469c wiphy: Expose wiphy_select_cipher 2016-05-16 12:21:26 -05:00
Denis Kenzior
bcb2ef3e40 network: Rework connect logic 2016-05-16 12:05:28 -05:00
Denis Kenzior
2fe80a8f86 device: Add device_connect_network 2016-05-16 12:04:45 -05:00
Denis Kenzior
80aba66e98 network: Make network_emit_* static 2016-05-15 21:42:14 -05:00
Denis Kenzior
a789703f6f wiphy: Use network_create, register & remove 2016-05-15 21:41:37 -05:00
Denis Kenzior
18957e504e network: Add network_remove 2016-05-15 21:37:12 -05:00
Denis Kenzior
d0ae833edb network: Add network_register 2016-05-15 21:30:52 -05:00
Denis Kenzior
d1948c0233 network: Add network_new 2016-05-15 21:29:47 -05:00
Denis Kenzior
54e7cced8e network: Move PSK sync to network.c 2016-05-15 21:04:02 -05:00
Denis Kenzior
24366efb32 wiphy: Use network_settings_load & _close 2016-05-15 21:01:46 -05:00
Denis Kenzior
2e46201a1e network: Add network_settings_load and _close 2016-05-15 21:01:38 -05:00
Denis Kenzior
49df40fdff network: Move network_emit_removed to network.c 2016-05-12 09:52:52 -05:00
Denis Kenzior
5dc3a892db network: Move network_emit_added to network.c 2016-05-12 09:51:02 -05:00
Denis Kenzior
3ca8dfb5ad wiphy: move & rename iwd_device_get_path
Move declaration to device.h and rename to device_get_path
2016-05-12 09:49:07 -05:00
Denis Kenzior
ae1dc10c0c wiphy: Move __iwd_network_append_properties
to network.c
2016-05-11 22:32:25 -05:00
Denis Kenzior
23fe106cc5 device: Add device_get_connected_network() 2016-05-11 22:27:31 -05:00
Denis Kenzior
08d72cd213 netdev: Remove unused typedefs 2016-05-11 22:24:40 -05:00
Denis Kenzior
0c7504b5fb wiphy: Use network_get_security() 2016-05-11 22:12:25 -05:00
Denis Kenzior
b166285f44 network: Add network_get_security() 2016-05-11 22:12:25 -05:00
Denis Kenzior
f3ad1492c9 wiphy: Use network_get_path() 2016-05-11 22:12:25 -05:00
Denis Kenzior
beea6897d3 network: Add network_get_path() 2016-05-11 22:12:23 -05:00
Denis Kenzior
2ccbf65519 wiphy: Use network_get_netdev 2016-05-11 22:04:09 -05:00
Denis Kenzior
54574dc153 network: Add network_get_netdev 2016-05-11 22:02:49 -05:00
Denis Kenzior
0847e31542 wiphy: Use network_get_ssid 2016-05-11 22:01:44 -05:00
Denis Kenzior
9e4200f2f3 network: Add network_get_ssid 2016-05-11 22:00:58 -05:00
Denis Kenzior
414bc3198d wiphy: Move network object definition 2016-05-11 21:59:32 -05:00
Denis Kenzior
17a8460835 scan: Move scan_ssid_security to iwd.h
Security type is used all over the place, so move it out to a more
common place.
2016-05-11 15:54:14 -05:00
Denis Kenzior
aa7f88a78c agent: Fix bug in UnregisterAgent 2016-05-06 12:39:35 -05:00
Denis Kenzior
c2c4039e79 wiphy: Rename netdev_state to device_state 2016-05-05 12:25:45 -05:00
Denis Kenzior
f3fc0ea1f9 device: Refactor netdev watches
Turn netdev watches into device watches.  The intent is to refactor out
netdev specific details into its own class and move device specific
logic into device.c away from wiphy.c
2016-05-05 12:14:59 -05:00
Denis Kenzior
9a0d620800 wsc: Refactor includes 2016-05-05 12:07:46 -05:00
Denis Kenzior
0e3495488f wiphy: Move netdev_state enum 2016-05-05 11:40:54 -05:00
Denis Kenzior
08decb340e netdev: Move rta_add_u8
Move closer to where it is used
2016-05-05 11:32:11 -05:00
Denis Kenzior
97be0e87c3 scan: Fix crash
Sometimes the periodic scan is started and stopped before the timeout
was created.  If periodic_scan_stop was called before, the timeout
object was not reset to NULL, which can lead to a crash.
2016-04-13 16:03:33 -05:00
Denis Kenzior
3cbbe2cc42 main: Add backtracing support
Ported from oFono @ commit df5d691c39b0ff41d3d98a01db078f7157eb0250.
2016-04-13 14:08:10 -05:00
Denis Kenzior
45b7323e0a scan: Add support for scan abortions 2016-04-12 13:49:50 -05:00
Andrew Zaborowski
692bfa23fe wiphy: Sanity check before netdev_disassociated
The lost beacon event can be received when iwd thinks netdev is
diconnected if it was connected before iwd started, and then
netdev_disassociated will segfault.
2016-04-11 14:39:06 -05:00
Andrew Zaborowski
fb1adcae2a dbus: Use recently added l_dbus_name_acquire
Use the backend-independent l_dbus_name_acquire.
2016-04-04 14:35:52 -05:00
Andrew Zaborowski
a64030069e dbus: Drop unused linux/kdbus.h src/kdbus.c
Drop the functions that duplicated ell functionality and the now
unneeded kdbus.h copy.
2016-04-04 14:27:26 -05:00
Andrew Zaborowski
79839dbfd6 dbus: Use native ell kdbus calls
It seems until now dbus.c would always connect to dbus-1 (unless
DBUS_SESSION_BUS_ADDRESS pointed at kdbus) and passing -K only made
iwd create a kdbus bus and not use it.  Now use ell to actually use
kdbus instead of dbus-1 with -K.  Don't use the src/kdbus.c functions
that duplicate ell functionality.  As a side effect the connection
description and the bloom sizes are now the ell defaults.
2016-04-04 14:25:59 -05:00
Rahul Rahul
971d93a9e6 wiphy: Add ConnectedNetwork property to Device
This property is optional.  If the device is connected, it holds the
object path of the connected network.
2016-03-09 16:46:07 -06:00
Rahul Rahul
07f49bc02d dbus: Add API for adding object path value to a dict 2016-03-09 13:24:19 -06:00
Rahul Rahul
492f25c4f6 wiphy: Add Connected property to Network interface
Added a property that will allow one to figure out whether this Network
is currently connected.
2016-03-04 10:20:41 -06:00
Mat Martineau
96e7be28bd wiphy: Removed unused function 2016-02-18 18:21:22 -06:00
Denis Kenzior
e2de4423db dbus: Update to the new ell D-Bus APIs 2016-02-11 16:19:55 -06:00
Denis Kenzior
ad7bbbb920 wiphy: Record network last-connected time 2016-02-11 16:19:44 -06:00
Denis Kenzior
30d1673ba4 eapol: Add support for SHA-256 based AKMs 2016-02-10 19:18:56 -06:00
Denis Kenzior
c35409d73c eapol: Update to the new API 2016-02-10 16:55:15 -06:00
Denis Kenzior
e084839b4f crypto: Prepare for SHA256 based PTK derivation 2016-02-10 16:54:55 -06:00
Denis Kenzior
39444ab532 crypto: Add SHA256 based KDF 2016-02-10 16:30:22 -06:00
Denis Kenzior
3320d31ead sha1: Remove sha1.[ch] 2016-02-10 14:36:14 -06:00
Denis Kenzior
ac4a901518 crypto: move pbkdf2_sha1 to crypto.c 2016-02-10 14:32:27 -06:00
Denis Kenzior
6199960b52 crypto: Move + rework prf_sha1 into crypto.c 2016-02-10 14:16:32 -06:00
Denis Kenzior
064f1e0df9 crypto: Move hmac_sha1 to crypto.c 2016-02-10 14:12:46 -06:00
Denis Kenzior
962e2e8b2c wiphy: Use SHA256 AKM if available 2016-02-10 13:20:46 -06:00
Denis Kenzior
76c62b0843 scan: Keep track of SHA256 support over PSK/8021X 2016-02-10 12:56:11 -06:00
Denis Kenzior
976bb7ceb1 network: Update network_connected implementation 2016-02-09 17:08:43 -06:00
Denis Kenzior
b9402af687 scan: Add scan_ssid_security_to_str 2016-02-09 17:08:03 -06:00
Denis Kenzior
342ad9c61c eapol: Add clarifying comment 2015-11-03 16:26:34 -06:00
Denis Kenzior
05151d762d eap-md5: Convert to dynamic method registration 2015-11-02 21:51:07 -06:00
Denis Kenzior
0816d04873 eap-ttls: Convert to dynamic method registration 2015-11-02 21:51:07 -06:00
Denis Kenzior
d8d6e134f1 eap-tls: Convert to dynamic method registration 2015-11-02 21:51:07 -06:00
Denis Kenzior
cdfc854056 eap: Add dynamic EAP method registration 2015-11-02 21:51:07 -06:00
Andrew Zaborowski
02eeb82c53 wiphy: Allow connecting to 8021X networks 2015-11-02 21:51:07 -06:00
Andrew Zaborowski
14020b2aa6 eapol: Handle EAPoL-EAP packets 2015-11-02 21:45:43 -06:00
Andrew Zaborowski
2bccb7e7dc eapol: Remove user_data from __eapol_rx_packet args
Instead of passing the user_data parameter in every __eapol_rx_packet
call to be used by EAPOL in all tx_packet calls, add
eapol_sm_set_tx_user_data function that sets the value of user_data for
all subsequent tx_packet calls.  This way tx_packet can be called from
places that are not necessarily inside an __eapol_rx_packet call.
2015-11-02 21:40:21 -06:00
Andrew Zaborowski
ef9b6f41ce eapol: Separate EAPOL header from struct eapol_key
This is needed so we can better handle sending and receiving EAPoL
packets other than EAPoL-Key.
2015-11-02 21:40:21 -06:00
Andrew Zaborowski
830161399e eap: Implement the EAP-TTLS method
Only EAP as the inner authentication option is supported.  According to
wikipedia this is the most popular EAP-TTLS use case, with MD5 as the
inner EAP's method.
2015-11-02 21:40:21 -06:00
Andrew Zaborowski
c5e368a264 eap: Implement the EAP-MD5-Challenge method 2015-11-02 21:40:21 -06:00
Andrew Zaborowski
f55db6a1c4 eap: Implement EAP-TLS
Add the EAP-TLS authentication method.  Currently, all the credentials
data is read from the provisioning file even though things like the
private key passphrase should possibly be obtained from the dbus agent.
2015-11-02 21:40:21 -06:00
Denis Kenzior
88bdd46ec3 eap: Add eap_unregister_method 2015-11-02 21:40:19 -06:00
Denis Kenzior
095eec48ab eap: Make eap_register_method public 2015-11-02 09:54:12 -06:00
Andrew Zaborowski
3f17fa1159 eap: Add initial EAP API
Adds eap.c/eap.h with the initial EAP API definitions.  No actual EAP
methods are added in this patch.
2015-11-02 09:40:03 -06:00
Andrew Zaborowski
27aa254358 scan: Always call the trigger callback
Otherwise dbus Scan calls will not return on success.
2015-11-02 09:24:10 -06:00
Denis Kenzior
5f55c07da9 wiphy: Keep track of supported freqs & bands 2015-10-06 15:23:32 -05:00
Denis Kenzior
22ab0e73a2 scan: Add scan_freq_set_get_bands 2015-10-06 15:23:09 -05:00
Denis Kenzior
4c0d366fcf wsc: Reply and clean wsc_sm on netdev removal 2015-10-06 11:39:01 -05:00
Denis Kenzior
b81737a7eb wsc: Add initial scanning logic 2015-10-05 22:37:46 -05:00
Denis Kenzior
f62054eb52 scan: Allow cancelation of scan requests 2015-10-05 22:37:12 -05:00
Denis Kenzior
13dde81f5b main: Make valgrind happy 2015-10-02 12:58:38 -05:00
Denis Kenzior
14e40f27e3 netdev: Add netdev attribute getters 2015-10-02 12:58:26 -05:00
Denis Kenzior
8a68ebd65b scan: Move bss_address_to_string to scan.[ch] 2015-10-02 12:06:20 -05:00
Denis Kenzior
6a28baa893 scan: Process Active scan requests 2015-09-30 13:38:41 -05:00
Denis Kenzior
e551133960 scan: Add scan_active 2015-09-30 11:36:00 -05:00
Denis Kenzior
46da18f23b wsc: Register WSC interface 2015-09-29 12:15:37 -05:00
Denis Kenzior
ca0e3eb940 wiphy: Call netdev watches 2015-09-29 12:14:48 -05:00
Denis Kenzior
6068b3e364 scan: Make nl80211 static 2015-09-28 20:41:02 -05:00
Denis Kenzior
8026921801 main: Rework init/exit logic 2015-09-28 20:41:02 -05:00
Denis Kenzior
f8cf9cf154 wsc: Add wsc_init and wsc_exit 2015-09-28 20:41:00 -05:00
Denis Kenzior
e1bdd7ce1e netdev: Add netdev watch infrastructure 2015-09-28 20:37:08 -05:00
Denis Kenzior
b19a683c36 wiphy: Rename function 2015-09-28 20:37:08 -05:00
Denis Kenzior
907b7d1e07 netdev: Move NETDEV_STATE enum to netdev.h 2015-09-28 20:37:08 -05:00
Denis Kenzior
50cc76e227 dbus: Add dbus_error_not_implemented 2015-09-28 20:37:07 -05:00
Denis Kenzior
d0d509d864 wsc: Add initial PushButton SM 2015-09-28 20:37:07 -05:00
Denis Kenzior
46a0c1db00 scan: Extract WSC IEs 2015-09-28 20:37:04 -05:00
Denis Kenzior
0b298dd313 scan: Add debug in scan_exit 2015-09-22 14:07:27 -05:00
Denis Kenzior
3f7e6e86bb scan: Reset nl80211 when scan_exit called 2015-09-22 14:07:02 -05:00
Denis Kenzior
f064230afa scan: Add scan request queue
For queuing up Active & Passive scans from other modules inside IWD
2015-09-22 14:06:40 -05:00
Denis Kenzior
b000c702b0 scan: Refactor scanning code
In preparation for adding active scans
2015-09-22 14:04:08 -05:00
Denis Kenzior
c37e700921 wsc: Add wsc_uuid_from_addr 2015-09-18 17:16:09 -05:00
Denis Kenzior
e055460709 wsc: Rename wsc.[ch] to wscutil.[ch] 2015-09-10 23:07:34 -05:00
Denis Kenzior
8261dab46b ie: Add ie_tlv_encapsulate_wsc_payload 2015-09-10 22:30:43 -05:00
Denis Kenzior
c2aa596dd4 ie: Tweak function signature 2015-09-10 22:29:58 -05:00
Denis Kenzior
c23b1e3bc0 wsc: Add wsc_build_probe_request utility 2015-09-09 09:31:52 -05:00
Denis Kenzior
241e459ae7 wsc: Add wsc_parse_probe_request 2015-09-09 08:52:49 -05:00
Denis Kenzior
ab33a22149 wsc: Handle ATTR_REQUESTED_DEVICE_TYPE 2015-09-09 08:52:49 -05:00
Denis Kenzior
a1c198ab11 wsc: extract ATTR_CONFIGURATION_ERROR 2015-09-08 21:09:04 -05:00
Denis Kenzior
b0e306b407 wsc: Extract ATTR_ASSOCIATION_STATE 2015-09-08 21:07:17 -05:00
Denis Kenzior
9a3e78d1fc wsc: Add extractor for ATTR_REQUEST_TYPE 2015-09-08 20:45:52 -05:00
Denis Kenzior
3eee3d47ee wsc: Add Beacon frame parser 2015-07-23 19:42:29 -05:00
Denis Kenzior
86252a98cc wsc: Parse additional attributes for ProbeResponse
Probe Response messages can contain additional attributes tucked away
into the WFA-Vendor specific attribute.  Parse these attributes while
making sure the order is as expected.
2015-07-23 16:47:34 -05:00
Denis Kenzior
2f5a62d85c wsc: Add additional comment 2015-07-23 16:47:34 -05:00
Denis Kenzior
01b5445e94 wsc: Add SelectedRegistrar attribute checking 2015-07-23 16:47:34 -05:00
Marcel Holtmann
07301eb74f wsc: Cast data pointer into char for UTF-8 validation 2015-07-19 18:44:40 +02:00
Denis Kenzior
fa9b0e721b wsc: Add initial parser for ProbeResponse messages 2015-07-17 14:53:48 -05:00
Denis Kenzior
2cc0be5482 wsc: Add initial set of extractor functions 2015-07-17 14:53:21 -05:00
Denis Kenzior
cd465852b4 wsc: Add initial message parser framework 2015-07-17 14:52:46 -05:00
Denis Kenzior
ad08dfad33 wsc: Add WFA extension iterator + recurse 2015-07-15 14:44:28 -05:00
Denis Kenzior
65c8a29370 wsc: Add WSC attribute iterator 2015-07-15 12:52:23 -05:00
Denis Kenzior
2fdf03cb84 ie: Rearrange header order 2015-07-13 13:26:55 -05:00
Denis Kenzior
0bf7fffbac ie: fix whitespace 2015-07-09 14:20:59 -05:00
Denis Kenzior
3442736869 ie: add ie_tlv_extract_wsc_payload 2015-07-09 14:20:10 -05:00
Denis Kenzior
0389c60066 wsc: Add initial enum definitions from the spec 2015-07-01 09:46:43 -05:00
Denis Kenzior
94aba17968 wiphy: Add auto-connect logic 2015-06-22 18:33:55 -05:00
Denis Kenzior
f055c22825 wiphy: Don't crash if called outside D-Bus 2015-06-22 18:33:38 -05:00
Denis Kenzior
002ca518c9 wiphy: Keep track of auto-connect candidates 2015-06-22 17:42:30 -05:00
Denis Kenzior
a2be179f57 wiphy: Add netdev state machine 2015-06-22 17:16:18 -05:00
Denis Kenzior
cd1ef5acf7 main: add network_init and network_exit 2015-06-22 15:08:12 -05:00
Denis Kenzior
55f4c3275b network: Fix typo 2015-06-22 15:08:02 -05:00
Denis Kenzior
971b3dfed0 scan: Make scan_bss_compute_rank static 2015-06-22 14:12:20 -05:00
Denis Kenzior
ce670bdcb1 network: Add network_rankmod 2015-06-18 06:11:14 -05:00
Denis Kenzior
d3f0bd5e27 network: Add initial network usage tracking 2015-06-18 05:18:26 -05:00
Denis Kenzior
035b2c1522 scan: add missing forward-declarations 2015-06-18 03:48:06 -05:00
Denis Kenzior
cbff1372e8 storage: add storage_network_get_mtime 2015-06-18 03:19:28 -05:00
Denis Kenzior
e153d94989 storage: Add storage_network_touch 2015-06-16 19:16:42 -05:00
Denis Kenzior
831d702ab2 wiphy: Add rank to debug output in process_bss 2015-06-16 17:12:28 -05:00
Denis Kenzior
0d977f62f6 wiphy: Use scan_bss_rank_compare 2015-06-16 17:12:28 -05:00
Denis Kenzior
0cba8ea2e9 scan: Add scan_bss_rank_compare 2015-06-16 17:12:26 -05:00
Denis Kenzior
7df688e11b wiphy: Fix memory leak
==2469== 24 bytes in 1 blocks are still reachable in loss record 1 of 1
==2469==    at 0x4C2B970: malloc (vg_replace_malloc.c:296)
==2469==    by 0x40E6DD: l_malloc (util.c:62)
==2469==    by 0x40F1CD: l_queue_new (queue.c:63)
==2469==    by 0x40D534: scan_init (scan.c:796)
==2469==    by 0x403AC3: nl80211_appeared (wiphy.c:2121)
==2469==    by 0x415FF3: get_family_callback (genl.c:987)
==2469==    by 0x415A4F: process_request (genl.c:381)
==2469==    by 0x415A4F: received_data (genl.c:492)
==2469==    by 0x413184: io_callback (io.c:120)
==2469==    by 0x4127C2: l_main_run (main.c:346)
==2469==    by 0x40253E: main (main.c:171)
2015-06-10 16:41:37 -05:00
Denis Kenzior
03004bd7b6 scan: Rename scan_free to scan_exit 2015-06-10 16:41:37 -05:00
Denis Kenzior
9773405c47 scan: Parse scanned frequencies 2015-06-10 16:41:37 -05:00
Denis Kenzior
b70f5a239d scan: Add scan_freq_set utility class 2015-06-10 16:41:35 -05:00
Denis Kenzior
5ae63817b9 scan: Add scan_freq_to_channel 2015-06-10 16:38:49 -05:00
Denis Kenzior
f24b550196 scan: Include supported rates in ranking 2015-06-10 16:38:49 -05:00
Denis Kenzior
9eac017ec4 scan: Parse [extended] supported rates ie 2015-06-10 16:38:45 -05:00
Denis Kenzior
f648a3f0eb scan: Include BSS Load channel utilization in rank 2015-06-10 16:28:14 -05:00
Denis Kenzior
3f2c728242 scan: Fix signal strength ranking calculation
We incorrectly ranked lower signal strength APs higher.
2015-06-10 16:28:14 -05:00
Denis Kenzior
99ac4d1b0d scan: Make factors static const 2015-06-10 16:28:14 -05:00
Denis Kenzior
7cded805ce ie: Add [extended] supported rates parser 2015-06-10 16:28:12 -05:00
Denis Kenzior
baa97b13e9 ie: Add BSS Load parser 2015-06-10 10:39:33 -05:00
Denis Kenzior
f1d81cd3c5 eapol: Remove unneded TODO comment 2015-06-08 10:46:48 -05:00
Denis Kenzior
1b4a3f19f3 scan: Add initial BSS rank computation 2015-06-05 18:18:55 -05:00
Denis Kenzior
05c83349c6 scan: Add periodic scanning 2015-06-04 22:32:10 -05:00
Denis Kenzior
f2f1bfcdf9 scan: Move rest of scanning code into scan.c 2015-06-01 09:45:47 -05:00
Denis Kenzior
92c677e715 wiphy: Remove scheduled scan support
Refactoring the entire scan code, and this part seems to not be
supported by the target kernels.  Revisit / redo this functionality once
things become a bit clearer.
2015-05-31 22:10:35 -05:00
Andrew Zaborowski
00cafb2cc5 wiphy: Check early that a BSS supports compatible ciphers.
In the D-bus .Connect call return an error immediately if we
find that there's no common cipher supported between iwd, the
network adapter and the AP.  This is to avoid asking the agent
for the passkey if we know the connection will fail.

An alternative would be to only show networks that we can connect
to in the scan results on D-bus but I suspect that would cause
more pain to users debugging their wifi setups on average.

For now, if a passphrase is needed we check once before querying
for passphrase and recheck afterwards when we're about to
associate.
2015-05-27 08:52:01 -05:00
Denis Kenzior
99cdb860c0 eapol: Simplify install_tk callback 2015-05-21 21:10:21 -05:00
Denis Kenzior
e93dd44607 eapol: Simplify GTK install callback
Instead of passing in the RSN/WPA elements, simply pass in the
configured cipher.  This will make the implementation of the install_gtk
callback much simpler.
2015-05-21 21:08:47 -05:00
Denis Kenzior
d4cdd74ae0 ie: Add ie_rsn_cipher_suite_to_cipher 2015-05-21 20:58:42 -05:00
Denis Kenzior
d22a1af576 wiphy: Group RSN/WPA generation and setup 2015-05-21 20:43:54 -05:00
Denis Kenzior
9992d3aeda eapol: Extract & keep track of desired ciphers
When our own WPA IE or RSN IE are set, extract group and pairwise
ciphers.  These ciphers are the ones we desire to use for the secure
connection.
2015-05-19 00:05:53 -05:00
Denis Kenzior
12551b52ff eapol: Sanity check 2nd RSNE
If the second (optional) RSN element is included in Step 3/4 of the
4-way handshake, parse it and perform basic sanity checks
2015-05-18 23:49:11 -05:00
Denis Kenzior
8593ebaad4 eapol: Set wpa_key_id in WPA1 Step 2 of 2 2015-05-18 14:45:09 -05:00
Andrew Zaborowski
a227d0b00f eapol: In GTK step 2 of 2, secure bit is always 1 2015-05-18 12:50:50 -05:00
Andrew Zaborowski
0293b62f2e wiphy: select TKIP if CCMP not supported
If AP does not support CCMP, or if the wiphy does not.
2015-05-18 12:50:50 -05:00
Andrew Zaborowski
a84d232eb1 eapol: Accept 32-byte keys in verify_ptk_3_of_4
TKIP key data is 32 bytes long.
2015-05-18 12:37:34 -05:00
Andrew Zaborowski
4b1555c935 scan: Utility to find AP supported ciphers
Extracts the supported ciphers masks from the beacon data.  If RSN IE
was present, the WPA IE is ignored.
2015-05-18 12:37:34 -05:00
Andrew Zaborowski
27d18cdd96 wiphy: Detect IE type in key install callbacks 2015-05-18 12:34:47 -05:00
Denis Kenzior
e2591b9865 wiphy: Track whether Rekey Offload is supported 2015-05-06 15:24:14 -05:00
Denis Kenzior
619448cacc eapol: Sanity check wpa_key_id field a bit more 2015-05-05 22:26:11 -05:00
Denis Kenzior
9793054a0a eapol: Update TODO comment 2015-05-05 22:19:45 -05:00
Denis Kenzior
a38b6f1f9a eapol: Add missing newline 2015-05-05 22:18:35 -05:00
Denis Kenzior
8f3fd6e47d eapol: Add eapol_verify_gtk_2_of_2 2015-05-05 22:04:21 -05:00
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
31284bf86b wiphy: If handshake failed check connect_pending
When handling repeated 4-Way Handshakes from the AP there will be no
.Connect() call pending so we need to check that netdev->connect_pending
is non-NULL.  It may be a good idea to check this even during initial
handshake.
2015-05-05 21:22:41 -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
1d0afbc44c wiphy: Basic WPA support
Legacy WPA will be used with APs that advertise WPA support and
no WPA2 (RSN).  TKIP is not yet supported though, so only CCMP
will work.
2015-05-05 21:22:34 -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
Denis Kenzior
1795105c60 wiphy: Move scan result parsing to scan.c 2015-05-01 17:27:42 -05:00
Denis Kenzior
bf43acfd93 scan: Add scan_bss_free 2015-04-30 22:21:31 -05:00
Denis Kenzior
73a26c51b6 scan: Move struct bss to scan_bss in scan.h 2015-04-30 21:38:27 -05:00
Denis Kenzior
348a90ada3 wiphy: Tweak errors returned by Disconnect() 2015-04-30 18:42:55 -05:00
Denis Kenzior
0286dfadd4 wiphy: Handle beacon loss events 2015-04-30 18:42:44 -05:00
Denis Kenzior
d127e91ff8 dbus: Add dbus_error_not_connected 2015-04-30 18:41:53 -05:00
Denis Kenzior
efe795b72d wiphy: Fix memory leak
When disconnect is triggered locally, we do not clean up properly.

==4336==    at 0x4C2B970: malloc (vg_replace_malloc.c:296)
==4336==    by 0x40CEED: l_malloc (util.c:62)
==4336==    by 0x40F46A: l_settings_new (settings.c:82)
==4336==    by 0x40CE2E: storage_network_open (storage.c:180)
==4336==    by 0x40498E: network_connect_psk (wiphy.c:307)
==4336==    by 0x40498E: network_connect (wiphy.c:359)
==4336==    by 0x41D7EE: _dbus_object_tree_dispatch (dbus-service.c:845)
==4336==    by 0x416A16: message_read_handler (dbus.c:297)
==4336==    by 0x411984: io_callback (io.c:120)
==4336==    by 0x410FC2: l_main_run (main.c:346)
==4336==    by 0x40253E: main (main.c:171)
2015-04-30 17:01:20 -05:00
Denis Kenzior
341b69ce7c wiphy: Fix memory leak
This happens when connecting / disconnecting successfully multiple
times.

==4336== 64 bytes in 2 blocks are definitely lost in loss record 9 of 11
==4336==    at 0x4C2B970: malloc (vg_replace_malloc.c:296)
==4336==    by 0x40CEED: l_malloc (util.c:62)
==4336==    by 0x40D6D9: l_util_from_hexstring (util.c:493)
==4336==    by 0x4049C6: network_connect_psk (wiphy.c:315)
==4336==    by 0x4049C6: network_connect (wiphy.c:359)
==4336==    by 0x41D7EE: _dbus_object_tree_dispatch (dbus-service.c:845)
==4336==    by 0x416A16: message_read_handler (dbus.c:297)
==4336==    by 0x411984: io_callback (io.c:120)
==4336==    by 0x410FC2: l_main_run (main.c:346)
==4336==    by 0x40253E: main (main.c:171)
2015-04-30 17:00:38 -05:00
Denis Kenzior
5137d8b855 wiphy: Ensure connected_bss is always valid 2015-04-30 16:21:56 -05:00
Denis Kenzior
15620721b0 wiphy: Store connected_network on netdev object
Instead of storing the network pointer for each BSS, store it on the
netdev object.  This saves space inside struct bss and makes longer term
refactoring simpler.
2015-04-30 16:21:56 -05:00
Denis Kenzior
67a895c95f wiphy: Simplify code that removes lost networks
The current code is quite complicated and can be made simpler by using
the newly introduced l_hashmap_foreach_remove function.
2015-04-30 16:21:56 -05:00
Denis Kenzior
4c11845198 wiphy: Fix memory leak
==4249== 231 (32 direct, 199 indirect) bytes in 1 blocks are definitely
lost in loss record 10 of 10
==4249==    at 0x4C2B970: malloc (vg_replace_malloc.c:296)
==4249==    by 0x40CF5D: l_malloc (util.c:62)
==4249==    by 0x40F4DA: l_settings_new (settings.c:82)
==4249==    by 0x40CE9E: storage_network_open (storage.c:180)
==4249==    by 0x40499E: network_connect_psk (wiphy.c:307)
==4249==    by 0x40499E: network_connect (wiphy.c:359)
==4249==    by 0x41D85E: _dbus_object_tree_dispatch (dbus-service.c:845)
==4249==    by 0x416A86: message_read_handler (dbus.c:297)
==4249==    by 0x4119F4: io_callback (io.c:120)
==4249==    by 0x411032: l_main_run (main.c:346)
==4249==    by 0x40253E: main (main.c:171)
2015-04-30 16:21:56 -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
Denis Kenzior
93aaf21459 wiphy: Add initial preference management
This patch saves off the PSK generated based on the passphrase provided
by the agent/user.  The PSK is saved only if the connection is
successful.

Subsequent connection attempts to the known AP use the PSK saved on the
filesystem (default /var/lib/iwd/<ssid>.psk).  If the connection fails,
the agent will again be asked for the passphrase on the next attempt.
2015-04-27 07:55:13 -05:00
Denis Kenzior
9d7f3030f0 storage: Add initial set of utilities 2015-04-27 07:55:09 -05:00
Denis Kenzior
a28f3fa3ec wiphy: Parse ciphers supported by the phy 2015-04-17 13:02:32 -05:00
Denis Kenzior
431cadb7aa wiphy: Optimize storage 2015-04-17 12:49:56 -05:00
Andrzej Zaborowski
f424559af5 iwd: Add -K to getopt optstring to fix short option. 2015-04-17 10:45:00 -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
c9f1090380 wiphy: If connection failed, reset the PSK
This allows us to retry the agent for the correct passphrase
2015-04-08 15:07:02 -05:00
Denis Kenzior
0b48ba3a4a wiphy: Use CMD_DISCONNECT, not CMD_DEAUTHENTICATE
CMD_DEAUTHENTICATE seems to carry only the management frame pdu
information.  CMD_DISCONNECT is carrying the information that is
actually needed by us:
> Event: Disconnect (0x30) len 28		1140.118545
    Wiphy: 0 (0x00000000)
    Interface Index: 3 (0x00000003)
    Reason Code: 2 (0x0002)
    Disconnect by AP: true
2015-04-08 15:04:22 -05:00
Denis Kenzior
313dcbb8ff wiphy: Rework Device.Disconnect() logic 2015-04-08 15:03:28 -05:00
Denis Kenzior
6921e239a4 wiphy: Only support UTF-8 SSIDs
We will ignore non-UTF8 based SSIDs.  Support for non-UTF8 SSIDs seems
to be of dubious value in the real world as the vast majority of
consumer devices would not even allow such SSIDs to be configured or
used.

There also seems to be no compelling argument to support such SSIDs, so
until that argument arrives, non-UTF8 SSIDs will be filtered out.  This
makes the D-Bus API and implementation much easier.
2015-04-08 13:38:41 -05:00
Denis Kenzior
3877a4e5dd util: Add util_ssid_is_utf8 2015-04-08 13:18:54 -05:00
Denis Kenzior
b2e1c36cbb wiphy: Stop eapol state machine if disconnecting 2015-03-29 22:50:34 -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
ecede21c1e wiphy: Handle handshake failures 2015-03-29 22:32:11 -05:00
Denis Kenzior
3a6c06e85b wiphy: De-auth if setting key transaction fails 2015-03-29 22:32:11 -05:00
Denis Kenzior
85a5d7ba98 wiphy: Keep track of new/set key command ids 2015-03-29 22:32:11 -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
b81e22f809 wiphy: Move reason codes to mpdu.h 2015-03-29 20:27:57 -05:00
Jukka Rissanen
7b945d948f wiphy: Set the linkmode and operstate of the link
We need to set the linkmode and operstate after successful
authentication.

Initial value for linkmode is 1 (user space controlled) and
IF_OPER_DORMANT for opermode. After successful authentication,
the operstate is set to IF_OPER_UP.

More specific details can be seen in kernel sources at
https://www.kernel.org/doc/Documentation/networking/operstates.txt
2015-03-27 13:14:31 -05:00
Jukka Rissanen
6dbd544a55 netdev: Add function to set the linkmode and operstate of the link
This is needed after connecting successfully to AP.
2015-03-27 13:13:33 -05:00
Jukka Rissanen
42622525d2 wiphy: Send NL80211_CMD_SET_STATION command to kernel
After we have authenticated successfully, send the Set Station
command to kernel so that AP gets authorized.
2015-03-27 13:12:47 -05:00
Denis Kenzior
86ea449cd1 wiphy: Make sure to set user_data
This is needed for TK/GTK installation
2015-03-25 23:28:45 -05:00
Denis Kenzior
0412360d77 wiphy: Install group key 2015-03-25 23:28:40 -05:00
Denis Kenzior
6ec364cb86 eapol: Add __eapol_set_gtk_install_func 2015-03-25 23:28:22 -05:00
Denis Kenzior
75bacbb896 wiphy: Install pairwise key 2015-03-25 23:28:18 -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
Denis Kenzior
d075d49a96 crypto: Use same values as nl80211 2015-03-25 22:33:07 -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
842eb643eb wiphy: Return an error if agent request fails
If there is no agent registered, then the caller should not be hanging
without a response forever.
2015-03-20 15:42:50 -05:00
Denis Kenzior
141a1831c0 dbus: Add dbus_error_no_agent 2015-03-20 15:42:39 -05:00
Denis Kenzior
709b94587e wiphy: Print an error if PMK generation fails 2015-03-20 15:22:44 -05:00
Denis Kenzior
204964fd8d sha1: Return right away if checksum creation fails
This patch covers pbkdf2_sha1 and prf_sha1
2015-03-20 14:56:27 -05:00
Denis Kenzior
86e7883c74 eapol: Print a message if MIC calculation fails 2015-03-20 14:52:49 -05:00
Denis Kenzior
b27c47aa77 sha1: Return right away if l_checksum_new fails 2015-03-20 14:50:57 -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
2598a1efed wiphy: call eapol_init and eapol_exit 2015-03-20 12:30:24 -05:00
Denis Kenzior
4c351196a9 wiphy: Print errno if read fails 2015-03-20 12:30:11 -05:00
Denis Kenzior
25af920563 wiphy: Separate out the ell include
To make it clear it is not a system include
2015-03-20 12:29:50 -05:00
Denis Kenzior
656318ed0c eapol: Update eapol_tx_packet_func_t declaration
Use aa and spa instead of aa_addr and sta_addr
2015-03-20 11:43:42 -05:00
Marcel Holtmann
2c061e6394 wiphy: Fix compiler warning with sizeof function
CC       src/wiphy.o
src/wiphy.c: In function ‘eapol_read’:
src/wiphy.c:172:24: error: argument to ‘sizeof’ in ‘memset’ call is the same expression as the destination; did you mean to remove the addressof? [-Werror=sizeof-pointer-memaccess]
  memset(&sll, 0, sizeof(&sll));
                        ^
2015-03-20 06:43:54 +01: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
96cd2391da wiphy: Start 4-way handshake 2015-03-20 00:27:38 -05:00
Denis Kenzior
2a41fe6dd2 eapol: Add read handler for PAE frames 2015-03-20 00:27:38 -05:00
Denis Kenzior
7835eb8b88 wiphy: Fix style 2015-03-19 23:57:37 -05:00
Jukka Rissanen
24e79280a9 wiphy: DBus reply was sent too early when connecting PSK network
We can give reply to connect DBus call in associating event only
when we are connecting to Open network. For PSK AP, the reply can
only be sent after we have finished 4-way handshaking.
2015-03-19 23:57:37 -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
b526df19d6 eapol: Fix __eapol_rx_packet declaration 2015-03-19 23:57:36 -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
Denis Kenzior
dcb5045d8f iwd.conf: Punch hole for agent 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
Ravi kumar Veeramally
02b501b4f0 core: Find WPA BSS from scan results
Parse vendor specific IE and BSS scan results, find it AP has
WPA security details.
2015-03-16 12:15:23 -05:00
Denis Kenzior
29a89d2a8b ie: There can be only one group_cipher
So the use of & operation is unneeded.  A more correct way is to use the
equals operator.
2015-03-16 12:12:59 -05:00
Denis Kenzior
8c172f4ec1 ie: Group comments together with relevant code 2015-03-16 12:10:43 -05:00
Ravi kumar Veeramally
b9007cbc9a ie: Provide a utility to build WPA IE
Build WPA IE based on vendor specific data.
2015-03-16 12:06:49 -05:00
Ravi kumar Veeramally
50c7346d19 ie: Parse vendor specific IE
Currently it supports Microsoft vendor specific information element
with version and type value 1 only. Typically it contains WPA security
related information.
2015-03-16 12:01:59 -05:00
Jukka Rissanen
56c4dc1a8c wiphy: Add enumeration of reason codes
When disconnecting, use a properly documented reason code.  These codes
come from the ieee80211.h file which is part of the Linux Kernel.
2015-03-12 11:19:27 -05:00
Tomasz Bursztyka
279ed50441 wiphy: Don't parse attributes of scan reply
The success or not of a scan command is found from the message directly.
There's no need to look for any attribute from the scan netlink answer.
The message is an error message or not, and that tells if the scan has
been started or not.
2015-03-11 10:24:34 -05:00
Tomasz Bursztyka
9c1780c0a1 wiphy: Use dbus object path as network key in hash
Modifying a bit how networks are stored inside the hashtable:
1 - instead of the network id, the network's object path is used
2 - network holds the pointer of the object path
3 - the hashtable does not free the key (network_free() will)

This permits to optimize on:
1 - one memory allocation used for 2 distinct things
2 - remove the need to re-compute the object path (and the id) when it's
needed, it can use dircetly the one stored in the network structure.
2015-03-10 09:32:58 -05:00
Patrik Flykt
1637f3519a wiphy: Request passphrase when connecting
Request a passphrase via Agent if none is set at the time network is
being connected. When freeing a network, cancel any outstanding Agent
requests and free allocated memory.
2015-03-06 12:51:51 -06:00
Jukka Rissanen
84d61c521f agent: Only cancel if default agent is registered
If we do not have a default agent registered, then do not try
to cancel a request as there will not be one.
2015-03-06 12:45:54 -06:00
Ravi kumar Veeramally
e24b18accd wiphy: Handle failed netlink requests
l_genl_family_send only returns request id. If request
failed at low level, current implementation does not handle that.
In case of request failure clear pending dbus messages.
2015-03-03 09:43:48 -06:00
Denis Kenzior
2bcfc15e96 eapol: Remove unneeded whitespace 2015-03-02 21:47:27 -06:00
Denis Kenzior
926cc6cd17 agent: Use a generic pointer for the callback
Since this function is generic, no need to use a specific callback type.
2015-03-02 21:07:49 -06:00
Jukka Rissanen
e17d2d63c2 agent: Make sure Release is sent when iwd exits
The main loop cannot be quit in signal handler as that would
prevent the agent.c from sending the Release command to the agent.
2015-03-02 20:59:01 -06:00
Jukka Rissanen
02a8eddd8f agent: Release the agent when iwd quits
Send Release command to agent and remove used resources when
iwd exits.
2015-03-02 20:57:39 -06:00
Jukka Rissanen
405b724266 agent: Cancel pending agent request
Allow user to cancel a pending user agent request. This typically
happens when user decides to disconnect a pending connection
request.
2015-03-02 20:57:14 -06:00
Jukka Rissanen
c275fca1e3 agent: Ask passphrase from the user agent
Add support for asking passphrase information from the registered
user agent.
2015-03-02 20:56:12 -06:00
Jukka Rissanen
e6e4649a40 agent: Implement request core
This patch adds core support for sending and managing requests
that are sent to user agent.
2015-03-02 20:46:45 -06:00
Tomasz Bursztyka
ab07091f8c util: Move msg_append_attr into util part 2015-03-02 20:44:02 -06:00
Denis Kenzior
1d8b330261 wiphy: Use new l_genl send() APIs 2015-02-27 11:00:45 -06:00
Denis Kenzior
feefad9957 scan: use new l_genl send APIs 2015-02-27 11:00:27 -06:00
Jukka Rissanen
5c4a2cf61a manager: Initialize the agent dbus interface 2015-02-27 10:42:58 -06:00
Jukka Rissanen
4e0fc2150d agent: DBus agent register and unregister
Implement DBus agent register and unregister functions.
2015-02-27 09:40:59 -06:00
Jukka Rissanen
b46f06a9ad agent: Initial agent support
Init, setup and exit functions.
2015-02-27 09:37:32 -06:00
Ravi kumar Veeramally
67cdc80753 wiphy: Open PAE socket when an interface is found
Open a PAE socket to retrieve eapol frames for 4-way handshake.
2015-02-26 10:55:01 -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
Tomasz Bursztyka
6b018ca6f7 wiphy: Reduce static allocation size
iwd_device_get_path() is not going to produce longer string than 12
bytes (/ + maximum of uint32_t expressed as a string + '\0').
2015-02-26 10:05:16 -06:00
Denis Kenzior
b067c08cfe wiphy: Remove unneeded initialization 2015-02-26 10:03:51 -06:00
Denis Kenzior
e69b21ccdf wiphy: Don't store rsne unless needed
Open networks do not contain a RSN element, so storing a 256 byte buffer
was too expensive.

This patch also has the side-effect of fixing detection of Open
Networks.  Prior to this, if the scan results did not contain an RSN IE,
the 'rsne' variable would be set to all zeros.  scan_get_ssid_security
would then be called, but instead of a NULL struct ie_rsn_info, a
non-null, but zerod out ie_rsn_info would be passed in.  This caused the
code to work, but for the wrong reasons.
2015-02-25 21:13:24 -06:00
Denis Kenzior
458ad2af77 wiphy: Set authentication parameters for WPA2 2015-02-25 20:56:46 -06:00
Ravi kumar Veeramally
19957f1162 wiphy: Remove extra white space 2015-02-25 11:34:42 -06:00
Ravi kumar Veeramally
46cdef5f7b wiphy: Fix deauthenticate event from AP
If AP issued deauthenticate event, netdev->connect_pending is null.
iwd crashes without this check.
2015-02-25 11:23:46 -06:00
Denis Kenzior
97a92a9d02 wiphy: Don't connect to networks we don't support 2015-02-24 23:19:27 -06:00
Denis Kenzior
d77238d5fd dbus: Add not supported error 2015-02-24 23:19:16 -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
975953dd89 wiphy: Store RSN IE inside struct bss 2015-02-24 23:11:48 -06:00
Denis Kenzior
c9bab96237 wiphy: Store ssid in static buffer
Instead of mallocing the ssid buffer, use a static array.  This removes an
extra couple of malloc/free operations and should result in less memory
utilization on average.
2015-02-24 23:03:15 -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
b1ca41b476 ie: Add length/data/tag inline getters 2015-02-24 17:11:27 -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
Jukka Rissanen
0403be7fee dbus: Add more error reporting functions
Report error for
- invalid dbus arguments
- if object already exists
- if object is not found
2015-02-24 11:19:49 -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
Ravi kumar Veeramally
8f5ca9dc73 wiphy: Implement initial disconnect functionality
Adding initial network disconnection implementation. Sends
deauthentication and reply through dbus depends upon its response.
2015-02-20 09:47:50 -06:00
Jukka Rissanen
d6fbb2dcac dbus: Add agent interface definition 2015-02-19 10:14:47 -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
02d101e3d7 sha256: Remove and move to src/crypto.c 2015-02-18 20:45:52 -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
dd56283b11 arc4: Add arc4_skip 2015-02-17 16:53:15 -06:00
Denis Kenzior
6e6783fc11 aes: Add aes_unwrap 2015-02-17 16:53:15 -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
Ravi kumar Veeramally
f63b8b2ec9 wiphy: Fix open network connection
Authenticate event on wiphy mlme notification does not provide
enough information on which network/bss authentication command
was sent. BSS and network information is required to send associate
command to AP. So cache bss pointer in netdev struct and retrieve
on wiphy mlme notifications.
2015-02-13 17:04:31 -06:00
Ravi kumar Veeramally
b1af2b6fe5 wiphy: Handle scan pending properly in netdev_free
If the device scan call reply is pending still on netdev_free call,
reply operation aborted.
2015-02-13 17:01:35 -06:00
Ravi kumar Veeramally
7f56f561c6 dbus: Provide dbus_error aborted and not_available 2015-02-13 17:01:06 -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
7ffe465ab2 sha256: Remove unneeded resets 2015-02-13 15:02:16 -06:00
Denis Kenzior
0abbde0ebb sha1: Remove unneeded resets 2015-02-13 15:02:04 -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
Denis Kenzior
fc60014d47 ie: Add ie_build_rsne 2015-02-03 21:45:14 -06:00
Denis Kenzior
51dfb02ade ie: Add ie_build_akm_suite 2015-02-03 21:44:56 -06:00
Denis Kenzior
5653baa0b9 ie: Add ie_build_cipher_suite 2015-02-03 21:44:35 -06:00
Denis Kenzior
7f5bb70422 ie: Move ieee_oui to toplevel 2015-02-03 21:11:26 -06:00
Jukka Rissanen
3d251562f8 dbus: Remove useless info message print
No need for this info any more.
2015-02-03 11:34:16 -06:00
Jukka Rissanen
2fad305d3c dbus: Remove obsolete debug print
This print is quite useless.
2015-02-03 11:34:08 -06:00
Jukka Rissanen
6ddd2b894d scan: SSID security check was missing values
Refactoring SSID security check function to work properly so that
it can differentiate AP security setting correctly.
2015-02-02 15:09:50 -06:00
Denis Kenzior
26010b8459 wiphy: Optimize scanning data structures
Instead of storing multiple copies of the same BSS (one hanging off the
netdev object and one hanging off the network object), we instead store
the BSS list only on the netdev object.

The network object gets a pointer to the BSS structure on the netdev
list.  As a side effect, the BSS list is always sorted properly.
2015-01-28 21:23:17 -06:00
Denis Kenzior
6f3e4ef594 wiphy: Restructure lost_bss() function
- Remove unneeded nesting
- Rework logic slightly
2015-01-28 21:23:17 -06:00
Jukka Rissanen
4c5498d4cd wiphy: Remove those networks that do not have any BSS
If all the BSSs having same SSID and security have disappeared
from network, then the network can be removed also.
2015-01-28 21:23:16 -06:00
Denis Kenzior
c283557215 wiphy: Remove unneeded brackets 2015-01-28 21:23:16 -06:00
Denis Kenzior
1894b75a18 wiphy: Remove unneeded nesting 2015-01-28 21:23:16 -06:00
Denis Kenzior
0303a095aa wiphy: Remove unneeded variable
Instead of always mallocing space for the ssid array, and then freeing
it in most circumstances, do the opposite.  Only allocate the array once
it is actually needed.  This has the side effect of removing an unneeded
variable and making the code simpler.
2015-01-28 21:23:16 -06:00
Denis Kenzior
9f042ff1b8 wiphy: Ignore BSSes with no SSID 2015-01-28 21:23:16 -06:00
Denis Kenzior
b342f819f9 wiphy: Make const correct 2015-01-28 21:23:16 -06:00
Jukka Rissanen
d27c947209 wiphy: expose network objects instead of BSSes
The idea here is that network object will contain a list of BSS
that have the same SSID and security setting. From user point of view,
we will connect to a certain SSID instead of connecting directly to
a BSS. We pick the best BSS automatically from the BSS list when
connecting to a SSID.
2015-01-28 21:23:16 -06:00
Denis Kenzior
ce3ffd732f scan: Make const correct 2015-01-28 21:23:16 -06:00
Jukka Rissanen
8f73bc825f scan: Add utility to categorize BSS security type
Utility function gets the RSNE information element and
figures out whether the SSID is Open, WEP, PSK or 802.1X
network.
2015-01-28 12:34:01 -06:00
Jukka Rissanen
27b45f926b ie: Add capability enum 2015-01-28 12:33:47 -06:00
Jukka Rissanen
9e655106fa wiphy: MLME warning message text incorrect
MLME notify function prints error if wiphy or netdev is missing.
The error text in this case talks about scan notification instead
of more proper MLME notification.
2015-01-28 11:49:03 -06:00
Jukka Rissanen
bd6189aef0 main: Remove obsolete -S option
As there is no handler for -S option, we can remove it.
2015-01-26 21:53:55 -06:00
Jukka Rissanen
9c380ad95c main: DBus debug option -B was missing
It was not possible to activate DBus debugging.
2015-01-26 21:53:30 -06:00
Denis Kenzior
5247695d56 mpdu: fix transaction_sequence byte-ordering
transaction_sequence was not being considered in host CPU byte order
2015-01-22 12:41:10 -06:00
Denis Kenzior
e60b814dc8 mpdu: algorithm was not swapped to host byte-order 2015-01-22 12:41:10 -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
Tomasz Bursztyka
e02f02fa69 mpdu: Change the validation function signature
What comes in is a frame, and let's set it to uint8_t pointer, which is
semantically better than unsigned char.

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:14:47 -06:00
Tomasz Bursztyka
55d3283aeb mpdu: Add member 'ies' for mpdu_deauthentication
Even if this will never really be useful, it's better this way rather
than having a todo comment.
2015-01-21 14:37:27 -06:00
Tomasz Bursztyka
3d5fe2fddd mpdu: Validate beacon mpdu subtype
We do not currently validate the IEs that are following until the end
of the frame
2015-01-21 14:31:26 -06:00
Tomasz Bursztyka
9ce1745ede mpdu: Validate timing advertisement mpdu subtype
We do not currently validate the IEs that are following until the end
of the frame
2015-01-21 14:30:51 -06:00
Tomasz Bursztyka
8078f18c35 mpdu: Validate probe response mpdu subtype
We do not currently validate the IEs that are following until the end
of the frame
2015-01-21 14:30:12 -06:00
Tomasz Bursztyka
cc1cc64843 mpdu: Validate probe request mpdu subtype
We do not currently validate the IEs that are following until the end
of the frame
2015-01-21 14:29:39 -06:00
Tomasz Bursztyka
142a6a8a0c mpdu: Validate reassociation response mpdu subtype
We do not currently validate the IEs that are following until the end
of the frame
2015-01-21 14:29:05 -06:00
Tomasz Bursztyka
efcaefc5dd mpdu: Validate reassociation request mpdu subtype
We do not currently validate the IEs that are following until the end
of the frame.
2015-01-21 14:28:21 -06:00
Tomasz Bursztyka
8353ac445d mpdu: Validate association response mpdu subtype
We do not currently validate the IEs that are following until the end
of the frame.
2015-01-21 14:28:14 -06:00
Tomasz Bursztyka
5c9f1db01f mpdu: Validate association request mpdu subtype
We do not currently validate the IEs that are following until the end
of the frame.
2015-01-21 14:28:07 -06:00
Tomasz Bursztyka
d1c29daa24 mpdu: Validate disassociation mpdu subtype
These own a reason code which is currently the only interesting
information to handle. Let's skip the vendor specific ones for now.
2015-01-21 14:27:59 -06:00
Tomasz Bursztyka
e106033fce mpdu: Validate ATIM mpdu subtype
ATIM management frames have an empty body.
2015-01-21 14:27:38 -06:00
Denis Kenzior
c3aef948db mpdu: Update offset for authentication frames
Offset was not updated properly when validating authentication frames
2015-01-21 14:25:07 -06:00
Denis Kenzior
8a4e135bc8 ie: Add parsine of Group Management Cipher field 2015-01-20 00:30:54 -06:00
Denis Kenzior
e5574d031d ie: Parse PMKIDs in RSN IE 2015-01-19 23:26:45 -06:00
Jukka Rissanen
275d067123 wiphy: Use l_memdup instead of l_malloc and memcpy
Converting l_malloc() and memcpy() function pairs to use new
l_memdup() function.
2015-01-16 10:54:54 -06:00
Jukka Rissanen
7ec9c468f5 wiphy: Express SSID as an array of chars
Handle SSIDs as if they would contain up to 32 octets of opaque data.
2015-01-16 10:54:28 -06:00
Denis Kenzior
02170b200f ie: Decode RSNE Capabilities field 2015-01-15 23:59:19 -06:00
Denis Kenzior
e90ca652fd util: Add util_is_bit_set 2015-01-15 23:59:18 -06:00
Denis Kenzior
56f1ccf7f2 util: Add util_bit_field 2015-01-15 23:59:18 -06:00
Denis Kenzior
2be20e6644 ie: Add RSNE parser that works on raw data 2015-01-15 23:59:18 -06:00
Denis Kenzior
2d8f1cca0b ie: Add initial parser for RSN Elements
As found in 802.11 Section 8.4.2.27.  Currently the parser does not
handle the Capabilities, Group Management Cipher Suite or PMKID related
fields.
2015-01-15 23:59:18 -06:00
Denis Kenzior
2b7432bddb ie: Add utility to parse pairwise cipher suites
This utility works by validating values that make sense for pairwise
ciphers.
2015-01-15 23:59:18 -06:00
Denis Kenzior
4216cf793b ie: Add utility to parse group cipher suites
This utility works by validating values that make sense for group
ciphers.
2015-01-15 23:59:18 -06:00
Denis Kenzior
d8583424e8 ie: Add utility to parse key management suites 2015-01-15 23:59:18 -06:00
Denis Kenzior
20a02eba6a ie: Add utility to parse RSN cipher suites 2015-01-15 23:59:18 -06:00
Denis Kenzior
c3e9e2fc9b ie: Add ie_rsn_akm_suite enum
Using values from Table 8-101
2015-01-15 23:59:18 -06:00
Denis Kenzior
155a1f169a ie: Add ie_rsn_cipher_suite enum
Using values from Table 8-99
2015-01-15 23:59:18 -06:00
Jukka Rissanen
cb78798857 scan: Refactor scan result fetching to scan.c
No functionality changes by this commit.
2015-01-12 23:09:31 -06:00
Jukka Rissanen
f73708e1d7 scan: Refactor scheduled scan code to scan.c
Move the implementation details of triggering scheduled wifi scans
over netlink to scan.c from wiphy.c.  No functionality is affected
by this commit.
2015-01-12 23:09:31 -06:00
Jukka Rissanen
35d0c519d7 scan: Refactor scan start details to scan.c
Move the implementation details of triggering wifi scans over netlink
to scan.c from wiphy.c.  No functionality is changed by this commit.
2015-01-12 23:09:31 -06:00
Marcel Holtmann
78d21c782c crypto: Use proper form for making a structure packed 2014-12-28 06:50:51 +01:00
Marcel Holtmann
f25b1442ff core: Fix output buffer length handling of prf_sha1() function 2014-12-28 06:49:39 +01:00
Denis Kenzior
52ee52f467 crypto: Make packed 2014-12-27 23:35:40 -06:00
Marcel Holtmann
016f701a91 core: Fix handling of digest size argument for all HMAC hash functions 2014-12-28 06:33:44 +01: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
5e7771ef66 crypto: Add crypto_derive_pairwise_ptk 2014-12-27 22:34:39 -06:00
Denis Kenzior
1c4e3bc774 crypto: Make const correct 2014-12-27 22:34:39 -06:00
Denis Kenzior
dab93ef14a crypto: Update comment 2014-12-27 22:34:39 -06:00
Denis Kenzior
f647e03166 crypto: Add crypto_cipher_tk_bits 2014-12-27 22:34:39 -06:00
Denis Kenzior
07c8876d9e crypto: Add crypto_cipher_key_len 2014-12-27 22:34:39 -06:00
Denis Kenzior
0693740731 crypto: Add crypto_derive_ptk 2014-12-27 22:34:39 -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
Marcel Holtmann
1ee81e5854 core: Add support for AES-CMAC hashing function 2014-12-27 23:21:10 +01:00
Marcel Holtmann
872c0e803a core: Add support for HMAC SHA256 helper function 2014-12-27 06:58:28 +01:00
Marcel Holtmann
b615a6f4e0 core: Add support for HMAC MD5 helper function 2014-12-27 06:44:04 +01:00
Jukka Rissanen
08d31e3b1b wiphy: Fixes due to nl80211.h changes 2014-12-22 11:48:26 -06:00
Denis Kenzior
7cf4f7b100 eapol: Add a couple of missing fields 2014-12-19 15:45:17 -06:00
Denis Kenzior
e3729cc0f5 eapol: Fix typo 2014-12-19 14:25:57 -06:00
Denis Kenzior
7b6d8b54cd mpdu: Fix bitfield use on big endian 2014-12-19 12:26:41 -06:00
Denis Kenzior
2cc842a302 eapol: Add beginnings of EAPoL utilities 2014-12-18 18:10:10 -06:00
Patrik Flykt
bf25abf38d util: Add SSID to UTF8 pretty-print function
Use a static buffer for converting an SSID to an approximate string in
UTF8. Replace each char that is not UTF8 compatible with the UTF8
replacement symbol.
2014-12-18 11:06:48 -06:00
Denis Kenzior
b22f93203c mpdu: Rework to a zero-copy based framework 2014-12-17 17:44:44 -06:00
Denis Kenzior
d7b6a36db8 mpdu: Rework structure definitions
The current setup was not endian safe
2014-12-17 16:22:06 -06:00
Denis Kenzior
3ef0ff1e1a mpdu: Fix invalid read
The cast was being done incorrectly resulting in invalid values being
obtained
2014-12-17 16:21:05 -06:00
Denis Kenzior
ca742bb95d mpdu: Fix style 2014-12-16 16:57:30 -06:00
Denis Kenzior
b0af0177ac mpdu: Replace for loop with memcpy 2014-12-16 14:26:33 -06:00
Denis Kenzior
61a44dd485 mpdu: Fix style 2014-12-16 14:23:36 -06:00
Denis Kenzior
6a011f0d92 mpdu: Simplify checks 2014-12-16 14:22:13 -06:00
Denis Kenzior
002290998e mpdu: Add x-ref in comments for struct definitions 2014-12-16 14:21:18 -06:00
Tomasz Bursztyka
805619fc9d core: Add the preliminary logic to parse 802.11 MPDUs
It currently focuses on parsing management frames, and specifically its
authentication and deauthentication frames.
2014-12-16 10:53:20 -06:00
Denis Kenzior
d2218e81c9 dbus: Fix style 2014-12-12 09:52:12 -06:00
Jukka Rissanen
c5b5d4502b dbus: Add helper to append a byte array
Needed when appending SSID into properties.
2014-12-12 09:51:55 -06:00
Denis Kenzior
d87d7d469f crypto: Add passphrase generation utility 2014-11-14 21:41:28 -06:00
Jukka Rissanen
d0cb0aedc6 wiphy: Check return value when appending attributes
Make sure to print some errors if attributes cannot be appended
to a message. It is dangerous to ignore the return code from
l_genl_msg_append_attr() because the kernel might act weirdly
if some attribute is missing.
2014-11-12 08:10:58 -06:00
Jukka Rissanen
fcda15c587 wiphy: Scheduled scan startup message was too short
The length needs to be at least 20 bytes so that the third
attribute fits in.
2014-11-12 08:09:25 -06:00
Denis Kenzior
ad86c91b38 wiphy: Fix memory leak
Whenever we find an existing BSS, we should free the old object since it
is being removed from the old_bss_list via l_queue_remove_if
2014-11-07 22:44:30 -06:00
Denis Kenzior
333b28bf3a main: Add --dbus-debug command line parameter 2014-11-07 22:44:30 -06:00
Denis Kenzior
4dc24025a4 dbus: Add enable_debug parameter to dbus_init 2014-11-07 22:44:30 -06:00
Denis Kenzior
9de7c92429 wiphy: Remove unneeded wiphy_set_ssid function 2014-11-07 22:44:27 -06:00
Denis Kenzior
ca5f5b2e2b main: Remove unneeded ssid command line argument 2014-11-07 21:37:09 -06:00
Jukka Rissanen
672be730c3 wiphy: Add scheduled scan support
Add rudimentary support for mac80211 scheduled scan feature.
This is done so that kernel support for task called "Bind
NL80211_CMD_START_SCHED_SCAN to netlink socket" from TODO
file can be tested. The current scan interval is set to 60
seconds which is probably too fast for the final version.
2014-11-07 20:42:11 -06:00
Denis Kenzior
ca18b395e2 wiphy: Fix valgrind complaint
The network list must be destroyed before the BSS list as that is used
inside network_free
2014-11-05 08:29:33 -06:00
Denis Kenzior
84765ac4db wiphy: Add GetNetworks method 2014-11-03 15:37:08 -06:00
Denis Kenzior
e7bd2276de wiphy: Make const correct 2014-11-03 15:36:52 -06:00
Denis Kenzior
2f852d2954 wiphy: Add missing signals to introspection 2014-11-03 15:24:34 -06:00
Denis Kenzior
3cf47d4109 manager: Add missing signals to introspection 2014-11-03 15:24:12 -06:00
Denis Kenzior
8e3a17cf56 wiphy: Add rudimentary Connect method 2014-10-30 00:27:06 -05:00
Denis Kenzior
e51cac7f74 wiphy: Fix uninitialized var warnings 2014-10-30 00:26:49 -05:00
Denis Kenzior
5b2e34b5b6 wiphy: add network_emit_removed 2014-10-30 00:09:29 -05:00
Denis Kenzior
0d59e91a2b wiphy: Add network_emit_added 2014-10-30 00:09:16 -05:00
Denis Kenzior
3a8eb753a3 wiphy: Expose rudimentary network information 2014-10-30 00:01:52 -05:00
Denis Kenzior
621a2a003d dbus: Add Network Interface #define 2014-10-29 23:58:36 -05:00
Denis Kenzior
64e9ad91ed wiphy: Track bss as a network object in a hashmap 2014-10-29 23:20:43 -05:00
Denis Kenzior
b484197470 wiphy: Keep track of seen BSS 2014-10-29 22:50:27 -05:00
Denis Kenzior
39fde81dba wiphy: Refactor get_scan 2014-10-28 11:15:26 -05:00
Denis Kenzior
6917824be9 wiphy: refactor parse_bss 2014-10-28 11:04:31 -05:00
Denis Kenzior
0a71163c3f wiphy: Add Scan() method 2014-10-28 09:43:36 -05:00
Denis Kenzior
d2f61dd0cd dbus: Add dbus_error_failed 2014-10-27 23:42:59 -05:00
Denis Kenzior
96a139d15b dbus: add dbus_error_busy 2014-10-27 23:42:43 -05:00
Denis Kenzior
4639c31d61 dbus: Add dbus_pending_reply 2014-10-27 23:42:05 -05:00
Denis Kenzior
051f49ea85 wiphy: Tweak netdev structure creation order
Because none of the attributes are assigned until after the DeviceAdded
signal is emitted, the signal appears with invalid properties.  For now,
move the netdev structure fill-out into the if statement.

If the netdev attributes can change, then these need to be handled
separately and appropriate signals to be sent.
2014-10-23 22:44:59 -05:00
Denis Kenzior
77255dbee0 manager: Implement GetDevices method 2014-10-23 22:41:45 -05:00
Denis Kenzior
2d6babc3f8 wiphy: Expose iwd_device_get_path 2014-10-23 22:40:32 -05:00
Denis Kenzior
2d6a50bb27 wiphy: add __iwd_device_foreach 2014-10-23 21:47:38 -05:00
Denis Kenzior
c13103974c wiphy: Expose Name property of netdevs 2014-10-23 20:29:36 -05:00
Denis Kenzior
9ba3cc408e wiphy: Add __iwd_device_append_properties 2014-10-23 16:53:36 -05:00
Denis Kenzior
1ff34e3f0f dbus: add dbus_dict_append_bool 2014-10-23 16:53:34 -05:00
Denis Kenzior
c550fb01f9 dbus: add dbus_dict_append_string 2014-10-23 16:53:31 -05:00
Denis Kenzior
28f33d210d wiphy: add skeleton for DeviceAdded signal 2014-10-23 15:11:17 -05:00
Denis Kenzior
daa0b6768f wiphy: add DeviceRemoved signal implementation 2014-10-23 15:11:01 -05:00
Denis Kenzior
4a4d094d8e wiphy: Add device_get_path() utility 2014-10-23 15:09:52 -05:00
Denis Kenzior
ae95cbd172 dbus: Use a #define for IWD_MANAGER_PATH 2014-10-23 15:07:08 -05:00
Denis Kenzior
852072e836 dbus: Move Device interface #define to dbus.h 2014-10-23 14:34:17 -05:00
Denis Kenzior
6437e5ae92 dbus: Move Manager Interface #define to dbus.h 2014-10-23 14:34:13 -05:00
Denis Kenzior
f9363748f0 wiphy: Expose netdevs to DBus 2014-10-23 14:32:12 -05:00
Denis Kenzior
09c29ba3e2 manager: Add manager skeleton 2014-10-06 22:13:40 -05:00
Denis Kenzior
5bea86e47b dbus: Add dbus-daemon policy configuration 2014-10-06 22:13:40 -05:00
Denis Kenzior
429ea08202 dbus: Add basic D-Bus plumbing 2014-10-06 22:13:37 -05:00
Marcel Holtmann
70bc082d41 core: Make Kernel D-Bus setup optional 2014-08-09 10:59:48 -07:00
Marcel Holtmann
dfc059d757 core: Send MLME associate request when authenticated 2014-08-09 00:01:22 -07:00
Marcel Holtmann
966a58d67f core: Send MLME authenticate request when SSID is found 2014-08-08 23:45:15 -07:00
Marcel Holtmann
0aabd9744d core: Parse scan results and store BSS information when SSID matches 2014-08-08 23:23:56 -07:00
Marcel Holtmann
9c7c23ce90 core: Trigger initial passive scan when SSID is provided 2014-08-08 22:21:30 -07:00
Marcel Holtmann
c13d50fab9 core: Add command line option to provide SSID 2014-08-08 22:19:47 -07:00
Marcel Holtmann
1ab85bdbe5 core: Add command line options support to daemon 2014-08-08 21:54:03 -07:00
Marcel Holtmann
218e38aa87 core: Store feature flags of wiphy devices 2014-08-07 15:41:30 -07:00
Marcel Holtmann
c9b3adbbcf core: Request current regulatory setting when starting up 2014-08-07 13:23:02 -07:00
Marcel Holtmann
a17584e680 core: First command should be to read protocol features 2014-08-07 13:13:31 -07:00
Marcel Holtmann
b7a421673c core: Add sanity check to sync RTNL link deletion with nl80211 2014-08-06 23:52:42 -07:00
Marcel Holtmann
46b9f4a0a8 core: Subscribe to all nl80211 multicast groups 2014-08-06 23:52:08 -07:00
Marcel Holtmann
442ba2412d core: Add network interface to beginning of list 2014-08-06 23:51:25 -07:00
Marcel Holtmann
f400e9dd44 core: Request list of all network interfaces 2014-08-07 06:27:32 +02:00
Marcel Holtmann
af2bb68e07 core: Only enable RTNL debugging when IWD_RTNL_DEBUG is set 2014-08-07 05:28:58 +02:00
Marcel Holtmann
32c415e4e8 core: Track wiphy devices and its network interfaces 2014-08-07 05:15:20 +02:00
Marcel Holtmann
d04ecde554 core: Only enable netlink debugging when IWD_GENL_DEBUG is set 2014-08-07 01:06:51 +02:00
Marcel Holtmann
34d8b0d308 ie: Keep copyright notice the same for all source files 2014-08-03 08:14:16 +02:00
Jukka Rissanen
b90d914a3f ie: Adding IE builder support
These functions can be used to create IE TLV messages.
2014-07-31 09:58:58 -05:00
Marcel Holtmann
999ba12f31 core: Add skeleton for nl80211 setup 2014-07-29 21:25:01 +02:00
Jukka Rissanen
61245bc14e ie: Adding function to recurse when reading
This function is needed when building recursive IE.
2014-07-15 19:19:04 -05:00
Denis Kenzior
119a1e7de3 ie: Add additional boundary checking
==20758== Invalid read of size 1
==20758==    at 0x401254: ie_tlv_iter_next (ie.c:55)
==20758==    by 0x40104B: ie_test (test-ie.c:57)
==20758==    by 0x4021C0: l_test_run (test.c:83)
==20758==    by 0x4011B7: main (test-ie.c:123)
==20758==  Address 0x51e10f3 is 0 bytes after a block of size 19 alloc'd
==20758==    at 0x4C2C874: realloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==20758==    by 0x4010CF: append_data (test-ie.c:101)
==20758==    by 0x40118F: main (test-ie.c:119)
==20758==
==20758== Invalid read of size 1
==20758==    at 0x401266: ie_tlv_iter_next (ie.c:56)
==20758==    by 0x40104B: ie_test (test-ie.c:57)
==20758==    by 0x4021C0: l_test_run (test.c:83)
==20758==    by 0x4011B7: main (test-ie.c:123)
==20758==  Address 0x51e10f4 is 1 bytes after a block of size 19 alloc'd
==20758==    at 0x4C2C874: realloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==20758==    by 0x4010CF: append_data (test-ie.c:101)
==20758==    by 0x40118F: main (test-ie.c:119)
2014-07-15 19:18:08 -05:00
Jukka Rissanen
458ac1aba4 ie: Simple informational element parser
The parsing API goes through the byte stream and parses the
TLV (Type, Length and Value) values and avoids data copying.
2014-07-15 19:18:08 -05:00
Jukka Rissanen
eedadd860b ie: Add information element types
IE types are from IEEE Std 802.11 chapter 8.4.2
2014-07-15 15:45:03 -05:00
Marcel Holtmann
43f91eb168 core: Fix a few compiler warnings 2014-07-15 22:29:02 +02:00
Marcel Holtmann
188917cc29 core: Add missing include for network interface tracking 2014-06-21 20:54:58 +02:00
Marcel Holtmann
37cba460a8 core: Add tracking of network interfaces via RTNL 2014-06-21 13:41:40 +02:00
Marcel Holtmann
78379fc673 core: Limit the kdbus attach flags to useful ones 2014-05-21 22:44:31 -07:00
Marcel Holtmann
edc067abf1 core: Use PRIu64 format modifier for printing uint64 variables 2014-05-21 22:43:38 -07:00
Marcel Holtmann
51d5e77b8a core: Print debug information for kdbus connections 2014-05-20 23:36:56 -07:00
Marcel Holtmann
f299d96e77 core: Open the private bus connection and acquire name 2014-05-20 23:07:49 -07:00
Marcel Holtmann
f3b9d44be7 core: Add kdbus helpers for connections and well known names 2014-05-20 23:06:56 -07:00
Marcel Holtmann
bf7c041b47 core: Add support for creating private bus 2014-05-20 21:44:13 -07:00
Marcel Holtmann
632be0730a core: Add kdbus helper functions for bus creation and lookup 2014-05-20 21:42:35 -07:00
Marcel Holtmann
abf1eb9494 build: Move nl80211.h public header to separate directory 2014-05-20 19:51:36 -07:00
Marcel Holtmann
b0cb247d23 build: Add copy of kernel nl80211.h public header 2014-05-11 18:08:33 -07:00
Marcel Holtmann
4fb291c2a9 core: Use full include path for local headers 2014-05-11 16:22:13 -07:00
Marcel Holtmann
422fb5ad08 core: Add SHA-1 versions of PBKDF2 and PRF functions 2014-05-11 11:43:42 -07:00
Marcel Holtmann
050539e2e3 core: Add skeleton for main daemon 2014-05-11 11:01:11 -07:00