wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
sae.h
Go to the documentation of this file.
1 
5 #ifndef SAE_H
6 #define SAE_H
7 
8 #define SAE_KCK_LEN 32
9 #define SAE_PMK_LEN 32
10 #define SAE_PMKID_LEN 16
11 #define SAE_KEYSEED_KEY_LEN 32
12 #define SAE_MAX_PRIME_LEN 512
13 #define SAE_MAX_ECC_PRIME_LEN 66
14 #define SAE_COMMIT_MAX_LEN (2 + 3 * SAE_MAX_PRIME_LEN)
15 #define SAE_CONFIRM_MAX_LEN (2 + SAE_MAX_PRIME_LEN)
16 
17 /* Special value returned by sae_parse_commit() */
18 #define SAE_SILENTLY_DISCARD 65535
19 
21  u8 kck[SAE_KCK_LEN];
22  struct crypto_bignum *own_commit_scalar;
23  struct crypto_bignum *own_commit_element_ffc;
24  struct crypto_ec_point *own_commit_element_ecc;
25  struct crypto_bignum *peer_commit_element_ffc;
26  struct crypto_ec_point *peer_commit_element_ecc;
27  struct crypto_ec_point *pwe_ecc;
28  struct crypto_bignum *pwe_ffc;
29  struct crypto_bignum *sae_rand;
30  struct crypto_ec *ec;
31  int prime_len;
32  const struct dh_group *dh;
33  const struct crypto_bignum *prime;
34  const struct crypto_bignum *order;
35  struct crypto_bignum *prime_buf;
36  struct crypto_bignum *order_buf;
37  struct wpabuf *anti_clogging_token;
38 };
39 
40 struct sae_data {
41  enum { SAE_NOTHING, SAE_COMMITTED, SAE_CONFIRMED, SAE_ACCEPTED } state;
42  u16 send_confirm;
43  u8 pmk[SAE_PMK_LEN];
44  struct crypto_bignum *peer_commit_scalar;
45  int group;
46  int sync;
47  struct sae_temporary_data *tmp;
48 };
49 
50 int sae_set_group(struct sae_data *sae, int group);
51 void sae_clear_temp_data(struct sae_data *sae);
52 void sae_clear_data(struct sae_data *sae);
53 
54 int sae_prepare_commit(const u8 *addr1, const u8 *addr2,
55  const u8 *password, size_t password_len,
56  struct sae_data *sae);
57 int sae_process_commit(struct sae_data *sae);
58 void sae_write_commit(struct sae_data *sae, struct wpabuf *buf,
59  const struct wpabuf *token);
60 u16 sae_parse_commit(struct sae_data *sae, const u8 *data, size_t len,
61  const u8 **token, size_t *token_len, int *allowed_groups);
62 void sae_write_confirm(struct sae_data *sae, struct wpabuf *buf);
63 int sae_check_confirm(struct sae_data *sae, const u8 *data, size_t len);
64 u16 sae_group_allowed(struct sae_data *sae, int *allowed_groups, u16 group);
65 
66 #endif /* SAE_H */
Definition: sae.h:20
Definition: wpabuf.h:16
Definition: dh_groups.h:8
Definition: sae.h:40