[Midnightbsd-cvs] mports [22948] trunk/security: add wpa supplication (security patched for KRACK
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Thu Oct 19 07:57:32 EDT 2017
Revision: 22948
http://svnweb.midnightbsd.org/mports/?rev=22948
Author: laffer1
Date: 2017-10-19 07:57:31 -0400 (Thu, 19 Oct 2017)
Log Message:
-----------
add wpa supplication (security patched for KRACK
Modified Paths:
--------------
trunk/security/Makefile
Added Paths:
-----------
trunk/security/wpa_supplicant/
trunk/security/wpa_supplicant/Makefile
trunk/security/wpa_supplicant/distinfo
trunk/security/wpa_supplicant/files/
trunk/security/wpa_supplicant/files/Packet32.c
trunk/security/wpa_supplicant/files/Packet32.h
trunk/security/wpa_supplicant/files/ntddndis.h
trunk/security/wpa_supplicant/files/patch-src-l2_packet-l2_packet_freebsd.c
trunk/security/wpa_supplicant/files/patch-src_crypto_crypto__openssl.c
trunk/security/wpa_supplicant/files/patch-src_crypto_tls__openssl.c
trunk/security/wpa_supplicant/files/patch-src_drivers_driver__ndis.c
trunk/security/wpa_supplicant/files/patch-src_wps_wps__upnp.c
trunk/security/wpa_supplicant/files/patch-wpa__supplicant_Makefile
trunk/security/wpa_supplicant/files/patch-wpa__supplicant_main.c
trunk/security/wpa_supplicant/files/patch-wpa__supplicant_scan.c
trunk/security/wpa_supplicant/files/patch-wpa__supplicant_wpa__priv.c
trunk/security/wpa_supplicant/files/patch-wpa__supplicant_wpa__supplicant.c
trunk/security/wpa_supplicant/files/pkg-message.in
trunk/security/wpa_supplicant/pkg-descr
trunk/security/wpa_supplicant/pkg-plist
Modified: trunk/security/Makefile
===================================================================
--- trunk/security/Makefile 2017-10-17 17:35:33 UTC (rev 22947)
+++ trunk/security/Makefile 2017-10-19 11:57:31 UTC (rev 22948)
@@ -138,6 +138,7 @@
SUBDIR += webfwlog
SUBDIR += wipe
SUBDIR += wolfssl
+SUBDIR += wpa_supplicant
SUBDIR += xinetd
SUBDIR += xmlsec1
SUBDIR += xspy
Added: trunk/security/wpa_supplicant/Makefile
===================================================================
--- trunk/security/wpa_supplicant/Makefile (rev 0)
+++ trunk/security/wpa_supplicant/Makefile 2017-10-19 11:57:31 UTC (rev 22948)
@@ -0,0 +1,185 @@
+# $MidnightBSD$
+# $FreeBSD: head/security/wpa_supplicant/Makefile 452263 2017-10-17 05:33:03Z cy $
+
+PORTNAME= wpa_supplicant
+PORTVERSION= 2.6
+PORTREVISION= 2
+CATEGORIES= security net
+MASTER_SITES= https://w1.fi/releases/
+PATCH_SITES= https://w1.fi/security/2017-1/
+PATCHFILES= rebased-v2.6-0001-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch \
+ rebased-v2.6-0002-Prevent-reinstallation-of-an-already-in-use-group-ke.patch \
+ rebased-v2.6-0003-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch \
+ rebased-v2.6-0004-Prevent-installation-of-an-all-zero-TK.patch \
+ rebased-v2.6-0005-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch \
+ rebased-v2.6-0006-TDLS-Reject-TPK-TK-reconfiguration.patch \
+ rebased-v2.6-0007-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch \
+ rebased-v2.6-0008-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch
+PATCH_DIST_STRIP= -p1
+
+MAINTAINER= ports at MidnightBSD.org
+COMMENT= Supplicant (client) for WPA/802.1x protocols
+
+LICENSE= bsd3
+LICENSE_FILE= ${WRKSRC}/README
+
+USE_OPENSSL= yes
+USES= cpe gmake readline
+BUILD_WRKSRC= ${WRKSRC}/wpa_supplicant
+INSTALL_WRKSRC= ${WRKSRC}/src
+CFLAGS+= ${CPPFLAGS} # USES=readline only augments CPPFLAGS and LDFLAGS
+CFLAGS+= -I${OPENSSLINC}
+LDFLAGS+= -L${OPENSSLLIB} -lutil
+MAKE_ENV= V=1
+
+SUB_FILES= pkg-message
+PORTDOCS= README ChangeLog
+
+CFG= ${BUILD_WRKSRC}/.config
+
+OPTIONS_MULTI= DRV EAP
+OPTIONS_MULTI_DRV= BSD WIRED NDIS TEST NONE #ROBOSWITCH
+OPTIONS_MULTI_EAP= TLS PEAP TTLS MD5 MSCHAPv2 GTC LEAP OTP PSK FAST \
+ SIM PWD PAX AKA AKA_PRIME SAKE GPSK TNC IKEv2 EKE
+OPTIONS_DEFINE= WPS WPS_ER WPS_NOREG WPS_NFC PKCS12 SMARTCARD \
+ HT_OVERRIDES VHT_OVERRIDES TLSV12 IEEE80211W \
+ IEEE80211R DEBUG_FILE DEBUG_SYSLOG PRIVSEP \
+ DELAYED_MIC IEEE80211N IEEE80211AC INTERWORKING \
+ HS20 NO_ROAMING P2P TDLS DOCS
+OPTIONS_DEFAULT= BSD WIRED NDIS \
+ TLS PEAP TTLS MD5 MSCHAPv2 GTC LEAP OTP PSK \
+ WPS PKCS12 SMARTCARD IEEE80211R DEBUG_SYSLOG \
+ INTERWORKING HS20
+
+WPS_DESC= Wi-Fi Protected Setup
+WPS_ER_DESC= Enable WPS External Registrar
+WPS_NOREG_DESC= Disable open network credentials when registrar
+WPS_NFC_DESC= Near Field Communication (NFC) configuration
+PKCS12_DESC= PKCS\#12 (PFS) support
+SMARTCARD_DESC= Private key on smartcard support
+HT_OVERRIDES_DESC= Disable HT/HT40, mask MCS rates, etc
+VHT_OVERRIDES_DESC= Disable VHT, mask MCS rates, etc
+TLSV12_DESC= Build with TLS v1.2 instead of TLS v1.0
+IEEE80211AC_DESC= Very High Throughput, AP mode (IEEE 802.11ac)
+IEEE80211N_DESC= High Throughput, AP mode (IEEE 802.11n)
+IEEE80211R_DESC= Fast BSS Transition (IEEE 802.11r-2008)
+IEEE80211W_DESC= Management Frame Protection (IEEE 802.11w)
+DEBUG_FILE_DESC= Support for writing debug log to a file
+DEBUG_SYSLOG_DESC= Send debug messages to syslog instead of stdout
+PRIVSEP_DESC= Privilege separation
+DELAYED_MIC_DESC= Mitigate TKIP attack, random delay on MIC errors
+INTERWORKING_DESC= Improve ext. network interworking (IEEE 802.11u)
+HS20_DESC= Hotspot 2.0
+NO_ROAMING_DESC= Disable roaming
+P2P_DESC= Peer-to-Peer support
+TDLS_DESC= Tunneled Direct Link Setup
+
+DRV_DESC= Driver options
+BSD_DESC= BSD net80211 interface
+NDIS_DESC= Windows NDIS interface
+WIRED_DESC= Wired ethernet interface
+ROBOSWITCH_DESC= Broadcom Roboswitch interface
+TEST_DESC= Development testing interface
+NONE_DESC= The 'no driver' interface, e.g. WPS ER only
+
+EAP_DESC= Extensible Authentication Protocols
+TLS_DESC= Transport Layer Security
+PEAP_DESC= Protected Extensible Authentication Protocol
+TTLS_DESC= Tunneled Transport Layer Security
+MD5_DESC= MD5 hash (deprecated, no key generation)
+MSCHAPv2_DESC= Microsoft CHAP version 2 (RFC 2759)
+GTC_DESC= Generic Token Card
+LEAP_DESC= Lightweight Extensible Authentication Protocol
+OTP_DESC= One-Time Password
+PSK_DESC= Pre-Shared key
+FAST_DESC= Flexible Authentication via Secure Tunneling
+AKA_DESC= Autentication and Key Agreement (UMTS)
+AKA_PRIME_DESC= AKA Prime variant (RFC 5448)
+EKE_DESC= Encrypted Key Exchange
+SIM_DESC= Subscriber Identity Module
+IKEv2_DESC= Internet Key Exchange version 2
+PWD_DESC= Shared password (RFC 5931)
+PAX_DESC= Password Authenticated Exchange
+SAKE_DESC= Shared-Secret Authentication & Key Establishment
+GPSK_DESC= Generalized Pre-Shared Key
+TNC_DESC= Trusted Network Connect
+
+PRIVSEP_PLIST_FILES= sbin/wpa_priv
+
+.include <bsd.port.pre.mk>
+
+.if ${PORT_OPTIONS:MNDIS} && ${PORT_OPTIONS:MPRIVSEP}
+BROKEN= Fails to compile with both NDIS and PRIVSEP
+.endif
+
+.if ${PORT_OPTIONS:MIEEE80211AC} && ${PORT_OPTIONS:MIEEE80211N}
+BROKEN= Fails to compile with both IEEE80211AC and IEEE80211N
+.endif
+
+.if ${PORT_OPTIONS:MSIM} || ${PORT_OPTIONS:MAKA} || ${PORT_OPTIONS:MAKA_PRIME}
+LIB_DEPENDS+= libpcsclite.so:devel/pcsc-lite
+CFLAGS+= -I${LOCALBASE}/include/PCSC
+LDFLAGS+= -L${LOCALBASE}/lib
+.endif
+
+post-patch:
+ @${CP} ${FILESDIR}/Packet32.[ch] ${FILESDIR}/ntddndis.h \
+ ${WRKSRC}/src/utils
+ # Set driver(s)
+.for item in BSD NDIS WIRED ROBOSWITCH TEST NONE
+. if ${PORT_OPTIONS:M${item}}
+ @${ECHO_CMD} CONFIG_DRIVER_${item}=y >> ${CFG}
+. endif
+.endfor
+ # Set EAP protocol(s)
+.for item in MD5 MSCHAPv2 TLS PEAP TTLS FAST GTC OTP PSK PWD PAX LEAP SIM \
+ AKA AKA_PRIME SAKE GPSK TNC IKEv2 EKE
+. if ${PORT_OPTIONS:M${item}}
+ @${ECHO_CMD} CONFIG_EAP_${item:tu}=y >> ${CFG}
+. endif
+.endfor
+.if ${PORT_OPTIONS:MSIM} || ${PORT_OPTIONS:MAKA} || ${PORT_OPTIONS:MAKA_PRIME}
+ @${ECHO_CMD} CONFIG_PCSC=y >> ${CFG}
+.endif
+.for simple in WPS WPS_ER WPS_NFC PKCS12 SMARTCARD HT_OVERRIDES \
+ VHT_OVERRIDES TLSV12 IEEE80211AC IEEE80211N IEEE80211R IEEE80211W \
+ INTERWORKING DEBUG_FILE DEBUG_SYSLOG HS20 NO_ROAMING PRIVSEP P2P TDLS
+. if ${PORT_OPTIONS:M${simple}}
+ @${ECHO_CMD} CONFIG_${simple}=y >> ${CFG}
+. endif
+.endfor
+.for item in READLINE PEERKEY
+ @${ECHO_CMD} CONFIG_${item}=y >> ${CFG}
+.endfor
+.if ${PORT_OPTIONS:MIEEE80211AC} || ${PORT_OPTIONS:MIEEE80211N}
+ @${ECHO_CMD} CONFIG_AP=y >> ${CFG}
+.endif
+.if ${PORT_OPTIONS:MGPSK}
+ # GPSK desired, assume highest SHA desired too
+ @${ECHO_CMD} CONFIG_EAP_GPSK_SHA256=y >> ${CFG}
+.endif
+.if ${PORT_OPTIONS:MWPS_NOREG}
+ @${ECHO_CMD} CONFIG_WPS_REG_DISABLE_OPEN=y >> ${CFG}
+.endif
+.if ${PORT_OPTIONS:MDELAYED_MIC}
+ @${ECHO_CMD} CONFIG_DELAYED_MIC_ERROR_REPORT=y >> ${CFG}
+.endif
+ @${ECHO_CMD} CONFIG_OS=unix >> ${CFG}
+ @${ECHO_CMD} CONFIG_CTRL_IFACE=unix >> ${CFG}
+ @${ECHO_CMD} CONFIG_BACKEND=file >> ${CFG}
+ @${ECHO_CMD} CONFIG_L2_PACKET=freebsd >> ${CFG}
+ @${ECHO_CMD} CONFIG_TLS=openssl >> ${CFG}
+
+do-install:
+ (cd ${BUILD_WRKSRC} && ${INSTALL_PROGRAM} wpa_supplicant wpa_cli \
+ wpa_passphrase ${STAGEDIR}${PREFIX}/sbin)
+ ${INSTALL_DATA} ${BUILD_WRKSRC}/wpa_supplicant.conf \
+ ${STAGEDIR}${PREFIX}/etc/wpa_supplicant.conf.sample
+ @${MKDIR} ${STAGEDIR}${DOCSDIR}
+ (cd ${BUILD_WRKSRC} && \
+ ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR})
+.if ${PORT_OPTIONS:MPRIVSEP}
+ ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/wpa_priv ${STAGEDIR}${PREFIX}/sbin
+.endif
+
+.include <bsd.port.post.mk>
Property changes on: trunk/security/wpa_supplicant/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/security/wpa_supplicant/distinfo
===================================================================
--- trunk/security/wpa_supplicant/distinfo (rev 0)
+++ trunk/security/wpa_supplicant/distinfo 2017-10-19 11:57:31 UTC (rev 22948)
@@ -0,0 +1,19 @@
+TIMESTAMP = 1508183403
+SHA256 (wpa_supplicant-2.6.tar.gz) = b4936d34c4e6cdd44954beba74296d964bc2c9668ecaa5255e499636fe2b1450
+SIZE (wpa_supplicant-2.6.tar.gz) = 2753524
+SHA256 (rebased-v2.6-0001-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch) = 529113cc81256c6178f3c1cf25dd8d3f33e6d770e4a180bd31c6ab7e4917f40b
+SIZE (rebased-v2.6-0001-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch) = 6218
+SHA256 (rebased-v2.6-0002-Prevent-reinstallation-of-an-already-in-use-group-ke.patch) = d86d47ab74170f3648b45b91bce780949ca92b09ab43df065178850ec0c335d7
+SIZE (rebased-v2.6-0002-Prevent-reinstallation-of-an-already-in-use-group-ke.patch) = 7883
+SHA256 (rebased-v2.6-0003-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch) = d4535e36739a0cc7f3585e6bcba3c0bb8fc67cb3e729844e448c5dc751f47e81
+SIZE (rebased-v2.6-0003-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch) = 6861
+SHA256 (rebased-v2.6-0004-Prevent-installation-of-an-all-zero-TK.patch) = 793a54748161b5af430dd9de4a1988d19cb8e85ab29bc2340f886b0297cee20b
+SIZE (rebased-v2.6-0004-Prevent-installation-of-an-all-zero-TK.patch) = 2566
+SHA256 (rebased-v2.6-0005-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch) = 147c8abe07606905d16404fb2d2c8849796ca7c85ed8673c09bb50038bcdeb9e
+SIZE (rebased-v2.6-0005-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch) = 1949
+SHA256 (rebased-v2.6-0006-TDLS-Reject-TPK-TK-reconfiguration.patch) = 596d4d3b63ea859ed7ea9791b3a21cb11b6173b04c0a14a2afa47edf1666afa6
+SIZE (rebased-v2.6-0006-TDLS-Reject-TPK-TK-reconfiguration.patch) = 4309
+SHA256 (rebased-v2.6-0007-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch) = c5a17af84aec2d88c56ce0da2d6945be398fe7cab5c0c340deb30973900c2736
+SIZE (rebased-v2.6-0007-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch) = 1649
+SHA256 (rebased-v2.6-0008-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch) = c8840d857b9432f3b488113c85c1ff5d4a4b8d81078b7033388dae1e990843b1
+SIZE (rebased-v2.6-0008-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch) = 2750
Property changes on: trunk/security/wpa_supplicant/distinfo
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/security/wpa_supplicant/files/Packet32.c
===================================================================
--- trunk/security/wpa_supplicant/files/Packet32.c (rev 0)
+++ trunk/security/wpa_supplicant/files/Packet32.c 2017-10-19 11:57:31 UTC (rev 22948)
@@ -0,0 +1,366 @@
+/*-
+ * Copyright (c) 2005
+ * Bill Paul <wpaul at windriver.com>. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Bill Paul.
+ * 4. Neither the name of the author nor the names of any co-contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file implements a small portion of the Winpcap API for the
+ * Windows NDIS interface in wpa_supplicant. It provides just enough
+ * routines to fool wpa_supplicant into thinking it's really running
+ * in a Windows environment.
+ */
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <sys/errno.h>
+#include <sys/sysctl.h>
+#include <sys/fcntl.h>
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_var.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <net/route.h>
+
+#ifdef __FreeBSD__
+#include <net80211/ieee80211_ioctl.h>
+#endif
+#ifdef __DragonFly__
+#include <netproto/802_11/ieee80211_ioctl.h>
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <pcap.h>
+
+#include "Packet32.h"
+
+#define OID_802_11_ADD_KEY 0x0d01011D
+
+typedef ULONGLONG NDIS_802_11_KEY_RSC;
+typedef UCHAR NDIS_802_11_MAC_ADDRESS[6];
+
+typedef struct NDIS_802_11_KEY {
+ ULONG Length;
+ ULONG KeyIndex;
+ ULONG KeyLength;
+ NDIS_802_11_MAC_ADDRESS BSSID;
+ NDIS_802_11_KEY_RSC KeyRSC;
+ UCHAR KeyMaterial[1];
+} NDIS_802_11_KEY;
+
+typedef struct NDIS_802_11_KEY_COMPAT {
+ ULONG Length;
+ ULONG KeyIndex;
+ ULONG KeyLength;
+ NDIS_802_11_MAC_ADDRESS BSSID;
+ UCHAR Pad[6]; /* Make struct layout match Windows. */
+ NDIS_802_11_KEY_RSC KeyRSC;
+#ifdef notdef
+ UCHAR KeyMaterial[1];
+#endif
+} NDIS_802_11_KEY_COMPAT;
+
+#define TRUE 1
+#define FALSE 0
+
+struct adapter {
+ int socket;
+ char name[IFNAMSIZ];
+ int prev_roaming;
+};
+
+PCHAR
+PacketGetVersion(void)
+{
+ return("FreeBSD WinPcap compatibility shim v1.0");
+}
+
+void *
+PacketOpenAdapter(CHAR *iface)
+{
+ struct adapter *a;
+ int s;
+ int ifflags;
+ struct ifreq ifr;
+ struct ieee80211req ireq;
+
+ s = socket(PF_INET, SOCK_DGRAM, 0);
+
+ if (s == -1)
+ return(NULL);
+
+ a = malloc(sizeof(struct adapter));
+ if (a == NULL)
+ return(NULL);
+
+ a->socket = s;
+ if (strncmp(iface, "\\Device\\NPF_", 12) == 0)
+ iface += 12;
+ else if (strncmp(iface, "\\DEVICE\\", 8) == 0)
+ iface += 8;
+ snprintf(a->name, IFNAMSIZ, "%s", iface);
+
+ /* Turn off net80211 roaming */
+ bzero((char *)&ireq, sizeof(ireq));
+ strncpy(ireq.i_name, iface, sizeof (ifr.ifr_name));
+ ireq.i_type = IEEE80211_IOC_ROAMING;
+ if (ioctl(a->socket, SIOCG80211, &ireq) == 0) {
+ a->prev_roaming = ireq.i_val;
+ ireq.i_val = IEEE80211_ROAMING_MANUAL;
+ if (ioctl(a->socket, SIOCS80211, &ireq) < 0)
+ fprintf(stderr,
+ "Could not set IEEE80211_ROAMING_MANUAL\n");
+ }
+
+ bzero((char *)&ifr, sizeof(ifr));
+ strncpy(ifr.ifr_name, iface, sizeof (ifr.ifr_name));
+ if (ioctl(a->socket, SIOCGIFFLAGS, (caddr_t)&ifr) < 0) {
+ free(a);
+ close(s);
+ return(NULL);
+ }
+ ifr.ifr_flags |= IFF_UP;
+ if (ioctl(a->socket, SIOCSIFFLAGS, (caddr_t)&ifr) < 0) {
+ free(a);
+ close(s);
+ return(NULL);
+ }
+
+ return(a);
+}
+
+int
+PacketRequest(void *iface, BOOLEAN set, PACKET_OID_DATA *oid)
+{
+ struct adapter *a;
+ uint32_t retval;
+ struct ifreq ifr;
+ NDIS_802_11_KEY *old;
+ NDIS_802_11_KEY_COMPAT *new;
+ PACKET_OID_DATA *o = NULL;
+
+ if (iface == NULL)
+ return(-1);
+
+ a = iface;
+ bzero((char *)&ifr, sizeof(ifr));
+
+ /*
+ * This hack is necessary to work around a difference
+ * betwee the GNU C and Microsoft C compilers. The NDIS_802_11_KEY
+ * structure has a uint64_t in it, right after an array of
+ * chars. The Microsoft compiler inserts padding right before
+ * the 64-bit value to align it on a 64-bit boundary, but
+ * GCC only aligns it on a 32-bit boundary. Trying to pass
+ * the GCC-formatted structure to an NDIS binary driver
+ * fails because some of the fields appear to be at the
+ * wrong offsets.
+ *
+ * To get around this, if we detect someone is trying to do
+ * a set operation on OID_802_11_ADD_KEY, we shuffle the data
+ * into a properly padded structure and pass that into the
+ * driver instead. This allows the driver_ndis.c code supplied
+ * with wpa_supplicant to work unmodified.
+ */
+
+ if (set == TRUE && oid->Oid == OID_802_11_ADD_KEY) {
+ old = (NDIS_802_11_KEY *)&oid->Data;
+ o = malloc(sizeof(PACKET_OID_DATA) +
+ sizeof(NDIS_802_11_KEY_COMPAT) + old->KeyLength);
+ if (o == NULL)
+ return(0);
+ bzero((char *)o, sizeof(PACKET_OID_DATA) +
+ sizeof(NDIS_802_11_KEY_COMPAT) + old->KeyLength);
+ o->Oid = oid->Oid;
+ o->Length = sizeof(NDIS_802_11_KEY_COMPAT) + old->KeyLength;
+ new = (NDIS_802_11_KEY_COMPAT *)&o->Data;
+ new->KeyRSC = old->KeyRSC;
+ new->Length = o->Length;
+ new->KeyIndex = old->KeyIndex;
+ new->KeyLength = old->KeyLength;
+ bcopy(old->BSSID, new->BSSID, sizeof(NDIS_802_11_MAC_ADDRESS));
+ bcopy(old->KeyMaterial, (char *)new +
+ sizeof(NDIS_802_11_KEY_COMPAT), new->KeyLength);
+ ifr.ifr_data = (caddr_t)o;
+ } else
+ ifr.ifr_data = (caddr_t)oid;
+
+ strlcpy(ifr.ifr_name, a->name, sizeof(ifr.ifr_name));
+
+ if (set == TRUE)
+ retval = ioctl(a->socket, SIOCSDRVSPEC, &ifr);
+ else
+ retval = ioctl(a->socket, SIOCGDRVSPEC, &ifr);
+
+ if (o != NULL)
+ free(o);
+
+ if (retval)
+ return(0);
+
+ return(1);
+}
+
+int
+PacketGetAdapterNames(CHAR *namelist, ULONG *len)
+{
+ int mib[6];
+ size_t needed;
+ struct if_msghdr *ifm;
+ struct sockaddr_dl *sdl;
+ char *buf, *lim, *next;
+ char *plist;
+ int spc;
+ int i, ifcnt = 0;
+
+ plist = namelist;
+ spc = 0;
+
+ bzero(plist, *len);
+
+ needed = 0;
+ mib[0] = CTL_NET;
+ mib[1] = PF_ROUTE;
+ mib[2] = 0; /* protocol */
+ mib[3] = 0; /* wildcard address family */
+ mib[4] = NET_RT_IFLIST;
+ mib[5] = 0; /* no flags */
+
+ if (sysctl (mib, 6, NULL, &needed, NULL, 0) < 0)
+ return(FALSE);
+
+ buf = malloc (needed);
+ if (buf == NULL)
+ return(FALSE);
+
+ if (sysctl (mib, 6, buf, &needed, NULL, 0) < 0) {
+ free(buf);
+ return(FALSE);
+ }
+
+ lim = buf + needed;
+
+ /* Generate interface name list. */
+
+ next = buf;
+ while (next < lim) {
+ ifm = (struct if_msghdr *)next;
+ if (ifm->ifm_type == RTM_IFINFO) {
+ sdl = (struct sockaddr_dl *)(ifm + 1);
+ if (strnstr(sdl->sdl_data, "wlan", sdl->sdl_nlen)) {
+ if ((spc + sdl->sdl_nlen) > *len) {
+ free(buf);
+ return(FALSE);
+ }
+ strncpy(plist, sdl->sdl_data, sdl->sdl_nlen);
+ plist += (sdl->sdl_nlen + 1);
+ spc += (sdl->sdl_nlen + 1);
+ ifcnt++;
+ }
+ }
+ next += ifm->ifm_msglen;
+ }
+
+
+ /* Insert an extra "" as a spacer */
+
+ plist++;
+ spc++;
+
+ /*
+ * Now generate the interface description list. There
+ * must be a unique description for each interface, and
+ * they have to match what the ndis_events program will
+ * feed in later. To keep this simple, we just repeat
+ * the interface list over again.
+ */
+
+ next = buf;
+ while (next < lim) {
+ ifm = (struct if_msghdr *)next;
+ if (ifm->ifm_type == RTM_IFINFO) {
+ sdl = (struct sockaddr_dl *)(ifm + 1);
+ if (strnstr(sdl->sdl_data, "wlan", sdl->sdl_nlen)) {
+ if ((spc + sdl->sdl_nlen) > *len) {
+ free(buf);
+ return(FALSE);
+ }
+ strncpy(plist, sdl->sdl_data, sdl->sdl_nlen);
+ plist += (sdl->sdl_nlen + 1);
+ spc += (sdl->sdl_nlen + 1);
+ ifcnt++;
+ }
+ }
+ next += ifm->ifm_msglen;
+ }
+
+ free (buf);
+
+ *len = spc + 1;
+
+ return(TRUE);
+}
+
+void
+PacketCloseAdapter(void *iface)
+{
+ struct adapter *a;
+ struct ifreq ifr;
+ struct ieee80211req ireq;
+
+ if (iface == NULL)
+ return;
+
+ a = iface;
+
+ /* Reset net80211 roaming */
+ bzero((char *)&ireq, sizeof(ireq));
+ strncpy(ireq.i_name, a->name, sizeof (ifr.ifr_name));
+ ireq.i_type = IEEE80211_IOC_ROAMING;
+ ireq.i_val = a->prev_roaming;
+ ioctl(a->socket, SIOCS80211, &ireq);
+
+ bzero((char *)&ifr, sizeof(ifr));
+ strncpy(ifr.ifr_name, a->name, sizeof (ifr.ifr_name));
+ ioctl(a->socket, SIOCGIFFLAGS, (caddr_t)&ifr);
+ ifr.ifr_flags &= ~IFF_UP;
+ ioctl(a->socket, SIOCSIFFLAGS, (caddr_t)&ifr);
+ close(a->socket);
+ free(a);
+
+ return;
+}
Property changes on: trunk/security/wpa_supplicant/files/Packet32.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/security/wpa_supplicant/files/Packet32.h
===================================================================
--- trunk/security/wpa_supplicant/files/Packet32.h (rev 0)
+++ trunk/security/wpa_supplicant/files/Packet32.h 2017-10-19 11:57:31 UTC (rev 22948)
@@ -0,0 +1,65 @@
+/*-
+ * Copyright (c) 2005
+ * Bill Paul <wpaul at windriver.com>. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Bill Paul.
+ * 4. Neither the name of the author nor the names of any co-contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _PACKET32_H_
+#define _PACKET32_H_
+
+#include <sys/types.h>
+#include <ntddndis.h>
+
+struct PACKET_OID_DATA {
+ uint32_t Oid;
+ uint32_t Length;
+ uint8_t Data[1];
+};
+
+
+typedef struct PACKET_OID_DATA PACKET_OID_DATA;
+
+extern PCHAR PacketGetVersion(void);
+extern void *PacketOpenAdapter(CHAR *);
+extern int PacketRequest(void *, BOOLEAN, PACKET_OID_DATA *);
+extern int PacketGetAdapterNames(CHAR *, ULONG *);
+extern void PacketCloseAdapter(void *);
+
+/*
+ * This is for backwards compatibility on FreeBSD 5.
+ */
+
+#ifndef SIOCGDRVSPEC
+#define SIOCSDRVSPEC _IOW('i', 123, struct ifreq) /* set driver-specific
+ parameters */
+#define SIOCGDRVSPEC _IOWR('i', 123, struct ifreq) /* get driver-specific
+ parameters */
+#endif
+
+#endif /* _PACKET32_H_ */
Property changes on: trunk/security/wpa_supplicant/files/Packet32.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/security/wpa_supplicant/files/ntddndis.h
===================================================================
--- trunk/security/wpa_supplicant/files/ntddndis.h (rev 0)
+++ trunk/security/wpa_supplicant/files/ntddndis.h 2017-10-19 11:57:31 UTC (rev 22948)
@@ -0,0 +1,28 @@
+#ifndef _NTDDNDIS_H_
+#define _NTDDNDIS_H_
+
+/*
+ * Fake up some of the Windows type definitions so that the NDIS
+ * interface module in wpa_supplicant will build.
+ */
+
+#define ULONG uint32_t
+#define USHORT uint16_t
+#define UCHAR uint8_t
+#define LONG int32_t
+#define SHORT int16_t
+#define CHAR int8_t
+#define ULONGLONG uint64_t
+#define LONGLONG int64_t
+#define BOOLEAN uint8_t
+typedef void * LPADAPTER;
+typedef char * PTSTR;
+typedef char * PCHAR;
+
+#define TRUE 1
+#define FALSE 0
+
+#define OID_802_3_CURRENT_ADDRESS 0x01010102
+#define OID_802_3_MULTICAST_LIST 0x01010103
+
+#endif /* _NTDDNDIS_H_ */
Property changes on: trunk/security/wpa_supplicant/files/ntddndis.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/security/wpa_supplicant/files/patch-src-l2_packet-l2_packet_freebsd.c
===================================================================
--- trunk/security/wpa_supplicant/files/patch-src-l2_packet-l2_packet_freebsd.c (rev 0)
+++ trunk/security/wpa_supplicant/files/patch-src-l2_packet-l2_packet_freebsd.c 2017-10-19 11:57:31 UTC (rev 22948)
@@ -0,0 +1,14 @@
+--- src/l2_packet/l2_packet_freebsd.c.orig 2015-03-15 17:30:39 UTC
++++ src/l2_packet/l2_packet_freebsd.c
+@@ -8,7 +8,10 @@
+ */
+
+ #include "includes.h"
+-#if defined(__APPLE__) || defined(__GLIBC__)
++#if defined(__FreeBSD__) \
++ || defined(__DragonFly__) \
++ || defined(__APPLE__) \
++ || defined(__GLIBC__)
+ #include <net/bpf.h>
+ #endif /* __APPLE__ */
+ #include <pcap.h>
Property changes on: trunk/security/wpa_supplicant/files/patch-src-l2_packet-l2_packet_freebsd.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/security/wpa_supplicant/files/patch-src_crypto_crypto__openssl.c
===================================================================
--- trunk/security/wpa_supplicant/files/patch-src_crypto_crypto__openssl.c (rev 0)
+++ trunk/security/wpa_supplicant/files/patch-src_crypto_crypto__openssl.c 2017-10-19 11:57:31 UTC (rev 22948)
@@ -0,0 +1,20 @@
+--- src/crypto/crypto_openssl.c.orig 2016-11-02 18:04:18 UTC
++++ src/crypto/crypto_openssl.c
+@@ -611,7 +611,7 @@ void crypto_cipher_deinit(struct crypto_
+
+ void * dh5_init(struct wpabuf **priv, struct wpabuf **publ)
+ {
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ DH *dh;
+ struct wpabuf *pubkey = NULL, *privkey = NULL;
+ size_t publen, privlen;
+@@ -712,7 +712,7 @@ err:
+
+ void * dh5_init_fixed(const struct wpabuf *priv, const struct wpabuf *publ)
+ {
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ DH *dh;
+
+ dh = DH_new();
Property changes on: trunk/security/wpa_supplicant/files/patch-src_crypto_crypto__openssl.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/security/wpa_supplicant/files/patch-src_crypto_tls__openssl.c
===================================================================
--- trunk/security/wpa_supplicant/files/patch-src_crypto_tls__openssl.c (rev 0)
+++ trunk/security/wpa_supplicant/files/patch-src_crypto_tls__openssl.c 2017-10-19 11:57:31 UTC (rev 22948)
@@ -0,0 +1,29 @@
+--- src/crypto/tls_openssl.c.orig 2016-11-02 18:46:25 UTC
++++ src/crypto/tls_openssl.c
+@@ -919,7 +919,7 @@ void * tls_init(const struct tls_config
+ }
+ #endif /* OPENSSL_FIPS */
+ #endif /* CONFIG_FIPS */
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ SSL_load_error_strings();
+ SSL_library_init();
+ #ifndef OPENSSL_NO_SHA256
+@@ -1043,7 +1043,7 @@ void tls_deinit(void *ssl_ctx)
+
+ tls_openssl_ref_count--;
+ if (tls_openssl_ref_count == 0) {
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ #ifndef OPENSSL_NO_ENGINE
+ ENGINE_cleanup();
+ #endif /* OPENSSL_NO_ENGINE */
+@@ -3976,7 +3976,7 @@ int tls_connection_set_params(void *tls_
+ engine_id = "pkcs11";
+
+ #if defined(EAP_FAST) || defined(EAP_FAST_DYNAMIC) || defined(EAP_SERVER_FAST)
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ if (params->flags & TLS_CONN_EAP_FAST) {
+ wpa_printf(MSG_DEBUG,
+ "OpenSSL: Use TLSv1_method() for EAP-FAST");
Property changes on: trunk/security/wpa_supplicant/files/patch-src_crypto_tls__openssl.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/security/wpa_supplicant/files/patch-src_drivers_driver__ndis.c
===================================================================
--- trunk/security/wpa_supplicant/files/patch-src_drivers_driver__ndis.c (rev 0)
+++ trunk/security/wpa_supplicant/files/patch-src_drivers_driver__ndis.c 2017-10-19 11:57:31 UTC (rev 22948)
@@ -0,0 +1,28 @@
+--- src/drivers/driver_ndis.c.orig 2015-03-15 17:30:39 UTC
++++ src/drivers/driver_ndis.c
+@@ -2110,7 +2110,11 @@ static int wpa_driver_ndis_get_names(str
+ dlen = dpos - desc;
+ else
+ dlen = os_strlen(desc);
+- drv->adapter_desc = dup_binstr(desc, dlen);
++ drv->adapter_desc = os_malloc(dlen + 1);
++ if (drv->adapter_desc) {
++ os_memcpy(drv->adapter_desc, desc, dlen);
++ drv->adapter_desc[dlen] = '\0';
++ }
+ os_free(b);
+ if (drv->adapter_desc == NULL)
+ return -1;
+@@ -2278,7 +2282,11 @@ static int wpa_driver_ndis_get_names(str
+ } else {
+ dlen = os_strlen(desc[i]);
+ }
+- drv->adapter_desc = dup_binstr(desc[i], dlen);
++ drv->adapter_desc = os_malloc(dlen + 1);
++ if (drv->adapter_desc) {
++ os_memcpy(drv->adapter_desc, desc[i], dlen);
++ drv->adapter_desc[dlen] = '\0';
++ }
+ os_free(names);
+ if (drv->adapter_desc == NULL)
+ return -1;
Property changes on: trunk/security/wpa_supplicant/files/patch-src_drivers_driver__ndis.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/security/wpa_supplicant/files/patch-src_wps_wps__upnp.c
===================================================================
--- trunk/security/wpa_supplicant/files/patch-src_wps_wps__upnp.c (rev 0)
+++ trunk/security/wpa_supplicant/files/patch-src_wps_wps__upnp.c 2017-10-19 11:57:31 UTC (rev 22948)
@@ -0,0 +1,22 @@
+--- src/wps/wps_upnp.c.orig 2015-03-15 17:30:39 UTC
++++ src/wps/wps_upnp.c
+@@ -837,7 +837,8 @@ fail:
+ }
+
+
+-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
++ || defined(__DragonFly__)
+ #include <sys/sysctl.h>
+ #include <net/route.h>
+ #include <net/if_dl.h>
+@@ -924,7 +925,8 @@ int get_netif_info(const char *net_if, u
+ goto fail;
+ }
+ os_memcpy(mac, req.ifr_addr.sa_data, 6);
+-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
++#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
++ || defined(__DragonFly__)
+ if (eth_get(net_if, mac) < 0) {
+ wpa_printf(MSG_ERROR, "WPS UPnP: Failed to get MAC address");
+ goto fail;
Property changes on: trunk/security/wpa_supplicant/files/patch-src_wps_wps__upnp.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/security/wpa_supplicant/files/patch-wpa__supplicant_Makefile
===================================================================
--- trunk/security/wpa_supplicant/files/patch-wpa__supplicant_Makefile (rev 0)
+++ trunk/security/wpa_supplicant/files/patch-wpa__supplicant_Makefile 2017-10-19 11:57:31 UTC (rev 22948)
@@ -0,0 +1,17 @@
+--- wpa_supplicant/Makefile.orig 2015-03-15 17:30:39 UTC
++++ wpa_supplicant/Makefile
+@@ -99,6 +99,14 @@ OBJS += ../src/utils/os_$(CONFIG_OS).o
+ OBJS_p += ../src/utils/os_$(CONFIG_OS).o
+ OBJS_c += ../src/utils/os_$(CONFIG_OS).o
+
++ifdef CONFIG_DRIVER_NDIS
++OBJS += ../src/utils/Packet32.o
++ifdef CONFIG_PRIVSEP
++OBJS += ../src/drivers/driver_ndis.o
++endif
++OBJS_priv += ../src/utils/Packet32.o
++endif
++
+ ifdef CONFIG_WPA_TRACE
+ CFLAGS += -DWPA_TRACE
+ OBJS += ../src/utils/trace.o
Property changes on: trunk/security/wpa_supplicant/files/patch-wpa__supplicant_Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/security/wpa_supplicant/files/patch-wpa__supplicant_main.c
===================================================================
--- trunk/security/wpa_supplicant/files/patch-wpa__supplicant_main.c (rev 0)
+++ trunk/security/wpa_supplicant/files/patch-wpa__supplicant_main.c 2017-10-19 11:57:31 UTC (rev 22948)
@@ -0,0 +1,33 @@
+--- wpa_supplicant/main.c.orig 2016-11-05 20:56:30 UTC
++++ wpa_supplicant/main.c
+@@ -66,7 +66,7 @@ static void usage(void)
+ " -c = Configuration file\n"
+ " -C = ctrl_interface parameter (only used if -c is not)\n"
+ " -d = increase debugging verbosity (-dd even more)\n"
+- " -D = driver name (can be multiple drivers: nl80211,wext)\n"
++ " -D = driver name (can be multiple drivers: bsd,wired)\n"
+ " -e = entropy file\n"
+ #ifdef CONFIG_DEBUG_FILE
+ " -f = log output to debug file instead of stdout\n"
+@@ -105,8 +105,7 @@ static void usage(void)
+ " -W = wait for a control interface monitor before starting\n");
+
+ printf("example:\n"
+- " wpa_supplicant -D%s -iwlan0 -c/etc/wpa_supplicant.conf\n",
+- wpa_drivers[0] ? wpa_drivers[0]->name : "nl80211");
++ " wpa_supplicant -Dbsd -iwlan0 -c/etc/wpa_supplicant.conf\n");
+ #endif /* CONFIG_NO_STDOUT_DEBUG */
+ }
+
+@@ -199,6 +198,11 @@ int main(int argc, char *argv[])
+
+ wpa_supplicant_fd_workaround(1);
+
++#ifdef CONFIG_DRIVER_NDIS
++ void driver_ndis_init_ops(void);
++ driver_ndis_init_ops();
++#endif /* CONFIG_DRIVER_NDIS */
++
+ for (;;) {
+ c = getopt(argc, argv,
+ "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuvW");
Property changes on: trunk/security/wpa_supplicant/files/patch-wpa__supplicant_main.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/security/wpa_supplicant/files/patch-wpa__supplicant_scan.c
===================================================================
--- trunk/security/wpa_supplicant/files/patch-wpa__supplicant_scan.c (rev 0)
+++ trunk/security/wpa_supplicant/files/patch-wpa__supplicant_scan.c 2017-10-19 11:57:31 UTC (rev 22948)
@@ -0,0 +1,32 @@
+--- wpa_supplicant/scan.c.orig 2015-09-27 19:02:05 UTC
++++ wpa_supplicant/scan.c
+@@ -1657,7 +1657,7 @@ struct wpabuf * wpa_scan_get_vendor_ie_m
+ * better. */
+ static int wpa_scan_result_compar(const void *a, const void *b)
+ {
+-#define MIN(a,b) a < b ? a : b
++#define MINAB(a,b) a < b ? a : b
+ struct wpa_scan_res **_wa = (void *) a;
+ struct wpa_scan_res **_wb = (void *) b;
+ struct wpa_scan_res *wa = *_wa;
+@@ -1686,9 +1686,9 @@ static int wpa_scan_result_compar(const
+
+ if (wa->flags & wb->flags & WPA_SCAN_LEVEL_DBM) {
+ snr_a_full = wa->snr;
+- snr_a = MIN(wa->snr, GREAT_SNR);
++ snr_a = MINAB(wa->snr, GREAT_SNR);
+ snr_b_full = wb->snr;
+- snr_b = MIN(wb->snr, GREAT_SNR);
++ snr_b = MINAB(wb->snr, GREAT_SNR);
+ } else {
+ /* Level is not in dBm, so we can't calculate
+ * SNR. Just use raw level (units unknown). */
+@@ -1711,7 +1711,7 @@ static int wpa_scan_result_compar(const
+ if (snr_b_full == snr_a_full)
+ return wb->qual - wa->qual;
+ return snr_b_full - snr_a_full;
+-#undef MIN
++#undef MINAB
+ }
+
+
Property changes on: trunk/security/wpa_supplicant/files/patch-wpa__supplicant_scan.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/security/wpa_supplicant/files/patch-wpa__supplicant_wpa__priv.c
===================================================================
--- trunk/security/wpa_supplicant/files/patch-wpa__supplicant_wpa__priv.c (rev 0)
+++ trunk/security/wpa_supplicant/files/patch-wpa__supplicant_wpa__priv.c 2017-10-19 11:57:31 UTC (rev 22948)
@@ -0,0 +1,28 @@
+--- wpa_supplicant/wpa_priv.c.orig 2015-03-15 17:30:39 UTC
++++ wpa_supplicant/wpa_priv.c
+@@ -952,6 +952,7 @@ static void usage(void)
+ int main(int argc, char *argv[])
+ {
+ int c, i;
++ int eloop_initialized = 0;
+ int ret = -1;
+ char *pid_file = NULL;
+ int daemonize = 0;
+@@ -997,6 +998,7 @@ int main(int argc, char *argv[])
+ wpa_printf(MSG_ERROR, "Failed to initialize event loop");
+ goto out;
+ }
++ else eloop_initialized = 1;
+
+ for (i = optind; i < argc; i++) {
+ wpa_printf(MSG_DEBUG, "Adding driver:interface %s", argv[i]);
+@@ -1023,7 +1025,8 @@ out:
+ wpa_priv_interface_deinit(prev);
+ }
+
+- eloop_destroy();
++ if (eloop_initialized)
++ eloop_destroy();
+
+ os_daemonize_terminate(pid_file);
+ os_free(pid_file);
Property changes on: trunk/security/wpa_supplicant/files/patch-wpa__supplicant_wpa__priv.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/security/wpa_supplicant/files/patch-wpa__supplicant_wpa__supplicant.c
===================================================================
--- trunk/security/wpa_supplicant/files/patch-wpa__supplicant_wpa__supplicant.c (rev 0)
+++ trunk/security/wpa_supplicant/files/patch-wpa__supplicant_wpa__supplicant.c 2017-10-19 11:57:31 UTC (rev 22948)
@@ -0,0 +1,11 @@
+--- wpa_supplicant/wpa_supplicant.c.orig 2015-03-15 17:30:39 UTC
++++ wpa_supplicant/wpa_supplicant.c
+@@ -4506,7 +4506,7 @@ struct wpa_global * wpa_supplicant_init(
+ if (params == NULL)
+ return NULL;
+
+-#ifdef CONFIG_DRIVER_NDIS
++#ifdef XXXCONFIG_DRIVER_NDIS
+ {
+ void driver_ndis_init_ops(void);
+ driver_ndis_init_ops();
Property changes on: trunk/security/wpa_supplicant/files/patch-wpa__supplicant_wpa__supplicant.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/security/wpa_supplicant/files/pkg-message.in
===================================================================
--- trunk/security/wpa_supplicant/files/pkg-message.in (rev 0)
+++ trunk/security/wpa_supplicant/files/pkg-message.in 2017-10-19 11:57:31 UTC (rev 22948)
@@ -0,0 +1,6 @@
+To use the ports version of WPA Supplicant instead of the base, add:
+
+ wpa_supplicant_program="%%PREFIX%%/sbin/wpa_supplicant"
+
+to /etc/rc.conf
+
Property changes on: trunk/security/wpa_supplicant/files/pkg-message.in
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/security/wpa_supplicant/pkg-descr
===================================================================
--- trunk/security/wpa_supplicant/pkg-descr (rev 0)
+++ trunk/security/wpa_supplicant/pkg-descr 2017-10-19 11:57:31 UTC (rev 22948)
@@ -0,0 +1,14 @@
+wpa_supplicant is a client (supplicant) with support for WPA and WPA2
+(IEEE 802.11i / RSN). It is suitable for both desktop/laptop computers and
+embedded systems. Supplicant is the IEEE 802.1X/WPA component that is used
+in the client stations. It implements key negotiation with a WPA
+Authenticator and it controls the roaming and IEEE 802.11 authentication/
+association of the wlan driver.
+
+wpa_supplicant is designed to be a "daemon" program that runs in the
+background and acts as the backend component controlling the wireless
+connection. wpa_supplicant supports separate frontend programs and a
+text-based frontend (wpa_cli) and a GUI (wpa_gui) are included with
+wpa_supplicant.
+
+WWW: http://w1.fi/wpa_supplicant/
Property changes on: trunk/security/wpa_supplicant/pkg-descr
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/security/wpa_supplicant/pkg-plist
===================================================================
--- trunk/security/wpa_supplicant/pkg-plist (rev 0)
+++ trunk/security/wpa_supplicant/pkg-plist 2017-10-19 11:57:31 UTC (rev 22948)
@@ -0,0 +1,4 @@
+sbin/wpa_supplicant
+sbin/wpa_passphrase
+sbin/wpa_cli
+ at sample etc/wpa_supplicant.conf.sample
Property changes on: trunk/security/wpa_supplicant/pkg-plist
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
More information about the Midnightbsd-cvs
mailing list