aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/hostapd_cli.c
diff options
context:
space:
mode:
authorMasashi Honma <honma@ictec.co.jp>2009-02-26 19:57:38 (GMT)
committerJouni Malinen <j@w1.fi>2009-02-26 19:57:38 (GMT)
commit46bdb83acdb9c2f1a031971e665b75fce6bcbe47 (patch)
treebf3fdd443275779adc6329be9201b111407bf07d /hostapd/hostapd_cli.c
parentb414900a90829d3d3a58a45f29be708a6757b258 (diff)
downloadhostap-46bdb83acdb9c2f1a031971e665b75fce6bcbe47.zip
hostap-46bdb83acdb9c2f1a031971e665b75fce6bcbe47.tar.gz
hostap-46bdb83acdb9c2f1a031971e665b75fce6bcbe47.tar.bz2
WPS: Add UFD support (USBA out-of-band mechanism)
This patch is only for the following use case: - Enrollee = wpa_supplicant - Registrar = hostapd internal Registrar Following UFD methods can be used: - Enrollee PIN with UFD - Registrar PIN with UFD - unencrypted credential with UFD Encrypted credentials are not supported. Enrollee side operation: wpa_cli -i ath0 wps_oob <device type> <mount point> <oob method> oob method = pin-e/pin-r/cred wpa_cli -i ath0 wps_oob ufd /mnt/ pin-r Registrar side operation: ./hostapd_cli -i ath0 wps_oob <device type> <mount point> <oob method> oob method = pin-e/pin-r/cred hostapd_cli -i ath0 wps_oob ufd /mnt/ cred
Diffstat (limited to 'hostapd/hostapd_cli.c')
-rw-r--r--hostapd/hostapd_cli.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
index 2614113..d4d7a3f 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
@@ -89,6 +89,7 @@ static const char *commands_help =
#ifdef CONFIG_WPS
" wps_pin <uuid> <pin> add WPS Enrollee PIN (Device Password)\n"
" wps_pbc indicate button pushed to initiate PBC\n"
+" wps_oob <type> <path> <method> use WPS with out-of-band (UFD)\n"
#endif /* CONFIG_WPS */
" help show this usage help\n"
" interface [ifname] show interfaces/select interface\n"
@@ -275,6 +276,31 @@ static int hostapd_cli_cmd_wps_pbc(struct wpa_ctrl *ctrl, int argc,
{
return wpa_ctrl_command(ctrl, "WPS_PBC");
}
+
+
+static int hostapd_cli_cmd_wps_oob(struct wpa_ctrl *ctrl, int argc,
+ char *argv[])
+{
+ char cmd[256];
+ int res;
+
+ if (argc != 3) {
+ printf("Invalid WPS_OOB command: need three arguments:\n"
+ "- OOB_DEV_TYPE: use 'ufd'\n"
+ "- OOB_PATH: path of OOB device like '/mnt'\n"
+ "- OOB_METHOD: OOB method 'pin-e' or 'pin-r', "
+ "'cred'\n");
+ return -1;
+ }
+
+ res = os_snprintf(cmd, sizeof(cmd), "WPS_OOB %s %s %s",
+ argv[0], argv[1], argv[2]);
+ if (res < 0 || (size_t) res >= sizeof(cmd) - 1) {
+ printf("Too long WPS_OOB command.\n");
+ return -1;
+ }
+ return wpa_ctrl_command(ctrl, cmd);
+}
#endif /* CONFIG_WPS */
@@ -432,6 +458,7 @@ static struct hostapd_cli_cmd hostapd_cli_commands[] = {
#ifdef CONFIG_WPS
{ "wps_pin", hostapd_cli_cmd_wps_pin },
{ "wps_pbc", hostapd_cli_cmd_wps_pbc },
+ { "wps_oob", hostapd_cli_cmd_wps_oob },
#endif /* CONFIG_WPS */
{ "help", hostapd_cli_cmd_help },
{ "interface", hostapd_cli_cmd_interface },