hostapd: karma patch v1.0 is fixed

This commit is contained in:
Anton Bolshakov 2012-08-03 04:51:39 +00:00
parent 06f9f83dd8
commit 078f62ead2
4 changed files with 15 additions and 212 deletions

View file

@ -1,13 +1,12 @@
AUX cui-20120417.patch 13221 RMD160 c6d420cb68e0e705d46c4287cebfa70c745ba661 SHA1 6d73d4de1089f6fc49273e5210d1f7cf6a862dcc SHA256 b853484cd5d3e89e4eb96be3edf0bedef01922e74cd87578c6a2faf647f3180a
AUX cui-20120717.patch 12726 RMD160 a5cf8e228746d848e461b215e926791f0065ac80 SHA1 acfbc7da9b1d7d31deae8e476b086367ee135f2e SHA256 ce24f99b5d45b78af750339ac8c05595b0faed7cecd99fa8e8072e65386d8e05
AUX hostapd-0.7.3-karma.patch 17778 RMD160 e6fb21ba941c8c0578fdf4bcaad3970b4182d580 SHA1 5264175ec18fc44dd437525eabbde56f438b958d SHA256 28b8963c836e0208d8f621c6345e27d66ad2a8df33eec99d2505fc7980019ee8
AUX hostapd-1.0-karma.patch 17261 RMD160 01dd30551c4b1f10242d40db66794fcbe99dbc4a SHA1 22d36545747793071a1746c6d63abc16fb2a1f5d SHA256 a5c4daa1f50d62d6e99c93533351b012ef104b59b557640aa1c02bd108759063
AUX hostapd-1.0-karma.patch 15724 RMD160 f5f1cf6fad4653be28b48c15fbe814b58e33c634 SHA1 6d0d4749efc0a87ff28796ff51c081cfa5d16007 SHA256 9f4d853c2974607aed7accb5785df224e3abdce4baf4dee787ca45421c85ec87
AUX hostapd-conf.d 245 RMD160 88b816218cb37d32fd940db17ece84d612c87f14 SHA1 0d88865c313bf1ffbc168029a13c76f288280a3d SHA256 916f4b14095ee4ec8a510391c883e9f01868e18d79a3d5cbeb13a104a793d45d
AUX hostapd-init.d 1022 RMD160 cb6380788253a43d6078c498fcfc7d37c4881d1b SHA1 68911ad9af83ab7a77a8e12ddc6f4f5337aa4d19 SHA256 a220058841e66a11603df8e968ccc68945f01e1d11c1ae498922d0e01f6fa804
DIST hostapd-0.7.3.tar.gz 1138869 RMD160 3d901166172cf634ecab4bd8426a33695b1e1070 SHA1 7a8853fe41ee5a2b9f03f608cf7a61c7ccea4f4c SHA256 31eb2781f37e1a4c27969d1594f8019c0ca87779349c099ab812833289961567
DIST hostapd-1.0.tar.gz 1327943 RMD160 d4d90d0ed3130727ac8a4b3a413882dfeaef9fd4 SHA1 4edf267bc5943a5f7d6d9c0abcce0973bfbad5fa SHA256 002e9dcb7e46cf82b5900a2fcf92b30fc8cdfd32a72d7fd4488588f1c013dfcc
EBUILD hostapd-0.7.3-r1.ebuild 5196 RMD160 c64ab6b1b4383012cf8c5fa3d888ef2ef0110d99 SHA1 177365371ab8b4d30c3f6de5e3628a1e7da579dc SHA256 c1d3482187cebb1723218f78e481ad6eb6ea1e84671211d2eb0d0c341e9754e3
EBUILD hostapd-0.7.3-r2.ebuild 5242 RMD160 c9d7d5a2b83db19ce14054da49dcfc74a2bc1aec SHA1 b4cb886d96a7fe22a111e17f836db739233aaeef SHA256 85f98f60afad13b1667d602bba5a66f32eadcffa7548f52d13422424de33ed04
EBUILD hostapd-1.0-r1.ebuild 5654 RMD160 91e6f5751a0ddebaa07b54766c12937ec97675bb SHA1 e5f231345817ad3ce09868f9f225a157abe29331 SHA256 9da6f5e16bafd702277f43cef25d6b6e71e4a99236b71eabd9098986014614a8
EBUILD hostapd-1.0-r2.ebuild 5654 RMD160 91e6f5751a0ddebaa07b54766c12937ec97675bb SHA1 e5f231345817ad3ce09868f9f225a157abe29331 SHA256 9da6f5e16bafd702277f43cef25d6b6e71e4a99236b71eabd9098986014614a8
MISC ChangeLog 20312 RMD160 c4c737a7b61d845873ff118e070c73a6cda1b20d SHA1 6757bce5e168416c6c388d53740978dba230ba6f SHA256 4a1673cde56f1b7ea1dfd20f0ac702ad3e7e916b84cfdf4f5aa0448d01b13659
MISC metadata.xml 752 RMD160 f895add3fe282efb5fd3fba223d16b28fabe2e9e SHA1 1c4e58ae3628f9c433d939e5d973e1c795aa58f6 SHA256 78c8bab11c00f4988d677b1f4bf5a66c3221c0f9a3c46cfaf333a8857f250662

