#include "utils/list.h"
#include "wps/wps_defs.h"
+#define DEVICE_IDENTITY_KEY_LEN 16
+
/**
* PR_MAX_OP_CLASSES - Maximum number of operating classes
*/
bool support_6ghz;
+ /* Cipher version type */
+ int dik_cipher;
+
+ /* Buffer to hold the DevIK */
+ u8 dik_data[DEVICE_IDENTITY_KEY_LEN];
+
+ /* Length of DevIK in octets */
+ size_t dik_len;
+
+ /* DevIK expiration */
+ int expiration;
+
/**
* cb_ctx - Context to use with callback functions
*/
#include "utils/common.h"
#include "common/proximity_ranging.h"
+#include "p2p/p2p.h"
#include "wpa_supplicant_i.h"
#include "config.h"
#include "pr_supplicant.h"
os_memcpy(pr.country, "XX\x04", 3);
}
+ if (wpa_s->conf->dik &&
+ wpabuf_len(wpa_s->conf->dik) <= DEVICE_IDENTITY_KEY_LEN) {
+ pr.dik_cipher = wpa_s->conf->dik_cipher;
+ pr.dik_len = wpabuf_len(wpa_s->conf->dik);
+ os_memcpy(pr.dik_data, wpabuf_head(wpa_s->conf->dik),
+ pr.dik_len);
+ pr.expiration = 24; /* hours */
+ } else {
+ pr.dik_cipher = DIRA_CIPHER_VERSION_128;
+ pr.dik_len = DEVICE_IDENTITY_KEY_LEN;
+ pr.expiration = 24; /* hours */
+ if (os_get_random(pr.dik_data, pr.dik_len) < 0)
+ return -1;
+
+ wpa_s->conf->dik =
+ wpabuf_alloc_copy(pr.dik_data, pr.dik_len);
+ if (!wpa_s->conf->dik)
+ return -1;
+
+ wpa_s->conf->dik_cipher = pr.dik_cipher;
+
+ wpa_printf(MSG_DEBUG, "PR: PR init new DIRA set");
+
+ if (wpa_s->conf->update_config &&
+ wpa_config_write(wpa_s->confname, wpa_s->conf))
+ wpa_printf(MSG_DEBUG,
+ "PR: Failed to update configuration");
+ }
+
global->pr = pr_init(&pr);
if (!global->pr) {
wpa_printf(MSG_DEBUG, "PR: Failed to init PR");