Add security/wpa_supplicant, a fully-featured implementation of an

IEEE 802.1X supplicant. This port does not support the wireless
WPA/WPA functionality yet, because it is missing in the OpenBSD
net80211 kernel implementation. Successfully tested with 802.1X on
ProCurve switches with OpenBSD running freeradius in the backend.

This port is based on work by Jussi Salzwedel, thanks!

ok aanriot@
This commit is contained in:
reyk 2007-07-01 19:50:57 +00:00
parent bfb9a0d11b
commit 16591b9b32
10 changed files with 198 additions and 0 deletions

View File

@ -0,0 +1,47 @@
# $OpenBSD: Makefile,v 1.1 2007/07/01 19:50:57 reyk Exp $
COMMENT= IEEE 802.1X supplicant
DISTNAME= wpa_supplicant-0.5.8
CATEGORIES= security net
HOMEPAGE= http://hostap.epitest.fi/wpa_supplicant/
MAINTAINER= Reyk Floeter <reyk@openbsd.org>
# Dual BSD/GPL
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
WANTLIB= c ssl crypto pcap
MASTER_SITES= http://hostap.epitest.fi/releases/
USE_GMAKE= Yes
NO_REGRESS= Yes
MAN5= wpa_supplicant.conf.5
MAN8= wpa_background.8 wpa_cli.8 wpa_passphrase.8 wpa_supplicant.8
EXAMPLEDIR= ${PREFIX}/share/examples/wpa_supplicant
post-install:
.for m in ${MAN5}
${INSTALL_MAN} ${WRKBUILD}/doc/docbook/${m} \
${PREFIX}/man/man5/
.endfor
.for n in ${MAN8}
${INSTALL_MAN} ${WRKBUILD}/doc/docbook/${n} \
${PREFIX}/man/man8/
.endfor
${INSTALL_DATA_DIR} ${EXAMPLEDIR}
${INSTALL_DATA} ${WRKBUILD}/wpa_supplicant.conf \
${EXAMPLEDIR}/wpa_supplicant.conf.dist
${INSTALL_DATA} ${FILESDIR}/wpa_supplicant.conf \
${EXAMPLEDIR}/wpa_supplicant.conf
.include <bsd.port.mk>

View File

@ -0,0 +1,5 @@
MD5 (wpa_supplicant-0.5.8.tar.gz) = e7IvK83u1Us/tUB9bYvJuw==
RMD160 (wpa_supplicant-0.5.8.tar.gz) = MizVy6iv/+g0O9jFdOiUH9WV260=
SHA1 (wpa_supplicant-0.5.8.tar.gz) = Q0VF+vR1gERin1dNgpOVEb6N6ws=
SHA256 (wpa_supplicant-0.5.8.tar.gz) = L5dV4uP5bSY4CFfvlb53Zebidva1MZTHBjPAJ0hdZ/A=
SIZE (wpa_supplicant-0.5.8.tar.gz) = 714467

View File

@ -0,0 +1,15 @@
# $OpenBSD: wpa_supplicant.conf,v 1.1 2007/07/01 19:50:57 reyk Exp $
# Sample wpa_supplicant configuration file for wired IEEE 802.1x
# port authentication. See wpa_supplicant.conf(5).
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
ap_scan=0
network={
key_mgmt=IEEE8021X
eap=MD5
identity="user"
password="password"
eapol_flags=0
}

View File

@ -0,0 +1,51 @@
--- original/common.h Sun Dec 31 22:41:44 2006
+++ common.h Fri May 18 01:48:18 2007
@@ -80,8 +80,29 @@ static inline unsigned int wpa_swap_32(unsigned int v)
#define be_to_host32(n) wpa_swap_32(n)
#define host_to_be32(n) wpa_swap_32(n)
-#else /* __CYGWIN__ */
+#elif defined(__OpenBSD__)
+#define le_to_host16(n) letoh16(n)
+#define host_to_le16(n) htole16(n)
+#define be_to_host16(n) betoh16(n)
+#define host_to_be16(n) htobe16(n)
+
+#define le_to_host32(n) letoh32(n)
+#define host_to_le32(n) htole32(n)
+#define be_to_host32(n) betoh32(n)
+#define host_to_be32(n) htobe32(n)
+
+#define le_to_host64(n) letoh64(n)
+#define host_to_le64(n) htole64(n)
+#define be_to_host64(n) betoh64(n)
+#define host_to_be64(n) htobe64(n)
+
+#if _BYTE_ORDER == _BIG_ENDIAN
+#define WORDS_BIGENDIAN
+#endif
+
+#else /* __CYGWIN__ / __OpenBSD__ */
+
#ifndef __BYTE_ORDER
#ifndef __LITTLE_ENDIAN
#ifndef __BIG_ENDIAN
@@ -95,17 +116,6 @@ static inline unsigned int wpa_swap_32(unsigned int v)
#endif /* __BYTE_ORDER */
#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define le_to_host16(n) (n)
-#define host_to_le16(n) (n)
-#define be_to_host16(n) bswap_16(n)
-#define host_to_be16(n) bswap_16(n)
-#define le_to_host32(n) (n)
-#define be_to_host32(n) bswap_32(n)
-#define host_to_be32(n) bswap_32(n)
-#define le_to_host64(n) (n)
-#define host_to_le64(n) (n)
-#define be_to_host64(n) bswap_64(n)
-#define host_to_be64(n) bswap_64(n)
#elif __BYTE_ORDER == __BIG_ENDIAN
#define le_to_host16(n) bswap_16(n)
#define host_to_le16(n) bswap_16(n)