View file

@ -161,11 +161,11 @@ diff -urN hostapd-1.0.orig//hostapd/main.c hostapd-1.0/hostapd/main.c
case 't':
wpa_debug_timestamp++;
break;
+ case 'R':
+ karma_beacon_respond++;
+ break;
+ case 'A':
+ karma_eap_auth++;
+ case 'R':
+ karma_beacon_respond++;
+ break;
+ case 'A':
+ karma_eap_auth++;
+ break;
case 'v':
show_version();
@ -254,7 +254,7 @@ diff -urN hostapd-1.0.orig//src/eap_server/eap_server.c hostapd-1.0/src/eap_serv
* backend_auth configuration variable to TRUE.
*/
+#define _GNU_SOURCE
+#define _GNU_SOURCE
+#include <stdio.h>
+
+#include "karma/karma.h"
@ -403,10 +403,11 @@ diff -urN hostapd-1.0.orig//src/karma/karma.c hostapd-1.0/src/karma/karma.c
@@ -0,0 +1,43 @@
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <time.h>
+
+#include "common.h"
+#include "includes.h"
+#include "trace.h"
+#include "trace.h"
+
+#include "karma/karma.h"
+
@ -416,7 +417,7 @@ diff -urN hostapd-1.0.orig//src/karma/karma.c hostapd-1.0/src/karma/karma.c
+ FILE *logfd;
+ time_t cur_time;
+ struct tm *tm_ptr;
+ char time_buf[256];
+ char time_buf[256];
+ /* General: probe requests, username requests */
+ logfd = fopen("./hostapd-karma.txt", "a");
+ if (logfd == NULL) {
@ -424,14 +425,13 @@ diff -urN hostapd-1.0.orig//src/karma/karma.c hostapd-1.0/src/karma/karma.c
+ logfd = stderr;
+ }
+
+ cur_time = time(NULL);
+ (void) time(&cur_time);
+ time(&cur_time);
+ tm_ptr = localtime(&cur_time);
+ strftime(time_buf, 256, "%Y-%m-%d %H:%M:%S", tm_ptr);
+ fprintf(logfd, "%s:%s\n", time_buf, message);
+ fprintf(stderr, "[karma] %s:%s\n", time_buf, message);
+ fprintf(logfd, "%s: %s\n", time_buf, message);
+ fprintf(stderr, "[karma] %s: %s\n", time_buf, message);
+ fclose(logfd);
+
+
+ /* MSCHAPv2 Challenge/Response */
+ if (type == 1)
+ {

View file

@ -1,196 +0,0 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-wireless/hostapd/hostapd-0.7.3.ebuild,v 1.3 2011/04/21 13:53:15 tomka Exp $
EAPI="2"
inherit toolchain-funcs eutils
DESCRIPTION="IEEE 802.11 wireless LAN Host AP daemon"
HOMEPAGE="http://hostap.epitest.fi"
SRC_URI="http://hostap.epitest.fi/releases/${P}.tar.gz"
LICENSE="|| ( GPL-2 BSD )"
SLOT="0"
KEYWORDS="amd64 ~ppc x86"
IUSE="debug ipv6 logwatch madwifi +ssl +wps +karma"
DEPEND="ssl? ( dev-libs/openssl )
>=dev-libs/libnl-1.1
madwifi? ( ||
( >net-wireless/madwifi-ng-tools-0.9.3
net-wireless/madwifi-old ) )"
RDEPEND="${DEPEND}"
S="${S}/hostapd"
src_prepare() {
cd ..
if use karma; then epatch "${FILESDIR}/${P}-karma.patch"; fi
cd "${S}"
sed -i -e "s:/etc/hostapd:/etc/hostapd/hostapd:g" \
"${S}/hostapd.conf"
}
src_configure() {
local CONFIG="${S}/.config"
# toolchain setup
echo "CC = $(tc-getCC)" > ${CONFIG}
# EAP authentication methods
echo "CONFIG_EAP=y" >> ${CONFIG}
echo "CONFIG_EAP_MD5=y" >> ${CONFIG}
if use ssl; then
# SSL authentication methods
echo "CONFIG_EAP_TLS=y" >> ${CONFIG}
echo "CONFIG_EAP_TTLS=y" >> ${CONFIG}
echo "CONFIG_EAP_MSCHAPV2=y" >> ${CONFIG}
echo "CONFIG_EAP_PEAP=y" >> ${CONFIG}
fi
if use wps; then
# Enable Wi-Fi Protected Setup
echo "CONFIG_WPS=y" >> ${CONFIG}
echo "CONFIG_WPS_UPNP=y" >> ${CONFIG}
einfo "Enabling Wi-Fi Protected Setup support"
fi
echo "CONFIG_EAP_GTC=y" >> ${CONFIG}
echo "CONFIG_EAP_SIM=y" >> ${CONFIG}
echo "CONFIG_EAP_AKA=y" >> ${CONFIG}
echo "CONFIG_EAP_PAX=y" >> ${CONFIG}
echo "CONFIG_EAP_PSK=y" >> ${CONFIG}
echo "CONFIG_EAP_SAKE=y" >> ${CONFIG}
echo "CONFIG_EAP_GPSK=y" >> ${CONFIG}
echo "CONFIG_EAP_GPSK_SHA256=y" >> ${CONFIG}
einfo "Enabling drivers: "
# drivers
echo "CONFIG_DRIVER_HOSTAP=y" >> ${CONFIG}
einfo " HostAP driver enabled"
echo "CONFIG_DRIVER_WIRED=y" >> ${CONFIG}
einfo " Wired driver enabled"
echo "CONFIG_DRIVER_PRISM54=y" >> ${CONFIG}
einfo " Prism54 driver enabled"
echo "CONFIG_DRIVER_NONE=y" >> ${CONFIG}
einfo " None driver enabled"
if use madwifi; then
# Add include path for madwifi-driver headers
einfo " Madwifi driver enabled"
echo "CFLAGS += -I/usr/include/madwifi" >> ${CONFIG}
echo "CONFIG_DRIVER_MADWIFI=y" >> ${CONFIG}
else
einfo " Madwifi driver disabled"
fi
einfo " nl80211 driver enabled"
echo "CONFIG_DRIVER_NL80211=y" >> ${CONFIG}
echo "CFLAGS += -I/usr/include/netlink" >> ${CONFIG}
echo "LIBS += -L/usr/lib" >> ${CONFIG}
# misc
echo "CONFIG_PKCS12=y" >> ${CONFIG}
echo "CONFIG_RADIUS_SERVER=y" >> ${CONFIG}
echo "CONFIG_IAPP=y" >> ${CONFIG}
echo "CONFIG_IEEE80211R=y" >> ${CONFIG}
echo "CONFIG_IEEE80211W=y" >> ${CONFIG}
echo "CONFIG_IEEE80211N=y" >> ${CONFIG}
echo "CONFIG_PEERKEY=y" >> ${CONFIG}
echo "CONFIG_RSN_PREAUTH=y" >> ${CONFIG}
if use ipv6; then
# IPv6 support
echo "CONFIG_IPV6=y" >> ${CONFIG}
fi
if ! use debug; then
echo "CONFIG_NO_STDOUT_DEBUG=y" >> ${CONFIG}
fi
# TODO: Add support for BSD drivers
default_src_configure
}
src_compile() {
default_src_compile
#emake || die "emake failed"
if use ssl; then
emake nt_password_hash || die "emake nt_password_hash failed"
emake hlr_auc_gw || die "emake hlr_auc_gw failed"
fi
}
src_install() {
insinto /etc/hostapd
doins hostapd.conf hostapd.accept hostapd.deny \
hostapd.eap_user hostapd.radius_clients hostapd.sim_db hostapd.wpa_psk
dosbin hostapd
dobin hostapd_cli
use ssl && dobin nt_password_hash
use ssl && dobin hlr_auc_gw
newinitd "${FILESDIR}"/${PN}-init.d hostapd
newconfd "${FILESDIR}"/${PN}-conf.d hostapd
doman hostapd.8 hostapd_cli.1
dodoc ChangeLog README
if use wps; then
dodoc README-WPS
fi
docinto examples
dodoc wired.conf
if use logwatch; then
insinto /etc/log.d/conf/services/
doins logwatch/hostapd.conf
exeinto /etc/log.d/scripts/services/
doexe logwatch/hostapd
fi
}
pkg_postinst() {
einfo
einfo "In order to use ${PN} you need to set up your wireless card"
einfo "for master mode in /etc/conf.d/net and then start"
einfo "/etc/init.d/hostapd."
einfo
einfo "Example configuration:"
einfo
einfo "config_wlan0=( \"192.168.1.1/24\" )"
einfo "channel_wlan0=\"6\""
einfo "essid_wlan0=\"test\""
einfo "mode_wlan0=\"master\""
einfo
if use madwifi; then
einfo "This package compiles against the headers installed by"
einfo "madwifi-old, madwifi-ng or madwifi-ng-tools."
einfo "You should remerge ${PN} after upgrading these packages."
einfo
einfo "Since you are using the madwifi-ng driver, you should disable or"
einfo "comment out wme_enabled from hostapd.conf, since it will"
einfo "cause problems otherwise (see bug #260377"
fi
#if [ -e "${KV_DIR}"/net/mac80211 ]; then
# einfo "This package now compiles against the headers installed by"
# einfo "the kernel source for the mac80211 driver. You should "
# einfo "re-emerge ${PN} after upgrading your kernel source."
#fi
if use wps; then
einfo "You have enabled Wi-Fi Protected Setup support, please"
einfo "read the README-WPS file in /usr/share/doc/${P}"
einfo "for info on how to use WPS"
fi
}