Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/wpa merge v1.0



details:   https://anonhg.NetBSD.org/src/rev/0c8916c4b212
branches:  trunk
changeset: 781932:0c8916c4b212
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Oct 08 00:03:20 2012 +0000

description:
merge v1.0

diffstat:

 external/bsd/wpa/bin/hostapd/Makefile                                             |     5 +-
 external/bsd/wpa/bin/hostapd_cli/Makefile                                         |     4 +-
 external/bsd/wpa/bin/wpa_cli/Makefile                                             |     4 +-
 external/bsd/wpa/bin/wpa_supplicant/Makefile                                      |     4 +-
 external/bsd/wpa/dist/hostapd/.gitignore                                          |     7 -
 external/bsd/wpa/dist/hostapd/hostapd_cli.c                                       |   322 +-
 external/bsd/wpa/dist/src/ap/wpa_auth.c                                           |   415 +-
 external/bsd/wpa/dist/src/drivers/driver_atmel.c                                  |   499 -
 external/bsd/wpa/dist/src/drivers/driver_bsd.c                                    |   147 +-
 external/bsd/wpa/dist/src/drivers/driver_ipw.c                                    |   472 -
 external/bsd/wpa/dist/src/drivers/driver_ndiswrapper.c                            |   378 -
 external/bsd/wpa/dist/src/drivers/driver_test.c                                   |   739 ++-
 external/bsd/wpa/dist/src/l2_packet/l2_packet_freebsd.c                           |    31 +
 external/bsd/wpa/dist/src/utils/eloop.c                                           |    12 +
 external/bsd/wpa/dist/src/utils/os.h                                              |    10 +
 external/bsd/wpa/dist/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service |     4 -
 external/bsd/wpa/dist/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service           |     4 -
 external/bsd/wpa/dist/wpa_supplicant/mlme.c                                       |  3198 ----------
 external/bsd/wpa/dist/wpa_supplicant/mlme.h                                       |   129 -
 external/bsd/wpa/dist/wpa_supplicant/wpa_cli.c                                    |  2040 +++++-
 20 files changed, 3102 insertions(+), 5322 deletions(-)

diffs (truncated from 9901 to 300 lines):

diff -r bc3ea8219cde -r 0c8916c4b212 external/bsd/wpa/bin/hostapd/Makefile
--- a/external/bsd/wpa/bin/hostapd/Makefile     Sun Oct 07 23:46:57 2012 +0000
+++ b/external/bsd/wpa/bin/hostapd/Makefile     Mon Oct 08 00:03:20 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2010/08/29 15:53:01 christos Exp $
+# $NetBSD: Makefile,v 1.3 2012/10/08 00:03:20 christos Exp $
 
 .include "${.CURDIR}/../Makefile.inc"
 
@@ -12,10 +12,12 @@
 ap_drv_ops.c \
 ap_mlme.c \
 authsrv.c \
+beacon.c \
 ctrl_iface_ap.c \
 drv_callbacks.c \
 hostapd.c \
 ieee802_11_auth.c \
+ieee802_11_shared.c \
 ieee802_1x.c \
 peerkey_auth.c \
 pmksa_cache_auth.c \
@@ -81,6 +83,7 @@
 # crypto
 SRCS+= \
 md5.c \
+random.c \
 sha1.c \
 sha1-pbkdf2.c
 
diff -r bc3ea8219cde -r 0c8916c4b212 external/bsd/wpa/bin/hostapd_cli/Makefile
--- a/external/bsd/wpa/bin/hostapd_cli/Makefile Sun Oct 07 23:46:57 2012 +0000
+++ b/external/bsd/wpa/bin/hostapd_cli/Makefile Mon Oct 08 00:03:20 2012 +0000
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile,v 1.1 2010/08/04 17:12:33 christos Exp $
+# $NetBSD: Makefile,v 1.2 2012/10/08 00:03:20 christos Exp $
 
 .include "${.CURDIR}/../Makefile.inc"
 
 .PATH.c: ${HOSTAPD_DISTDIR}
 
 PROG=  hostapd_cli
-SRCS=  hostapd_cli.c wpa_ctrl.c os_unix.c
+SRCS=  hostapd_cli.c wpa_ctrl.c os_unix.c eloop.c edit.c wpa_debug.c
 
 MAN=   hostapd_cli.8
 
diff -r bc3ea8219cde -r 0c8916c4b212 external/bsd/wpa/bin/wpa_cli/Makefile
--- a/external/bsd/wpa/bin/wpa_cli/Makefile     Sun Oct 07 23:46:57 2012 +0000
+++ b/external/bsd/wpa/bin/wpa_cli/Makefile     Mon Oct 08 00:03:20 2012 +0000
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile,v 1.3 2010/08/04 20:29:54 christos Exp $
+# $NetBSD: Makefile,v 1.4 2012/10/08 00:03:20 christos Exp $
 
 .include "${.CURDIR}/../Makefile.inc"
 
 .PATH.c: ${WPA_SUPPLICANT_DISTDIR}
 
 PROG=  wpa_cli
