hostapd: sync with gentoo a bit

This commit is contained in:
Rick Farina (Zero_Chaos) 2021-11-12 15:10:31 -05:00
parent a2428c2907
commit 8821991a77
No known key found for this signature in database
GPG key ID: A29433C0AA431DDC

View file

@ -3,10 +3,10 @@
EAPI=7
inherit toolchain-funcs systemd savedconfig
inherit flag-o-matic systemd savedconfig toolchain-funcs
DESCRIPTION="IEEE 802.11 wireless LAN Host AP daemon"
HOMEPAGE="https://github.com/aircrack-ng/aircrack-ng/tree/master/patches/wpe/hostapd-wpe"
HOMEPAGE="https://w1.fi/ https://w1.fi/cgit/hostap/ https://github.com/aircrack-ng/aircrack-ng/tree/master/patches/wpe/hostapd-wpe"
EXTRAS_VER="2.7-r2"
EXTRAS_NAME="${CATEGORY}_${PN}_${EXTRAS_VER}_extras"
SRC_URI="https://dev.gentoo.org/~andrey_utkin/distfiles/${EXTRAS_NAME}.tar.xz"
@ -28,30 +28,30 @@ fi
LICENSE="BSD"
SLOT="0"
IUSE="internal-tls ipv6 logwatch netlink sqlite +suiteb +wpe +wps +crda"
IUSE="internal-tls ipv6 netlink sqlite +suiteb +wpe +wps +crda"
DEPEND="
internal-tls? ( dev-libs/libtommath )
!internal-tls? ( dev-libs/openssl:0=[-bindist] )
internal-tls? ( dev-libs/libtommath )
!internal-tls? ( dev-libs/openssl:0=[-bindist(-)] )
kernel_linux? (
dev-libs/libnl:3
crda? ( net-wireless/crda )
)
netlink? ( net-libs/libnfnetlink )
sqlite? ( >=dev-db/sqlite-3 )"
RDEPEND="${DEPEND}"
BDEPEND="virtual/pkgconfig"
pkg_pretend() {
if use internal-tls; then
ewarn "internal-tls implementation is experimental and provides fewer features"
ewarn "internal-tls implementation is experimental and provides fewer features"
fi
}
src_unpack() {
# Override default one because we need the SRC_URI ones even in case of 9999 ebuilds
default
if [[ ${PV} == 9999 ]] ; then
git-r3_src_unpack
fi
@ -63,24 +63,26 @@ src_prepare() {
pushd ../ >/dev/null || die
default
# CVE-2019-16275 bug #696032
eapply "${FILESDIR}/hostapd-2.9-AP-Silently-ignore-management-frame-from-unexpected.patch"
# CVE-2020-12695 bug #727542
eapply "${FILESDIR}/${P}-0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch"
eapply "${FILESDIR}/${P}-0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch"
eapply "${FILESDIR}/${P}-0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch"
popd >/dev/null || die
# CVE-2019-16275 (bug #696032)
eapply "${FILESDIR}"/${P}-AP-Silently-ignore-management-frame-from-unexpected.patch
# CVE-2020-12695 (bug #727542)
eapply "${FILESDIR}"/${P}-0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch
eapply "${FILESDIR}"/${P}-0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch
eapply "${FILESDIR}"/${P}-0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch
# CVE-2021-30004 (bug #780135)
eapply "${FILESDIR}"/${P}-ASN-1-Validate-DigestAlgorithmIdentifier-parameters.patch
#https://github.com/aircrack-ng/aircrack-ng/tree/master/patches/wpe/hostapd-wpe
use wpe && cd .. && eapply "${FILESDIR}/${P}-wpe.patch"
use wpe && eapply "${FILESDIR}/${P}-wpe.patch"
popd >/dev/null || die
sed -i -e "s:/etc/hostapd:/etc/hostapd/hostapd:g" \
"${S}/hostapd.conf" || die
}
src_configure() {
local CONFIG="${S}/.config"
local CONFIG="${S}"/.config
restore_config "${CONFIG}"
if [[ -f "${CONFIG}" ]]; then
@ -165,6 +167,7 @@ src_configure() {
echo "CONFIG_IEEE80211W=y" >> ${CONFIG} || die
echo "CONFIG_IEEE80211N=y" >> ${CONFIG} || die
echo "CONFIG_IEEE80211AC=y" >> ${CONFIG} || die
echo "CONFIG_OCV=y" >> ${CONFIG} || die
echo "CONFIG_PEERKEY=y" >> ${CONFIG} || die
echo "CONFIG_RSN_PREAUTH=y" >> ${CONFIG} || die
echo "CONFIG_INTERWORKING=y" >> ${CONFIG} || die
@ -195,6 +198,7 @@ src_configure() {
# support it.
if has_version ">=dev-libs/libnl-3.2"; then
echo "CONFIG_LIBNL32=y" >> ${CONFIG} || die
append-cflags $($(tc-getPKG_CONFIG) --cflags libnl-3.0)
fi
# TODO: Add support for BSD drivers
@ -213,9 +217,8 @@ src_compile() {
src_install() {
insinto /etc/${PN}
# mv hostapd-wpe.eap_user hostapd.eap_user
doins ${PN}.{conf,accept,deny,eap_user,radius_clients,sim_db,wpa_psk}
doins "${FILESDIR}"/hostapd-int.conf "${FILESDIR}"/hostapd-ext.conf "${FILESDIR}/${P}"-wpe.conf
use wpe && doins "${FILESDIR}"/hostapd-int.conf "${FILESDIR}"/hostapd-ext.conf "${FILESDIR}/${P}"-wpe.conf
fperms -R 600 /etc/${PN}
@ -245,20 +248,18 @@ src_install() {
docinto examples
dodoc wired.conf
if use logwatch; then
insinto /etc/log.d/conf/services/
doins logwatch/${PN}.conf
insinto /etc/log.d/conf/services/
doins logwatch/${PN}.conf
exeinto /etc/log.d/scripts/services/
doexe logwatch/${PN}
fi
exeinto /etc/log.d/scripts/services/
doexe logwatch/${PN}
save_config .config
}
pkg_postinst() {
einfo
einfo "If you are running openRC you need to follow this instructions:"
einfo "If you are running OpenRC you need to follow this instructions:"
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/${PN}."
@ -279,7 +280,7 @@ pkg_postinst() {
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 "read the README-WPS file in /usr/share/doc/${PF}"
einfo "for info on how to use WPS"
fi
}