Commit Graph

44 Commits

Author SHA1 Message Date
James Prestwood 42e083cf9b crypto: add crypto_passphrase_is_valid
Move this check out of crypto_psk_from_passphrase so other modules
can validate a passphrase.
2019-09-18 16:48:07 -05:00
James Prestwood f6df93d358 crypto: add OSEN AKM
OSEN (OSU Server-Only authenticated layer 2 Encryption Network) is
required for the WiFi Alliance Hotspot Specification.
2019-06-07 14:22:33 -05:00
James Prestwood bc381bd8c3 crypto: update FT derivation functions to use sha384
FILS-FT requires the SHA384 KDF to derive the FT keys
2019-05-22 16:14:14 -05:00
James Prestwood e109e1b1cf crypto: pass xxkey length for crypto_derive_pmk_r0
FILS-FT has a special derivation for xxkey, and depending on AKM
the key may be 32 or 48 bytes long.
2019-05-22 16:13:57 -05:00
James Prestwood 62097e7d82 crypto: allow PTK derivation using SHA384
crypto_derive_pairwise_ptk was taking a boolean to decide whether to
use SHA1 or SHA256, but for FILS SHA384 may also be required for
rekeys depending on the AKM.

crypto_derive_pairwise_ptk was changed to take l_checksum_type instead
of a boolean to allow for all 3 SHA types.
2019-04-26 12:28:40 -05:00
James Prestwood 5e28b314a7 crypto: add aes_siv_{encrypt,decrypt}
FILS requires AES-SIV for rekeys
2019-04-17 13:55:11 -05:00
James Prestwood e9618d97a8 crypto: add kdf_sha384
FILS requires the SHA384 KDF variant.
2019-04-05 17:58:03 -05:00
James Prestwood a2e711faf4 ie: crypto: add FILS AKMs
ie_rsn_info had to be updated to allow for 32 bit AKM values rather than
16 bit.
2019-04-04 16:11:07 -05:00
James Prestwood 7bfaf182e6 crypto: allow hkdf_expand/extract to use different SHA's
Rather than hard coding to SHA256, we can pass in l_checksum_type
and use that SHA. This will allow for OWE/SAE/PWD to support more
curves that use different SHA algorithms for hashing.
2019-01-17 15:20:28 -06:00
James Prestwood 2c82d6b223 crypto: pass PMK length to crypto_derive_pairwise_ptk
Right now the PMK is hard coded to 32 bytes, which works for the vast
majority of cases. The only outlier is OWE which can generate a PMK
of 32, 48 or 64 bytes depending on the ECC group used. The PMK length
is already stored in the handshake, so now we can just pass that to
crypto_derive_pairwise_ptk
2019-01-17 15:20:28 -06:00
James Prestwood 6771a06463 crypto/handshake/eapol: Allow other PTK lengths
The crypto_ptk was hard coded for 16 byte KCK/KEK. Depending on the
AKM these can be up to 32 bytes. This changes completely removes the
crypto_ptk struct and adds getters to the handshake object for the
kck and kek. Like before the PTK is derived into a continuous buffer,
and the kck/kek getters take care of returning the proper key offset
depending on AKM.

To allow for larger than 16 byte keys aes_unwrap needed to be
modified to take the kek length.
2019-01-17 15:20:28 -06:00
James Prestwood 37cfec01a2 crypto: add hmac_sha384
To support OWE group 20, which uses HMAC-SHA384 for hashing the PMK
2019-01-15 15:07:26 -06:00
James Prestwood 8740abb60e netdev: add translation for OWE AKM type 2018-11-16 16:59:59 -06:00
James Prestwood 40685e8fe3 crypto: implement HKDF-Expand (RFC 5869)
This will be required by OWE
2018-11-16 16:38:28 -06:00
James Prestwood 0b42ca7c30 crypto: renamed hkdf_256
The RFC (5869) for this implementation defines two functions,
HKDF-Extract and HKDF-Expand. The existing 'hkdf_256' was implementing
the Extract function, so it was renamed appropriately. The name was
changed for consistency when the Expand function will be added in the
future.
2018-11-16 16:30:22 -06:00
James Prestwood 397bf9c0bd crypto: pwd: sae: Made H function common
The "H" function used by SAE and EAP-PWD was effectively the same
function, EAP-PWD just used a zero key for its calls. This removes
the duplicate implementations and merges them into crypto.c as
"hkdf_256".

Since EAP-PWD always uses a zero'ed key, passing in a NULL key to
hkdf_256 will actually use a 32 byte zero'ed array as the key. This
avoids the need for EAP-PWD to store or create a zero'ed key for
every call.

Both the original "H" functions never called va_end, so that was
added to hkdf_256.
2018-09-05 11:12:54 -05:00
Denis Kenzior 46a797043a ie: Add AKMs from 802.11-2016 2018-07-19 11:09:08 -05:00
Denis Kenzior cd7af67aac eapol: Tighten up GTK/IGTK KDE validation
GTK KDE was being checked for being a minimum of 6 bytes.  Not quite
sure why since the minimum GTK key length is 16 bytes for CCMP.
Similarly make sure that the maximum length is not more than 32, which
is currently the largest key size (TKIP)
2017-10-19 16:47:35 -05:00
Andrew Zaborowski ba78950c83 crypto: Use l_pkcs5_pbkdf2 in place of local pbkdf2_sha1 2017-10-09 14:34:31 -05:00
Andrew Zaborowski 4f865ba9f8 crypto: Implement aes_wrap
Add the inverse of aes_unwrap for eapol server usage.
2017-08-31 12:53:53 -05:00
Andrew Zaborowski 0f6685bf45 crypto: Add crypto_derive_pmkid
Calculates the PMKID for given PMK
2017-04-17 14:24:02 -05:00
Denis Kenzior d33fe385da crypto: Add AKMs 2016-11-15 15:39:55 -06: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
Denis Kenzior eb539ddd82 crypto: Add D-H MODP Group 5 prime & generator 2016-08-15 10:47:36 -05: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 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 d075d49a96 crypto: Use same values as nl80211 2015-03-25 22:33:07 -05: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
Marcel Holtmann 78d21c782c crypto: Use proper form for making a structure packed 2014-12-28 06:50:51 +01:00
Denis Kenzior 52ee52f467 crypto: Make packed 2014-12-27 23:35:40 -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 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 d87d7d469f crypto: Add passphrase generation utility 2014-11-14 21:41:28 -06:00