Lines Matching refs:pfs
8270 struct dpp_pfs *pfs; in dpp_pfs_init() local
8272 pfs = os_zalloc(sizeof(*pfs)); in dpp_pfs_init()
8273 if (!pfs) in dpp_pfs_init()
8276 own_key = dpp_set_keypair(&pfs->curve, net_access_key, in dpp_pfs_init()
8284 pfs->ecdh = crypto_ecdh_init(pfs->curve->ike_group); in dpp_pfs_init()
8285 if (!pfs->ecdh) in dpp_pfs_init()
8288 pub = crypto_ecdh_get_pubkey(pfs->ecdh, 0); in dpp_pfs_init()
8289 pub = wpabuf_zeropad(pub, pfs->curve->prime_len); in dpp_pfs_init()
8293 pfs->ie = wpabuf_alloc(5 + wpabuf_len(pub)); in dpp_pfs_init()
8294 if (!pfs->ie) in dpp_pfs_init()
8296 wpabuf_put_u8(pfs->ie, WLAN_EID_EXTENSION); in dpp_pfs_init()
8297 wpabuf_put_u8(pfs->ie, 1 + 2 + wpabuf_len(pub)); in dpp_pfs_init()
8298 wpabuf_put_u8(pfs->ie, WLAN_EID_EXT_OWE_DH_PARAM); in dpp_pfs_init()
8299 wpabuf_put_le16(pfs->ie, pfs->curve->ike_group); in dpp_pfs_init()
8300 wpabuf_put_buf(pfs->ie, pub); in dpp_pfs_init()
8303 pfs->ie); in dpp_pfs_init()
8305 return pfs; in dpp_pfs_init()
8308 dpp_pfs_free(pfs); in dpp_pfs_init()
8313 int dpp_pfs_process(struct dpp_pfs *pfs, const u8 *peer_ie, size_t peer_ie_len) in dpp_pfs_process() argument
8317 if (WPA_GET_LE16(peer_ie) != pfs->curve->ike_group) { in dpp_pfs_process()
8322 pfs->secret = crypto_ecdh_set_peerkey(pfs->ecdh, 0, peer_ie + 2, in dpp_pfs_process()
8324 pfs->secret = wpabuf_zeropad(pfs->secret, pfs->curve->prime_len); in dpp_pfs_process()
8325 if (!pfs->secret) { in dpp_pfs_process()
8329 wpa_hexdump_buf_key(MSG_DEBUG, "DPP: DH shared secret", pfs->secret); in dpp_pfs_process()
8334 void dpp_pfs_free(struct dpp_pfs *pfs) in dpp_pfs_free() argument
8336 if (!pfs) in dpp_pfs_free()
8338 crypto_ecdh_deinit(pfs->ecdh); in dpp_pfs_free()
8339 wpabuf_free(pfs->ie); in dpp_pfs_free()
8340 wpabuf_clear_free(pfs->secret); in dpp_pfs_free()
8341 os_free(pfs); in dpp_pfs_free()