-SRCS=  wpa_cli.c wpa_ctrl.c os_unix.c
+SRCS=  wpa_cli.c wpa_ctrl.c os_unix.c eloop.c edit.c wpa_debug.c common.c
 
 CPPFLAGS+=-DCONFIG_READLINE
 LDADD+=-ledit -lterminfo
diff -r bc3ea8219cde -r 0c8916c4b212 external/bsd/wpa/bin/wpa_supplicant/Makefile
--- a/external/bsd/wpa/bin/wpa_supplicant/Makefile      Sun Oct 07 23:46:57 2012 +0000
+++ b/external/bsd/wpa/bin/wpa_supplicant/Makefile      Mon Oct 08 00:03:20 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2010/08/04 17:12:34 christos Exp $
+# $NetBSD: Makefile,v 1.2 2012/10/08 00:03:20 christos Exp $
 
 .include "${.CURDIR}/../Makefile.inc"
 
@@ -12,6 +12,7 @@
 config_file.c \
 ctrl_iface.c \
 ctrl_iface_unix.c \
+driver_common.c \
 driver_bsd.c \
 driver_wired.c \
 drivers.c \
@@ -29,6 +30,7 @@
 peerkey.c \
 pmksa_cache.c \
 preauth.c \
+random.c \
 scan.c \
 sha1.c \
 wpa.c \
diff -r bc3ea8219cde -r 0c8916c4b212 external/bsd/wpa/dist/hostapd/.gitignore
--- a/external/bsd/wpa/dist/hostapd/.gitignore  Sun Oct 07 23:46:57 2012 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-*.d
-.config
-driver_conf.c
-hostapd
-hostapd_cli
-hlr_auc_gw
-nt_password_hash
diff -r bc3ea8219cde -r 0c8916c4b212 external/bsd/wpa/dist/hostapd/hostapd_cli.c
--- a/external/bsd/wpa/dist/hostapd/hostapd_cli.c       Sun Oct 07 23:46:57 2012 +0000
+++ b/external/bsd/wpa/dist/hostapd/hostapd_cli.c       Mon Oct 08 00:03:20 2012 +0000
@@ -1,6 +1,6 @@
 /*
  * hostapd - command line interface for hostapd daemon
- * Copyright (c) 2004-2010, Jouni Malinen <j%w1.fi@localhost>
+ * Copyright (c) 2004-2011, Jouni Malinen <j%w1.fi@localhost>
  *
  * 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
@@ -16,13 +16,15 @@
 #include <dirent.h>
 
 #include "common/wpa_ctrl.h"
-#include "common.h"
+#include "utils/common.h"
+#include "utils/eloop.h"
+#include "utils/edit.h"
 #include "common/version.h"
 
 
 static const char *hostapd_cli_version =
 "hostapd_cli v" VERSION_STR "\n"
-"Copyright (c) 2004-2010, Jouni Malinen <j%w1.fi@localhost> and contributors";
+"Copyright (c) 2004-2012, Jouni Malinen <j%w1.fi@localhost> and contributors";
 
 
 static const char *hostapd_cli_license =
@@ -89,13 +91,16 @@
 "   sa_query <addr>      send SA Query to a station\n"
 #endif /* CONFIG_IEEE80211W */
 #ifdef CONFIG_WPS
-"   wps_pin <uuid> <pin> [timeout]  add WPS Enrollee PIN (Device Password)\n"
+"   wps_pin <uuid> <pin> [timeout] [addr]  add WPS Enrollee PIN\n"
+"   wps_check_pin <PIN>  verify PIN checksum\n"
 "   wps_pbc              indicate button pushed to initiate PBC\n"
 #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"
+"   wps_config <SSID> <auth> <encr> <key>  configure AP\n"
 #endif /* CONFIG_WPS */
+"   get_config           show current configuration\n"
 "   help                 show this usage help\n"
 "   interface [ifname]   show interfaces/select interface\n"
 "   level <debug level>  change debug level\n"
@@ -110,6 +115,7 @@
 static const char *pid_file = NULL;
 static const char *action_file = NULL;
 static int ping_interval = 5;
+static int interactive = 0;
 
 
 static void usage(void)
@@ -218,6 +224,12 @@
 }
 
 