View File

@ -0,0 +1,22 @@
--- original/.config Thu Jan 1 01:00:00 1970
+++ .config Fri May 18 03:03:31 2007
@@ -0,0 +1,19 @@
+CONFIG_CTRL_IFACE=y
+CONFIG_DRIVER_WIRED=y
+CONFIG_IEEE8021X_EAPOL=y
+CONFIG_EAP_MD5=y
+CONFIG_EAP_MSCHAPV2=y
+CONFIG_EAP_TLS=y
+CONFIG_EAP_PEAP=y
+CONFIG_EAP_TTLS=y
+CONFIG_EAP_GTC=y
+CONFIG_EAP_OTP=y
+CONFIG_EAP_AKA=y
+CONFIG_EAP_PSK=y
+CONFIG_EAP_SAKE=y
+CONFIG_EAP_GPSK=y
+CONFIG_EAP_PAX=y
+CONFIG_EAP_LEAP=y
+CONFIG_EAP_SIM=y
+#CONFIG_EAP_FAST=n
+CONFIG_L2_PACKET=freebsd

View File

@ -0,0 +1,20 @@
--- original/driver_wired.c Sun Dec 31 04:28:05 2006
+++ driver_wired.c Fri May 18 02:06:07 2007
@@ -18,7 +18,7 @@
#ifdef __linux__
#include <netpacket/packet.h>
#endif /* __linux__ */
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
#include <net/if_dl.h>
#endif /* __FreeBSD__ */
@@ -125,7 +125,7 @@ static int wpa_driver_wired_multi(const char *ifname,
ifr.ifr_hwaddr.sa_family = AF_UNSPEC;
os_memcpy(ifr.ifr_hwaddr.sa_data, addr, ETH_ALEN);
#endif /* __linux__ */
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
{
struct sockaddr_dl *dlp;
dlp = (struct sockaddr_dl *) &ifr.ifr_addr;

View File

@ -0,0 +1,11 @@
--- original/os_internal.c Sun Dec 31 22:41:44 2006
+++ os_internal.c Fri May 18 01:49:29 2007
@@ -178,7 +178,7 @@ int os_setenv(const char *name, const char *value, int
int os_unsetenv(const char *name)
{
-#if defined(__FreeBSD__) || defined(__NetBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
unsetenv(name);
return 0;
#else

View File

@ -0,0 +1,11 @@
--- original/os_unix.c Sun Dec 31 22:41:44 2006
+++ os_unix.c Fri May 18 01:48:53 2007
@@ -171,7 +171,7 @@ int os_setenv(const char *name, const char *value, int
int os_unsetenv(const char *name)
{
-#if defined(__FreeBSD__) || defined(__NetBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
unsetenv(name);
return 0;
#else

View File

@ -0,0 +1,3 @@
wpa_supplicant is the implementation of an IEEE 802.11X supplicant.
This port is for wired authentication only (Ethernet PAE) and does not
support the wireless WPA/WPA2 functionality.

View File

@ -0,0 +1,13 @@
@comment $OpenBSD: PLIST,v 1.1 2007/07/01 19:50:57 reyk Exp $
@man man/man5/wpa_supplicant.conf.5
@man man/man8/wpa_background.8
@man man/man8/wpa_cli.8
@man man/man8/wpa_passphrase.8
@man man/man8/wpa_supplicant.8
sbin/wpa_cli
sbin/wpa_passphrase
sbin/wpa_supplicant
share/examples/wpa_supplicant/
share/examples/wpa_supplicant/wpa_supplicant.conf
@sample ${SYSCONFDIR}/wpa_supplicant.conf
share/examples/wpa_supplicant/wpa_supplicant.conf.dist