]>
Commit | Line | Data |
---|---|---|
be27e185 JM |
1 | /* |
2 | * DPP functionality shared between hostapd and wpa_supplicant | |
3 | * Copyright (c) 2017, Qualcomm Atheros, Inc. | |
0b4a906d | 4 | * Copyright (c) 2018-2019, The Linux Foundation |
be27e185 JM |
5 | * |
6 | * This software may be distributed under the terms of the BSD license. | |
7 | * See README for more details. | |
8 | */ | |
9 | ||
10 | #ifndef DPP_H | |
11 | #define DPP_H | |
12 | ||
13 | #include <openssl/x509.h> | |
14 | ||
15 | #include "utils/list.h" | |
650a70a7 | 16 | #include "common/wpa_common.h" |
be27e185 JM |
17 | #include "crypto/sha256.h" |
18 | ||
dc4d271c JM |
19 | #define DPP_HDR_LEN (4 + 2) /* OUI, OUI Type, Crypto Suite, DPP frame type */ |
20 | ||
30d27b04 JM |
21 | enum dpp_public_action_frame_type { |
22 | DPP_PA_AUTHENTICATION_REQ = 0, | |
23 | DPP_PA_AUTHENTICATION_RESP = 1, | |
24 | DPP_PA_AUTHENTICATION_CONF = 2, | |
25 | DPP_PA_PEER_DISCOVERY_REQ = 5, | |
26 | DPP_PA_PEER_DISCOVERY_RESP = 6, | |
27 | DPP_PA_PKEX_EXCHANGE_REQ = 7, | |
28 | DPP_PA_PKEX_EXCHANGE_RESP = 8, | |
29 | DPP_PA_PKEX_COMMIT_REVEAL_REQ = 9, | |
30 | DPP_PA_PKEX_COMMIT_REVEAL_RESP = 10, | |
31 | }; | |
32 | ||
33 | enum dpp_attribute_id { | |
34 | DPP_ATTR_STATUS = 0x1000, | |
35 | DPP_ATTR_I_BOOTSTRAP_KEY_HASH = 0x1001, | |
36 | DPP_ATTR_R_BOOTSTRAP_KEY_HASH = 0x1002, | |
37 | DPP_ATTR_I_PROTOCOL_KEY = 0x1003, | |
38 | DPP_ATTR_WRAPPED_DATA = 0x1004, | |
39 | DPP_ATTR_I_NONCE = 0x1005, | |
40 | DPP_ATTR_I_CAPABILITIES = 0x1006, | |
41 | DPP_ATTR_R_NONCE = 0x1007, | |
42 | DPP_ATTR_R_CAPABILITIES = 0x1008, | |
43 | DPP_ATTR_R_PROTOCOL_KEY = 0x1009, | |
44 | DPP_ATTR_I_AUTH_TAG = 0x100A, | |
45 | DPP_ATTR_R_AUTH_TAG = 0x100B, | |
46 | DPP_ATTR_CONFIG_OBJ = 0x100C, | |
47 | DPP_ATTR_CONNECTOR = 0x100D, | |
48 | DPP_ATTR_CONFIG_ATTR_OBJ = 0x100E, | |
49 | DPP_ATTR_BOOTSTRAP_KEY = 0x100F, | |
30d27b04 JM |
50 | DPP_ATTR_OWN_NET_NK_HASH = 0x1011, |
51 | DPP_ATTR_FINITE_CYCLIC_GROUP = 0x1012, | |
52 | DPP_ATTR_ENCRYPTED_KEY = 0x1013, | |
53 | DPP_ATTR_ENROLLEE_NONCE = 0x1014, | |
54 | DPP_ATTR_CODE_IDENTIFIER = 0x1015, | |
85fd8263 | 55 | DPP_ATTR_TRANSACTION_ID = 0x1016, |
d2709206 JM |
56 | DPP_ATTR_BOOTSTRAP_INFO = 0x1017, |
57 | DPP_ATTR_CHANNEL = 0x1018, | |
0b4a906d JM |
58 | DPP_ATTR_PROTOCOL_VERSION = 0x1019, |
59 | DPP_ATTR_ENVELOPED_DATA = 0x101A, | |
30d27b04 JM |
60 | }; |
61 | ||
62 | enum dpp_status_error { | |
63 | DPP_STATUS_OK = 0, | |
64 | DPP_STATUS_NOT_COMPATIBLE = 1, | |
65 | DPP_STATUS_AUTH_FAILURE = 2, | |
66 | DPP_STATUS_UNWRAP_FAILURE = 3, | |
67 | DPP_STATUS_BAD_GROUP = 4, | |
68 | DPP_STATUS_CONFIGURE_FAILURE = 5, | |
69 | DPP_STATUS_RESPONSE_PENDING = 6, | |
e85b6601 JM |
70 | DPP_STATUS_INVALID_CONNECTOR = 7, |
71 | DPP_STATUS_NO_MATCH = 8, | |
30d27b04 JM |
72 | }; |
73 | ||
74 | #define DPP_CAPAB_ENROLLEE BIT(0) | |
75 | #define DPP_CAPAB_CONFIGURATOR BIT(1) | |
76 | #define DPP_CAPAB_ROLE_MASK (BIT(0) | BIT(1)) | |
77 | ||
be27e185 | 78 | #define DPP_BOOTSTRAP_MAX_FREQ 30 |
30d27b04 JM |
79 | #define DPP_MAX_NONCE_LEN 32 |
80 | #define DPP_MAX_HASH_LEN 64 | |
81 | #define DPP_MAX_SHARED_SECRET_LEN 66 | |
be27e185 JM |
82 | |
83 | struct dpp_curve_params { | |
84 | const char *name; | |
85 | size_t hash_len; | |
86 | size_t aes_siv_key_len; | |
87 | size_t nonce_len; | |
88 | size_t prime_len; | |
89 | const char *jwk_crv; | |
500ed7f0 | 90 | u16 ike_group; |
31f03cb0 | 91 | const char *jws_alg; |
be27e185 JM |
92 | }; |
93 | ||
94 | enum dpp_bootstrap_type { | |
95 | DPP_BOOTSTRAP_QR_CODE, | |
500ed7f0 | 96 | DPP_BOOTSTRAP_PKEX, |
be27e185 JM |
97 | }; |
98 | ||
99 | struct dpp_bootstrap_info { | |
100 | struct dl_list list; | |
101 | unsigned int id; | |
102 | enum dpp_bootstrap_type type; | |
103 | char *uri; | |
104 | u8 mac_addr[ETH_ALEN]; | |
105 | char *info; | |
106 | unsigned int freq[DPP_BOOTSTRAP_MAX_FREQ]; | |
107 | unsigned int num_freq; | |
108 | int own; | |
109 | EVP_PKEY *pubkey; | |
110 | u8 pubkey_hash[SHA256_MAC_LEN]; | |
111 | const struct dpp_curve_params *curve; | |
29ab69e4 JM |
112 | unsigned int pkex_t; /* number of failures before dpp_pkex |
113 | * instantiation */ | |
be27e185 JM |
114 | }; |
115 | ||
29ab69e4 JM |
116 | #define PKEX_COUNTER_T_LIMIT 5 |
117 | ||
500ed7f0 | 118 | struct dpp_pkex { |
219d4c9f | 119 | void *msg_ctx; |
500ed7f0 JM |
120 | unsigned int initiator:1; |
121 | unsigned int exchange_done:1; | |
e0247e79 | 122 | unsigned int failed:1; |
500ed7f0 JM |
123 | struct dpp_bootstrap_info *own_bi; |
124 | u8 own_mac[ETH_ALEN]; | |
125 | u8 peer_mac[ETH_ALEN]; | |
126 | char *identifier; | |
127 | char *code; | |
128 | EVP_PKEY *x; | |
129 | EVP_PKEY *y; | |
130 | u8 Mx[DPP_MAX_SHARED_SECRET_LEN]; | |
131 | u8 Nx[DPP_MAX_SHARED_SECRET_LEN]; | |
132 | u8 z[DPP_MAX_HASH_LEN]; | |
133 | EVP_PKEY *peer_bootstrap_key; | |
134 | struct wpabuf *exchange_req; | |
135 | struct wpabuf *exchange_resp; | |
29ab69e4 | 136 | unsigned int t; /* number of failures on code use */ |
00d2d13d JM |
137 | unsigned int exch_req_wait_time; |
138 | unsigned int exch_req_tries; | |
139 | unsigned int freq; | |
500ed7f0 JM |
140 | }; |
141 | ||
5dd745b7 JM |
142 | enum dpp_akm { |
143 | DPP_AKM_UNKNOWN, | |
144 | DPP_AKM_DPP, | |
145 | DPP_AKM_PSK, | |
146 | DPP_AKM_SAE, | |
147 | DPP_AKM_PSK_SAE | |
148 | }; | |
149 | ||
461d39af JM |
150 | struct dpp_configuration { |
151 | u8 ssid[32]; | |
152 | size_t ssid_len; | |
e3a5882b | 153 | enum dpp_akm akm; |
461d39af JM |
154 | |
155 | /* For DPP configuration (connector) */ | |
156 | os_time_t netaccesskey_expiry; | |
157 | ||
a4bf0078 | 158 | /* TODO: groups */ |
20f612d9 | 159 | char *group_id; |
461d39af JM |
160 | |
161 | /* For legacy configuration */ | |
162 | char *passphrase; | |
163 | u8 psk[32]; | |
164 | }; | |
165 | ||
30d27b04 JM |
166 | struct dpp_authentication { |
167 | void *msg_ctx; | |
0b4a906d | 168 | u8 peer_version; |
30d27b04 JM |
169 | const struct dpp_curve_params *curve; |
170 | struct dpp_bootstrap_info *peer_bi; | |
171 | struct dpp_bootstrap_info *own_bi; | |
73f21929 | 172 | struct dpp_bootstrap_info *tmp_own_bi; |
30d27b04 JM |
173 | u8 waiting_pubkey_hash[SHA256_MAC_LEN]; |
174 | int response_pending; | |
175 | enum dpp_status_error auth_resp_status; | |
176 | u8 peer_mac_addr[ETH_ALEN]; | |
177 | u8 i_nonce[DPP_MAX_NONCE_LEN]; | |
178 | u8 r_nonce[DPP_MAX_NONCE_LEN]; | |
461d39af | 179 | u8 e_nonce[DPP_MAX_NONCE_LEN]; |
30d27b04 JM |
180 | u8 i_capab; |
181 | u8 r_capab; | |
182 | EVP_PKEY *own_protocol_key; | |
183 | EVP_PKEY *peer_protocol_key; | |
dc4d271c JM |
184 | struct wpabuf *req_msg; |
185 | struct wpabuf *resp_msg; | |
f97ace34 JM |
186 | /* Intersection of possible frequencies for initiating DPP |
187 | * Authentication exchange */ | |
188 | unsigned int freq[DPP_BOOTSTRAP_MAX_FREQ]; | |
189 | unsigned int num_freq, freq_idx; | |
30d27b04 | 190 | unsigned int curr_freq; |
d2709206 | 191 | unsigned int neg_freq; |
f97ace34 | 192 | unsigned int num_freq_iters; |
30d27b04 JM |
193 | size_t secret_len; |
194 | u8 Mx[DPP_MAX_SHARED_SECRET_LEN]; | |
630ea133 | 195 | size_t Mx_len; |
30d27b04 | 196 | u8 Nx[DPP_MAX_SHARED_SECRET_LEN]; |
630ea133 | 197 | size_t Nx_len; |
30d27b04 | 198 | u8 Lx[DPP_MAX_SHARED_SECRET_LEN]; |
630ea133 | 199 | size_t Lx_len; |
30d27b04 JM |
200 | u8 k1[DPP_MAX_HASH_LEN]; |
201 | u8 k2[DPP_MAX_HASH_LEN]; | |
202 | u8 ke[DPP_MAX_HASH_LEN]; | |
203 | int initiator; | |
f97ace34 | 204 | int waiting_auth_resp; |
95b0104a | 205 | int waiting_auth_conf; |
248264c6 | 206 | int auth_req_ack; |
95b0104a | 207 | unsigned int auth_resp_tries; |
d1f08264 | 208 | u8 allowed_roles; |
30d27b04 JM |
209 | int configurator; |
210 | int remove_on_tx_status; | |
211 | int auth_success; | |
461d39af | 212 | struct wpabuf *conf_req; |
82feacce | 213 | const struct wpabuf *conf_resp; /* owned by GAS server */ |
461d39af JM |
214 | struct dpp_configuration *conf_ap; |
215 | struct dpp_configuration *conf_sta; | |
216 | struct dpp_configurator *conf; | |
217 | char *connector; /* received signedConnector */ | |
218 | u8 ssid[SSID_MAX_LEN]; | |
219 | u8 ssid_len; | |
8528994e JM |
220 | char passphrase[64]; |
221 | u8 psk[PMK_LEN]; | |
222 | int psk_set; | |
5dd745b7 | 223 | enum dpp_akm akm; |
461d39af JM |
224 | struct wpabuf *net_access_key; |
225 | os_time_t net_access_key_expiry; | |
226 | struct wpabuf *c_sign_key; | |
461d39af JM |
227 | #ifdef CONFIG_TESTING_OPTIONS |
228 | char *config_obj_override; | |
229 | char *discovery_override; | |
230 | char *groups_override; | |
461d39af JM |
231 | unsigned int ignore_netaccesskey_mismatch:1; |
232 | #endif /* CONFIG_TESTING_OPTIONS */ | |
233 | }; | |
234 | ||
235 | struct dpp_configurator { | |
236 | struct dl_list list; | |
237 | unsigned int id; | |
238 | int own; | |
239 | EVP_PKEY *csign; | |
240 | char *kid; | |
241 | const struct dpp_curve_params *curve; | |
30d27b04 JM |
242 | }; |
243 | ||
650a70a7 JM |
244 | struct dpp_introduction { |
245 | u8 pmkid[PMKID_LEN]; | |
246 | u8 pmk[PMK_LEN_MAX]; | |
247 | size_t pmk_len; | |
650a70a7 JM |
248 | }; |
249 | ||
60239f60 JM |
250 | #ifdef CONFIG_TESTING_OPTIONS |
251 | enum dpp_test_behavior { | |
252 | DPP_TEST_DISABLED = 0, | |
253 | DPP_TEST_AFTER_WRAPPED_DATA_AUTH_REQ = 1, | |
254 | DPP_TEST_AFTER_WRAPPED_DATA_AUTH_RESP = 2, | |
255 | DPP_TEST_AFTER_WRAPPED_DATA_AUTH_CONF = 3, | |
256 | DPP_TEST_AFTER_WRAPPED_DATA_PKEX_CR_REQ = 4, | |
257 | DPP_TEST_AFTER_WRAPPED_DATA_PKEX_CR_RESP = 5, | |
258 | DPP_TEST_AFTER_WRAPPED_DATA_CONF_REQ = 6, | |
259 | DPP_TEST_AFTER_WRAPPED_DATA_CONF_RESP = 7, | |
260 | DPP_TEST_ZERO_I_CAPAB = 8, | |
261 | DPP_TEST_ZERO_R_CAPAB = 9, | |
0e7cb8c6 JM |
262 | DPP_TEST_NO_R_BOOTSTRAP_KEY_HASH_AUTH_REQ = 10, |
263 | DPP_TEST_NO_I_BOOTSTRAP_KEY_HASH_AUTH_REQ = 11, | |
264 | DPP_TEST_NO_I_PROTO_KEY_AUTH_REQ = 12, | |
265 | DPP_TEST_NO_I_NONCE_AUTH_REQ = 13, | |
266 | DPP_TEST_NO_I_CAPAB_AUTH_REQ = 14, | |
267 | DPP_TEST_NO_WRAPPED_DATA_AUTH_REQ = 15, | |
ce9acce0 JM |
268 | DPP_TEST_NO_STATUS_AUTH_RESP = 16, |
269 | DPP_TEST_NO_R_BOOTSTRAP_KEY_HASH_AUTH_RESP = 17, | |
270 | DPP_TEST_NO_I_BOOTSTRAP_KEY_HASH_AUTH_RESP = 18, | |
271 | DPP_TEST_NO_R_PROTO_KEY_AUTH_RESP = 19, | |
272 | DPP_TEST_NO_R_NONCE_AUTH_RESP = 20, | |
273 | DPP_TEST_NO_I_NONCE_AUTH_RESP = 21, | |
274 | DPP_TEST_NO_R_CAPAB_AUTH_RESP = 22, | |
275 | DPP_TEST_NO_R_AUTH_AUTH_RESP = 23, | |
276 | DPP_TEST_NO_WRAPPED_DATA_AUTH_RESP = 24, | |
f9c7d770 JM |
277 | DPP_TEST_NO_STATUS_AUTH_CONF = 25, |
278 | DPP_TEST_NO_R_BOOTSTRAP_KEY_HASH_AUTH_CONF = 26, | |
279 | DPP_TEST_NO_I_BOOTSTRAP_KEY_HASH_AUTH_CONF = 27, | |
280 | DPP_TEST_NO_I_AUTH_AUTH_CONF = 28, | |
281 | DPP_TEST_NO_WRAPPED_DATA_AUTH_CONF = 29, | |
978bc3f2 JM |
282 | DPP_TEST_I_NONCE_MISMATCH_AUTH_RESP = 30, |
283 | DPP_TEST_INCOMPATIBLE_R_CAPAB_AUTH_RESP = 31, | |
284 | DPP_TEST_R_AUTH_MISMATCH_AUTH_RESP = 32, | |
285 | DPP_TEST_I_AUTH_MISMATCH_AUTH_CONF = 33, | |
61f9f27f JM |
286 | DPP_TEST_NO_FINITE_CYCLIC_GROUP_PKEX_EXCHANGE_REQ = 34, |
287 | DPP_TEST_NO_ENCRYPTED_KEY_PKEX_EXCHANGE_REQ = 35, | |
288 | DPP_TEST_NO_STATUS_PKEX_EXCHANGE_RESP = 36, | |
289 | DPP_TEST_NO_ENCRYPTED_KEY_PKEX_EXCHANGE_RESP = 37, | |
290 | DPP_TEST_NO_BOOTSTRAP_KEY_PKEX_CR_REQ = 38, | |
291 | DPP_TEST_NO_I_AUTH_TAG_PKEX_CR_REQ = 39, | |
292 | DPP_TEST_NO_WRAPPED_DATA_PKEX_CR_REQ = 40, | |
293 | DPP_TEST_NO_BOOTSTRAP_KEY_PKEX_CR_RESP = 41, | |
294 | DPP_TEST_NO_R_AUTH_TAG_PKEX_CR_RESP = 42, | |
295 | DPP_TEST_NO_WRAPPED_DATA_PKEX_CR_RESP = 43, | |
1cfcbd32 JM |
296 | DPP_TEST_INVALID_ENCRYPTED_KEY_PKEX_EXCHANGE_REQ = 44, |
297 | DPP_TEST_INVALID_ENCRYPTED_KEY_PKEX_EXCHANGE_RESP = 45, | |
f31ef96d | 298 | DPP_TEST_INVALID_STATUS_PKEX_EXCHANGE_RESP = 46, |
89d0bf67 JM |
299 | DPP_TEST_INVALID_BOOTSTRAP_KEY_PKEX_CR_REQ = 47, |
300 | DPP_TEST_INVALID_BOOTSTRAP_KEY_PKEX_CR_RESP = 48, | |
7e0ebe21 JM |
301 | DPP_TEST_I_AUTH_TAG_MISMATCH_PKEX_CR_REQ = 49, |
302 | DPP_TEST_R_AUTH_TAG_MISMATCH_PKEX_CR_RESP = 50, | |
f411ad1b JM |
303 | DPP_TEST_NO_E_NONCE_CONF_REQ = 51, |
304 | DPP_TEST_NO_CONFIG_ATTR_OBJ_CONF_REQ = 52, | |
305 | DPP_TEST_NO_WRAPPED_DATA_CONF_REQ = 53, | |
306 | DPP_TEST_NO_E_NONCE_CONF_RESP = 54, | |
307 | DPP_TEST_NO_CONFIG_OBJ_CONF_RESP = 55, | |
308 | DPP_TEST_NO_STATUS_CONF_RESP = 56, | |
309 | DPP_TEST_NO_WRAPPED_DATA_CONF_RESP = 57, | |
af7f10fc JM |
310 | DPP_TEST_INVALID_STATUS_CONF_RESP = 58, |
311 | DPP_TEST_E_NONCE_MISMATCH_CONF_RESP = 59, | |
a306ed5a JM |
312 | DPP_TEST_NO_TRANSACTION_ID_PEER_DISC_REQ = 60, |
313 | DPP_TEST_NO_CONNECTOR_PEER_DISC_REQ = 61, | |
314 | DPP_TEST_NO_TRANSACTION_ID_PEER_DISC_RESP = 62, | |
315 | DPP_TEST_NO_STATUS_PEER_DISC_RESP = 63, | |
316 | DPP_TEST_NO_CONNECTOR_PEER_DISC_RESP = 64, | |
762fb4f0 | 317 | DPP_TEST_AUTH_RESP_IN_PLACE_OF_CONF = 65, |
b6b4226b JM |
318 | DPP_TEST_INVALID_I_PROTO_KEY_AUTH_REQ = 66, |
319 | DPP_TEST_INVALID_R_PROTO_KEY_AUTH_RESP = 67, | |
65ecce87 JM |
320 | DPP_TEST_INVALID_R_BOOTSTRAP_KEY_HASH_AUTH_REQ = 68, |
321 | DPP_TEST_INVALID_I_BOOTSTRAP_KEY_HASH_AUTH_REQ = 69, | |
322 | DPP_TEST_INVALID_R_BOOTSTRAP_KEY_HASH_AUTH_RESP = 70, | |
323 | DPP_TEST_INVALID_I_BOOTSTRAP_KEY_HASH_AUTH_RESP = 71, | |
324 | DPP_TEST_INVALID_R_BOOTSTRAP_KEY_HASH_AUTH_CONF = 72, | |
325 | DPP_TEST_INVALID_I_BOOTSTRAP_KEY_HASH_AUTH_CONF = 73, | |
3f35ec2d JM |
326 | DPP_TEST_INVALID_STATUS_AUTH_RESP = 74, |
327 | DPP_TEST_INVALID_STATUS_AUTH_CONF = 75, | |
f9cf7d03 | 328 | DPP_TEST_INVALID_CONFIG_ATTR_OBJ_CONF_REQ = 76, |
4b8de0c9 JM |
329 | DPP_TEST_INVALID_TRANSACTION_ID_PEER_DISC_RESP = 77, |
330 | DPP_TEST_INVALID_STATUS_PEER_DISC_RESP = 78, | |
331 | DPP_TEST_INVALID_CONNECTOR_PEER_DISC_RESP = 79, | |
332 | DPP_TEST_INVALID_CONNECTOR_PEER_DISC_REQ = 80, | |
a4446739 | 333 | DPP_TEST_INVALID_I_NONCE_AUTH_REQ = 81, |
55c6c858 | 334 | DPP_TEST_INVALID_TRANSACTION_ID_PEER_DISC_REQ = 82, |
f0a383a9 | 335 | DPP_TEST_INVALID_E_NONCE_CONF_REQ = 83, |
34603767 JM |
336 | DPP_TEST_STOP_AT_PKEX_EXCHANGE_RESP = 84, |
337 | DPP_TEST_STOP_AT_PKEX_CR_REQ = 85, | |
338 | DPP_TEST_STOP_AT_PKEX_CR_RESP = 86, | |
339 | DPP_TEST_STOP_AT_AUTH_REQ = 87, | |
340 | DPP_TEST_STOP_AT_AUTH_RESP = 88, | |
341 | DPP_TEST_STOP_AT_AUTH_CONF = 89, | |
342 | DPP_TEST_STOP_AT_CONF_REQ = 90, | |
60239f60 JM |
343 | }; |
344 | ||
345 | extern enum dpp_test_behavior dpp_test; | |
2bdc47a9 JM |
346 | extern u8 dpp_pkex_own_mac_override[ETH_ALEN]; |
347 | extern u8 dpp_pkex_peer_mac_override[ETH_ALEN]; | |
acc555f9 JM |
348 | extern u8 dpp_pkex_ephemeral_key_override[600]; |
349 | extern size_t dpp_pkex_ephemeral_key_override_len; | |
f5526975 JM |
350 | extern u8 dpp_protocol_key_override[600]; |
351 | extern size_t dpp_protocol_key_override_len; | |
055cd397 JM |
352 | extern u8 dpp_nonce_override[DPP_MAX_NONCE_LEN]; |
353 | extern size_t dpp_nonce_override_len; | |
60239f60 JM |
354 | #endif /* CONFIG_TESTING_OPTIONS */ |
355 | ||
be27e185 | 356 | void dpp_bootstrap_info_free(struct dpp_bootstrap_info *info); |
484788b8 | 357 | const char * dpp_bootstrap_type_txt(enum dpp_bootstrap_type type); |
500ed7f0 | 358 | int dpp_bootstrap_key_hash(struct dpp_bootstrap_info *bi); |
be27e185 JM |
359 | int dpp_parse_uri_chan_list(struct dpp_bootstrap_info *bi, |
360 | const char *chan_list); | |
361 | int dpp_parse_uri_mac(struct dpp_bootstrap_info *bi, const char *mac); | |
362 | int dpp_parse_uri_info(struct dpp_bootstrap_info *bi, const char *info); | |
363 | struct dpp_bootstrap_info * dpp_parse_qr_code(const char *uri); | |
364 | char * dpp_keygen(struct dpp_bootstrap_info *bi, const char *curve, | |
365 | const u8 *privkey, size_t privkey_len); | |
f97ace34 | 366 | struct hostapd_hw_modes; |
30d27b04 JM |
367 | struct dpp_authentication * dpp_auth_init(void *msg_ctx, |
368 | struct dpp_bootstrap_info *peer_bi, | |
369 | struct dpp_bootstrap_info *own_bi, | |
d1f08264 | 370 | u8 dpp_allowed_roles, |
f97ace34 JM |
371 | unsigned int neg_freq, |
372 | struct hostapd_hw_modes *own_modes, | |
373 | u16 num_modes); | |
30d27b04 JM |
374 | struct dpp_authentication * |
375 | dpp_auth_req_rx(void *msg_ctx, u8 dpp_allowed_roles, int qr_mutual, | |
376 | struct dpp_bootstrap_info *peer_bi, | |
377 | struct dpp_bootstrap_info *own_bi, | |
dc4d271c | 378 | unsigned int freq, const u8 *hdr, const u8 *attr_start, |
27fefbbb | 379 | size_t attr_len); |
30d27b04 | 380 | struct wpabuf * |
dc4d271c JM |
381 | dpp_auth_resp_rx(struct dpp_authentication *auth, const u8 *hdr, |
382 | const u8 *attr_start, size_t attr_len); | |
461d39af JM |
383 | struct wpabuf * dpp_build_conf_req(struct dpp_authentication *auth, |
384 | const char *json); | |
dc4d271c JM |
385 | int dpp_auth_conf_rx(struct dpp_authentication *auth, const u8 *hdr, |
386 | const u8 *attr_start, size_t attr_len); | |
30d27b04 JM |
387 | int dpp_notify_new_qr_code(struct dpp_authentication *auth, |
388 | struct dpp_bootstrap_info *peer_bi); | |
461d39af | 389 | void dpp_configuration_free(struct dpp_configuration *conf); |
30d27b04 | 390 | void dpp_auth_deinit(struct dpp_authentication *auth); |
461d39af JM |
391 | struct wpabuf * |
392 | dpp_conf_req_rx(struct dpp_authentication *auth, const u8 *attr_start, | |
393 | size_t attr_len); | |
394 | int dpp_conf_resp_rx(struct dpp_authentication *auth, | |
395 | const struct wpabuf *resp); | |
30d27b04 JM |
396 | struct wpabuf * dpp_alloc_msg(enum dpp_public_action_frame_type type, |
397 | size_t len); | |
398 | const u8 * dpp_get_attr(const u8 *buf, size_t len, u16 req_id, u16 *ret_len); | |
399 | int dpp_check_attrs(const u8 *buf, size_t len); | |
461d39af | 400 | int dpp_key_expired(const char *timestamp, os_time_t *expiry); |
5dd745b7 | 401 | const char * dpp_akm_str(enum dpp_akm akm); |
8179ae3a PK |
402 | int dpp_configurator_get_key(const struct dpp_configurator *conf, char *buf, |
403 | size_t buflen); | |
461d39af JM |
404 | void dpp_configurator_free(struct dpp_configurator *conf); |
405 | struct dpp_configurator * | |
406 | dpp_keygen_configurator(const char *curve, const u8 *privkey, | |
407 | size_t privkey_len); | |
f522bb23 | 408 | int dpp_configurator_own_config(struct dpp_authentication *auth, |
a2588be8 | 409 | const char *curve, int ap); |
e85b6601 JM |
410 | enum dpp_status_error |
411 | dpp_peer_intro(struct dpp_introduction *intro, const char *own_connector, | |
412 | const u8 *net_access_key, size_t net_access_key_len, | |
413 | const u8 *csign_key, size_t csign_key_len, | |
414 | const u8 *peer_connector, size_t peer_connector_len, | |
415 | os_time_t *expiry); | |
219d4c9f | 416 | struct dpp_pkex * dpp_pkex_init(void *msg_ctx, struct dpp_bootstrap_info *bi, |
500ed7f0 JM |
417 | const u8 *own_mac, |
418 | const char *identifier, | |
419 | const char *code); | |
219d4c9f JM |
420 | struct dpp_pkex * dpp_pkex_rx_exchange_req(void *msg_ctx, |
421 | struct dpp_bootstrap_info *bi, | |
500ed7f0 JM |
422 | const u8 *own_mac, |
423 | const u8 *peer_mac, | |
424 | const char *identifier, | |
425 | const char *code, | |
426 | const u8 *buf, size_t len); | |
427 | struct wpabuf * dpp_pkex_rx_exchange_resp(struct dpp_pkex *pkex, | |
af4103e5 | 428 | const u8 *peer_mac, |
500ed7f0 JM |
429 | const u8 *buf, size_t len); |
430 | struct wpabuf * dpp_pkex_rx_commit_reveal_req(struct dpp_pkex *pkex, | |
4be5bc98 | 431 | const u8 *hdr, |
500ed7f0 | 432 | const u8 *buf, size_t len); |
4be5bc98 | 433 | int dpp_pkex_rx_commit_reveal_resp(struct dpp_pkex *pkex, const u8 *hdr, |
500ed7f0 JM |
434 | const u8 *buf, size_t len); |
435 | void dpp_pkex_free(struct dpp_pkex *pkex); | |
be27e185 | 436 | |
4b8de0c9 JM |
437 | char * dpp_corrupt_connector_signature(const char *connector); |
438 | ||
be27e185 | 439 | #endif /* DPP_H */ |