Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/wpa/dist merge 0.7.3



details:   https://anonhg.NetBSD.org/src/rev/4fee995c351a
branches:  trunk
changeset: 769457:4fee995c351a
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Sep 10 20:59:03 2011 +0000

description:
merge 0.7.3

diffstat:

 external/bsd/wpa/dist/hostapd/hostapd_cli.c |  23 +++++++++++++++++++++++
 external/bsd/wpa/dist/src/ap/wpa_auth.c     |  18 ++++++++++++++++++
 2 files changed, 41 insertions(+), 0 deletions(-)

diffs (75 lines):

diff -r 4267efa1dc5b -r 4fee995c351a external/bsd/wpa/dist/hostapd/hostapd_cli.c
--- a/external/bsd/wpa/dist/hostapd/hostapd_cli.c       Sat Sep 10 20:53:49 2011 +0000
+++ b/external/bsd/wpa/dist/hostapd/hostapd_cli.c       Sat Sep 10 20:59:03 2011 +0000
@@ -94,6 +94,7 @@
 #ifdef CONFIG_WPS_OOB
 "   wps_oob <type> <path> <method>  use WPS with out-of-band (UFD)\n"
 #endif /* CONFIG_WPS_OOB */
+"   wps_ap_pin <cmd> [params..]  enable/disable AP PIN\n"
 #endif /* CONFIG_WPS */
 "   help                 show this usage help\n"
 "   interface [ifname]   show interfaces/select interface\n"
@@ -405,6 +406,27 @@
        return wpa_ctrl_command(ctrl, cmd);
 }
 #endif /* CONFIG_WPS_OOB */
+
+
+static int hostapd_cli_cmd_wps_ap_pin(struct wpa_ctrl *ctrl, int argc,
+                                     char *argv[])
+{
+       char buf[64];
+       if (argc < 1) {
+               printf("Invalid 'wps_ap_pin' command - at least one argument "
+                      "is required.\n");
+               return -1;
+       }
+       if (argc > 2)
+               snprintf(buf, sizeof(buf), "WPS_AP_PIN %s %s %s",
+                        argv[0], argv[1], argv[2]);
+       else if (argc > 1)
+               snprintf(buf, sizeof(buf), "WPS_AP_PIN %s %s",
+                        argv[0], argv[1]);
+       else
+               snprintf(buf, sizeof(buf), "WPS_AP_PIN %s", argv[0]);
+       return wpa_ctrl_command(ctrl, buf);
+}
 #endif /* CONFIG_WPS */
 
 
@@ -567,6 +589,7 @@
 #ifdef CONFIG_WPS_OOB
        { "wps_oob", hostapd_cli_cmd_wps_oob },
 #endif /* CONFIG_WPS_OOB */
+       { "wps_ap_pin", hostapd_cli_cmd_wps_ap_pin },
 #endif /* CONFIG_WPS */
        { "help", hostapd_cli_cmd_help },
        { "interface", hostapd_cli_cmd_interface },
diff -r 4267efa1dc5b -r 4fee995c351a external/bsd/wpa/dist/src/ap/wpa_auth.c
--- a/external/bsd/wpa/dist/src/ap/wpa_auth.c   Sat Sep 10 20:53:49 2011 +0000
+++ b/external/bsd/wpa/dist/src/ap/wpa_auth.c   Sat Sep 10 20:59:03 2011 +0000
@@ -1274,6 +1274,24 @@
                break;
        case WPA_REAUTH:
        case WPA_REAUTH_EAPOL:
+               if (!sm->started) {
+                       /*
+                        * When using WPS, we may end up here if the STA
+                        * manages to re-associate without the previous STA
+                        * entry getting removed. Consequently, we need to make
+                        * sure that the WPA state machines gets initialized
+                        * properly at this point.
+                        */
+                       wpa_printf(MSG_DEBUG, "WPA state machine had not been "
+                                  "started - initialize now");
+                       sm->started = 1;
+                       sm->Init = TRUE;
+                       if (wpa_sm_step(sm) == 1)
+                               return 1; /* should not really happen */
+                       sm->Init = FALSE;
+                       sm->AuthenticationRequest = TRUE;
+                       break;
+               }
                if (sm->GUpdateStationKeys) {
                        /*
                         * Reauthentication cancels the pending group key



Home | Main Index | Thread Index | Old Index