mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-12-01 11:48:23 -05:00
e1ee6b600b
The new file wps_nfc.c and ndef.c implements NFC device independent operation, wps_nfc_pn531.c implements NFC device dependent operation. This patch is only for the following use case: - Enrollee = wpa_supplicant - Registrar = hostapd internal Registrar Following NFC methods can be used: - Enrollee PIN with NFC - Registrar PIN with NFC - unencrypted credential with NFC Encrypted credentials are not supported. Enrollee side operation: Registrar side operation: Example configuration. CONFIG_WPS=y CONFIG_WPS_NFC=y CONFIG_WPS_NFC_PN531=y I used NFC device "NXP PN531". The NFC device access method is confidential, so I used outer library. Please download below files from https://www.saice-wpsnfc.bz/index.php [WPS NFC Library] WpsNfcLibrary/WpsNfc.h WpsNfcLibrary/WpsNfcType.h WpsNfcLibrary/WpsNfcVersion.h WpsNfcLibrary/linux/libnfc_mapping_pn53x.dll WpsNfcLibrary/linux/wpsnfc.dll [NFC Reader/Writer Kernel Driver] NFCKernelDriver-1.0.3/linux/kobj/sonyrw.ko <WiFi test> The hostapd/wpa_supplicant with this patch passed below tests on "Wi-Fi WPS Test Plan Version 1.6". 4.2.5 Add device using NFC Method with password token (I used SONY STA instead of NXP STA.) 4.2.6 Add device using NFC Method with configuration token 5.1.9 Add to AP using NFC Method with password token through internal registrar (I used SONY AP instead of NXP AP.) 5.1.10 Add to AP using NFC Method with configuration token through internal registrar
51 lines
1.4 KiB
C
51 lines
1.4 KiB
C
/*
|
|
* hostapd / WPS integration
|
|
* Copyright (c) 2008, Jouni Malinen <j@w1.fi>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
* Alternatively, this software may be distributed under the terms of BSD
|
|
* license.
|
|
*
|
|
* See README and COPYING for more details.
|
|
*/
|
|
|
|
#ifndef WPS_HOSTAPD_H
|
|
#define WPS_HOSTAPD_H
|
|
|
|
#ifdef CONFIG_WPS
|
|
|
|
int hostapd_init_wps(struct hostapd_data *hapd,
|
|
struct hostapd_bss_config *conf);
|
|
void hostapd_deinit_wps(struct hostapd_data *hapd);
|
|
int hostapd_wps_add_pin(struct hostapd_data *hapd, const char *uuid,
|
|
const char *pin);
|
|
int hostapd_wps_button_pushed(struct hostapd_data *hapd);
|
|
int hostapd_wps_start_oob(struct hostapd_data *hapd, char *device_type,
|
|
char *path, char *method, char *name);
|
|
void hostapd_wps_probe_req_rx(struct hostapd_data *hapd, const u8 *addr,
|
|
const u8 *ie, size_t ie_len);
|
|
|
|
#else /* CONFIG_WPS */
|
|
|
|
static inline int hostapd_init_wps(struct hostapd_data *hapd,
|
|
struct hostapd_bss_config *conf)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void hostapd_deinit_wps(struct hostapd_data *hapd)
|
|
{
|
|
}
|
|
|
|
static inline void hostapd_wps_probe_req_rx(struct hostapd_data *hapd,
|
|
const u8 *addr,
|
|
const u8 *ie, size_t ie_len)
|
|
{
|
|
}
|
|
#endif /* CONFIG_WPS */
|
|
|
|
#endif /* WPS_HOSTAPD_H */
|