+static int hostapd_cli_cmd_relog(struct wpa_ctrl *ctrl, int argc, char *argv[])
+{
+       return wpa_ctrl_command(ctrl, "RELOG");
+}
+
+
 static int hostapd_cli_cmd_mib(struct wpa_ctrl *ctrl, int argc, char *argv[])
 {
        return wpa_ctrl_command(ctrl, "MIB");
@@ -352,13 +364,16 @@
 static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc,
                                   char *argv[])
 {
-       char buf[64];
+       char buf[256];
        if (argc < 2) {
                printf("Invalid 'wps_pin' command - at least two arguments, "
                       "UUID and PIN, are required.\n");
                return -1;
        }
-       if (argc > 2)
+       if (argc > 3)
+               snprintf(buf, sizeof(buf), "WPS_PIN %s %s %s %s",
+                        argv[0], argv[1], argv[2], argv[3]);
+       else if (argc > 2)
                snprintf(buf, sizeof(buf), "WPS_PIN %s %s %s",
                         argv[0], argv[1], argv[2]);
        else
@@ -367,6 +382,32 @@
 }
 
 
+static int hostapd_cli_cmd_wps_check_pin(struct wpa_ctrl *ctrl, int argc,
+                                        char *argv[])
+{
+       char cmd[256];
+       int res;
+
+       if (argc != 1 && argc != 2) {
+               printf("Invalid WPS_CHECK_PIN command: needs one argument:\n"
+                      "- PIN to be verified\n");
+               return -1;
+       }
+
+       if (argc == 2)
+               res = os_snprintf(cmd, sizeof(cmd), "WPS_CHECK_PIN %s %s",
+                                 argv[0], argv[1]);
+       else
+               res = os_snprintf(cmd, sizeof(cmd), "WPS_CHECK_PIN %s",
+                                 argv[0]);
+       if (res < 0 || (size_t) res >= sizeof(cmd) - 1) {
+               printf("Too long WPS_CHECK_PIN command.\n");
+               return -1;
+       }
+       return wpa_ctrl_command(ctrl, cmd);
+}
+
+
 static int hostapd_cli_cmd_wps_pbc(struct wpa_ctrl *ctrl, int argc,
                                   char *argv[])
 {
@@ -427,9 +468,80 @@
                snprintf(buf, sizeof(buf), "WPS_AP_PIN %s", argv[0]);
        return wpa_ctrl_command(ctrl, buf);
 }
+
+
+static int hostapd_cli_cmd_wps_config(struct wpa_ctrl *ctrl, int argc,
+                                     char *argv[])
+{
+       char buf[256];
+       char ssid_hex[2 * 32 + 1];
+       char key_hex[2 * 64 + 1];
+       int i;
+
+       if (argc < 1) {
+               printf("Invalid 'wps_config' command - at least two arguments "
+                      "are required.\n");
+               return -1;
+       }
+
+       ssid_hex[0] = '\0';
+       for (i = 0; i < 32; i++) {
+               if (argv[0][i] == '\0')
+                       break;
+               os_snprintf(&ssid_hex[i * 2], 3, "%02x", argv[0][i]);
+       }
+
+       key_hex[0] = '\0';
+       if (argc > 3) {
+               for (i = 0; i < 64; i++) {
+                       if (argv[3][i] == '\0')
+                               break;
+                       os_snprintf(&key_hex[i * 2], 3, "%02x",
+                                   argv[3][i]);
+               }
+       }
+
+       if (argc > 3)
+               snprintf(buf, sizeof(buf), "WPS_CONFIG %s %s %s %s",
+                        ssid_hex, argv[1], argv[2], key_hex);
+       else if (argc > 2)
+               snprintf(buf, sizeof(buf), "WPS_CONFIG %s %s %s",
+                        ssid_hex, argv[1], argv[2]);
+       else
+               snprintf(buf, sizeof(buf), "WPS_CONFIG %s %s",
+                        ssid_hex, argv[1]);
+       return wpa_ctrl_command(ctrl, buf);
+}
 #endif /* CONFIG_WPS */
 
 
+static int hostapd_cli_cmd_ess_disassoc(struct wpa_ctrl *ctrl, int argc,
+                                       char *argv[])
+{
+       char buf[300];
+       int res;
+
+       if (argc < 2) {
+               printf("Invalid 'ess_disassoc' command - two arguments (STA "
+                      "addr and URL) are needed\n");
+               return -1;
+       }
+
+       res = os_snprintf(buf, sizeof(buf), "ESS_DISASSOC %s %s",
+                         argv[0], argv[1]);
+       if (res < 0 || res >= (int) sizeof(buf))
+               return -1;
+       return wpa_ctrl_command(ctrl, buf);
+}
+
+
+static int hostapd_cli_cmd_get_config(struct wpa_ctrl *ctrl, int argc,
+                                     char *argv[])
+{
+       return wpa_ctrl_command(ctrl, "GET_CONFIG");
+}
+
+
 static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, char *cmd,
                                char *addr, size_t addr_len)



Home | Main Index | Thread Index | Old Index