Merge pull request #13 from igorpecovnik/master

update master 20160711
This commit is contained in:
Guillaume Romagny 2016-07-11 01:23:05 +02:00 committed by GitHub
commit fbaa1d07b1
36 changed files with 12973 additions and 665 deletions

View File

@ -13,6 +13,7 @@
# update_chroot
# chroot_build_packages
# fetch_from_repo
# chroot_installpackages
# create_chroot <target_dir>
# <target_dir>: directory to put files
@ -73,6 +74,12 @@ chroot_build_packages()
display_alert "Starting package building process" "$RELEASE" "info"
local target_dir=$DEST/buildpkg/${RELEASE}-${ARCH}
# to avoid conflicts between published and self-built packages
# higher pin-priority may be enough
# may use hostname or other unique identifier
# local builddate=$(date +"%Y%m%d")
mkdir -p $DEST/debs/extra/$RELEASE
[[ ! -f $target_dir/root/.debootstrap-complete ]] && create_chroot "$target_dir"
@ -81,13 +88,16 @@ chroot_build_packages()
update_chroot "$target_dir"
for plugin in $SRC/lib/extras-buildpkgs/*.conf; do
unset package_name package_repo package_ref package_builddeps package_install_chroot package_install_target \
package_prebuild_eval package_upstream_version needs_building
source $plugin
# check if needs building
local needs_building=no
if [[ -n $package_install_target ]]; then
for f in $package_install_target; do
if [[ -z $(find $DEST/debs/extra/ -name "${f}_*$REVISION*_$ARCH.deb") ]]; then
if [[ -z $(find $DEST/debs/extra/$RELEASE/ -name "${f}_*$REVISION*_$ARCH.deb" \
-o -name "${f}_*$REVISION*_all.deb") ]]; then
needs_building=yes
break
fi
@ -128,6 +138,7 @@ chroot_build_packages()
# set upstream version
[[ -n "$package_upstream_version" ]] && debchange --preserve --newversion "$package_upstream_version" "Import from upstream"
# set local version
# debchange -l~armbian${REVISION}-${builddate}+ "New Armbian release"
debchange -l~armbian${REVISION}+ "New Armbian release"
# build
display_alert "Building package"
@ -158,16 +169,14 @@ chroot_build_packages()
# run build script in chroot
systemd-nspawn -a -q -D $target_dir --tmpfs=/root/build --tmpfs=/tmp --bind-ro $SRC/lib/extras-buildpkgs/:/root/overlay \
--bind-ro $SRC/sources/extra/:/root/sources /bin/bash -c "/root/build.sh"
# move built packages to $DEST/debs/extras
# move built packages to $DEST/debs/extras/$RELEASE
if [[ -n $package_install_target ]]; then
for f in $package_install_target; do
mv $target_dir/root/${f}_*.deb $DEST/debs/extra/
mv $target_dir/root/${f}_*.deb $DEST/debs/extra/$RELEASE/
done
fi
# cleanup
rm $target_dir/root/*.deb 2>/dev/null
unset package_name package_repo package_ref package_builddeps package_install_chroot package_install_target \
package_prebuild_eval package_upstream_version needs_building
done
} #############################################################################
@ -196,6 +205,7 @@ fetch_from_repo()
# doesn't work with git:// remote URLs
# local ref_name=$(git ls-remote --symref $url HEAD | grep -o 'refs/heads/\S*' | sed 's%refs/heads/%%')
# TODO: Remove hardcoded "extra" part
if [[ $ref_subdir == yes ]]; then
mkdir -p $SOURCES/extra/$dir/$ref_name
cd $SOURCES/extra/$dir/$ref_name
@ -239,3 +249,63 @@ fetch_from_repo()
display_alert "... up to date"
fi
} #############################################################################
# chroot_installpackages
#
chroot_installpackages()
{
local conf="/tmp/aptly-temp/aptly.conf"
mkdir -p /tmp/aptly-temp/
cat <<-'EOF' > $conf
{
"rootDir": "/tmp/aptly-temp/",
"downloadConcurrency": 4,
"downloadSpeedLimit": 0,
"architectures": [],
"dependencyFollowSuggests": false,
"dependencyFollowRecommends": false,
"dependencyFollowAllVariants": false,
"dependencyFollowSource": false,
"gpgDisableSign": false,
"gpgDisableVerify": false,
"downloadSourcePackages": false,
"ppaDistributorID": "ubuntu",
"ppaCodename": "",
"S3PublishEndpoints": {},
"SwiftPublishEndpoints": {}
}
EOF
aptly -config=$conf repo create temp
# NOTE: this works recursively
aptly -config=$conf -force-replace=true repo add temp $DEST/debs/extra/$RELEASE/
# -gpg-key="128290AF"
aptly -secret-keyring="$SRC/lib/extras-buildpkgs/buildpkg.gpg" -batch -config=$conf \
-component=temp -distribution=$RELEASE publish repo temp
aptly -config=$conf -listen=":8189" serve &
local aptly_pid=$!
cp $SRC/lib/extras-buildpkgs/buildpkg.key $CACHEDIR/sdcard/tmp/buildpkg.key
chroot $CACHEDIR/sdcard /bin/bash -c "cat /tmp/buildpkg.key | apt-key add -"
rm $CACHEDIR/sdcard/tmp/buildpkg.key
cat <<-EOF > $CACHEDIR/sdcard/etc/apt/preferences.d/90-armbian-temp.pref
Package: *
Pin: origin "localhost"
Pin-Priority: 995
EOF
cat <<-EOF > $CACHEDIR/sdcard/etc/apt/sources.list.d/armbian-temp.list
deb http://localhost:8189/ $RELEASE temp
EOF
local install_list=""
for plugin in $SRC/lib/extras-buildpkgs/*.conf; do
source $plugin
# TODO: check install condition
install_list="$install_list $package_install_target"
unset package_install_target
done
chroot $CACHEDIR/sdcard /bin/bash -c "apt-get update; apt-get install -y $install_list"
rm $CACHEDIR/sdcard/etc/apt/sources.list.d/armbian-temp.list
chroot $CACHEDIR/sdcard /bin/bash -c "apt-key del 128290AF"
rm $CACHEDIR/sdcard/etc/apt/preferences.d/90-armbian-temp.pref
kill $aptly_pid
rm -rf /tmp/aptly-temp/
} #############################################################################

View File

@ -2,6 +2,7 @@
local package_name="libDRI2"
local package_repo="https://github.com/robclark/libdri2.git"
local package_ref="branch:master"
local package_upstream_version="1.0.1"
local package_builddeps="xutils-dev x11proto-xext-dev x11proto-dri2-dev quilt pkg-config libxfixes-dev libxext-dev libdrm-dev dh-autoreconf"
local package_install_chroot="libdri2-1 libdri2-dev"
local package_install_target="libdri2-1"

View File

@ -0,0 +1,7 @@
# hostapd-realtek
local package_name="hostapd-realtek"
local package_repo="http://w1.fi/hostap.git"
local package_ref="branch:hostap_2_5"
local package_upstream_version="2.5"
local package_builddeps="pkg-config libssl-dev libreadline-dev libpcsclite-dev libnl-route-3-dev libnl-genl-3-dev libnl-3-dev libncurses5-dev libdbus-1-dev docbook-utils docbook-to-man"
local package_install_target="hostapd-realtek"

View File

@ -2,11 +2,11 @@
### Installing packages to images:
* Add a function for installing packages
* Add a function for installing packages - **done**
* ~~Add a variable for dependencies or function for extracting dependencies from deb files~~
* Use aptly to create local repository: this will allow solving dependencies on installation automatically
* Use aptly to create local repository: this will allow solving dependencies on installation automatically - **done**
* Add a variable for list of packages to install during debootstrap - **done**
@ -27,7 +27,7 @@
* Add sunxi-mali package if BLOBs license allows redistribution, otherwise create an installer like oracle-jdk
* Add hostapd-realtek package - copy of hostapd with realtek-specific patches
* Add hostapd-realtek package - copy of hostapd with realtek-specific patches - **done**
* Delete unused files (i.e. \*.lintian-overrides) - **done***

Binary file not shown.

View File

@ -0,0 +1,38 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQENBFeCxc0BCADazdDUs6OG4nRR+u2eeGvtfutGRqGPuk7F6iqFzzSnw0/iXwIW
tgWAp1bqlXjQXBQ+1qpvnYQAUt9q7tQ06b53gxI+ROG+Wv8nRxdT5xhBVwydtoRf
vV8wBTE504eRF9EuOjp2KhIVpGUEkBVXrSEHDk51Tiz9TKKtS3/HSoicNAnFCHix
+XuXcdJ+INcsnnDV9XOfaqCdUdpeaDAjQT1q7YHqrAYShjByryrmw2tE3TSff05y
h8fdWATGlJQBRvNBrlKDSBGlNbMYpnOaKC30F3f3RHq4cPb37RgPlEAZ8EL1U43h
cYJHGDI0anIP+G93nUOWNSAMyP9+2nBnG88rABEBAAG0ZkFybWJpYW4gYnVpbGRl
ciAoVGVtcG9yYXJ5IGtleSBmb3IgaW5zdGFsbGluZyBwYWNrYWdlcyBkdXJpbmcg
QXJtYmlhbiBpbWFnZSBjcmVhdGlvbikgPHJvb3RAbG9jYWxob3N0PokBOAQTAQIA
IgUCV4LFzQIbLwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQqDKDcBKCkK+s
lQgAmUA3erGtEdzorjbcfF8nvqzaq/oiwYCgz3maMzcOv4QIfd+uUbjPYlkNoAql
j4Gamqo/oVDcW91kLk4pScNstQ3CueE+1HuFSLVD9v3x0dU2wo4XmV5d0J7LQo/K
CVI3ZjpI1eKiqIFBQDbRn92EiTLjy0pv1KtN3PXHOKNHwuz3cD/CQvh0lhgN+mb4
yGtVrlZlvtjy9EqQBYd6FCBGVygHae/2GvrEJq2CeGAQogNSXZS2A+kjRMdJZod5
reFXXXtUqxrnDCWtqqaH3Vz+w7UoiRSlmCpZXWBRhXrQ3UzBktOV6LeR3EyiBSdW
HVzu3OHeoUjRg1JE+zcj0P4zaLkBDQRXgsXNAQgAuAbsxXys1Ne5jrZF+JyhMnq+
i0njf75i5Z3rQi2/WjyWNvC8hb866urYFbJ/mcLTcKtqOAMGM7YSmcGnVr+m1jsi
mSvc16mufD/8zyhPeV2s45ajIapc5mdUYgosJuHDEe8j2XAb0XFtC8KW07srk0i8
g2JAlyn7dLK2mlmgeFOBW17P6Stl+/HIdf6n9Jy1xSk9+NLJfgCP+ATzirHaSs+N
lEatIMYQnjqdby8smTaWvFyQnVcp3NV2NvjKcKWPxLNIq/AEJxEUaI0F3NywLqAA
ziaLIzVX9Rr2LBgHX20S0UA8Vr/1jP30meTqolAbeC/+5bxam8Mvj32allV5dQAR
AQABiQI+BBgBAgAJBQJXgsXNAhsuASkJEKgyg3ASgpCvwF0gBBkBAgAGBQJXgsXN
AAoJEJyHpA2eKEFr2nwH/3vD3RmUq1aIdzW0kgOZBWmSr7uCYNfgRM7NA+MVrXr2
x7+2STvyZ/Ms7ekbuiBzbXthiZoFUFS6ElANFrmH9Mml1c3ogxB0Fhr7SatOJCPZ
SDq5HqAnbmiDTnDEo+NgYBP3aFfQTKmTogpBr8UP+ZS71BJYtOsh73a//cGtIPRG
JBbjwBwpa2QFnh4AjXBanptsACED768Djvx5CGk9YvVkuet33M0zqE35GwhiPEwz
xuszIbokZpro7tW9fYLgATg6VfLRI35S/qegTernFcYs5yz7V94brUYVn9rHwILz
Dqh5jeEZF0NCcxB1wSmEeDbMSk6cTzMSw94/vgojXtIK9AgAzSkH5EaNcOQpCm1t
nvz6ZlXMWuadgrKdsi797s87taFvb1K5PNjIpv/PWyzCIAIevxPfduz6bwM9h7EW
njozWkmclnW/R0WMm/Ge7ywkT3Jr/9FKHwv5EtcJFK24kwLEq947ujn0DAOSmFAt
TQZoTEAbRApWVfifiFNFpgVTuMh4r69nocxw8lq+vaX3bx3lvHYbog5D/NyijgYb
3cKnCayCJB70hWHvbWswmhw1AOw4W9ALJV6/shg6bCKrFRv9VEXprq2XW5rJsgkC
BZMm7FCG8WbijGjlGNSjE91gUpPPLLjTTquD8wk4wBkOlrmxVQlGlK9CuF0f4ASH
c0x2xw==
=I43U
-----END PGP PUBLIC KEY BLOCK-----

View File

@ -0,0 +1,20 @@
wpasupplicant (0.6.2-1) unstable; urgency=low
The -w (wait for network interface to exist) command line option no longer
exists. If you have scripts that require this option, it is time to change
them, or use one of the two supported modes of operation explained at
/usr/share/doc/wpasupplicant/README.modes.gz.
ifupdown supports hot-plugged network devices via the "allow-hotplug" class
of operation. An example /etc/network/interfaces configuration stanza would
look like:
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid myssid
wpa-psk mysecretpassphrase
network-manager is also able to handle hot-plugged network devices.
-- Kel Modderman <kel@otaku42.de> Mon, 14 Jan 2008 18:02:17 +1000

View File

@ -0,0 +1,128 @@
"wpa" sources for Debian
------------------------
This "wpa" source package merges wpa_supplicant and hostapd sources, which are
maintained in one source repository[1] upstream and share considerable/
duplicate amounts of source. Starting with the 1.x branch, both wpa_supplicant
and hostapd are built from this common source package for Debian, while not
released together as tarball by upstream, the source can be obtained from the
upstream git repositories.
The preferred way to generate the orig.tar.gz is by calling
$ debian/rules get-orig-source
which will clone the upstream git repository under $TMPDIR, using mktemp(1),
and create a new tarball based on the git tag corresponding to the top most
entry in debian/changelog. This newly generated tarball will be stored as
../wpa_${VERSION}.orig.tar.gz or ../tarballs/wpa_${VERSION}.orig.tar.gz, if
a directory called ../tarballs/ exists. Eventually existing tarballs
corresponding to the current version will not be overwritten.
Required dependencies to generate a new orig.tar.gz:
- a SUSv3 compatible shell, like dash or bash
- dpkg-parsechangelog, available from dpkg-dev
- git
- xz, available from xz-utils or busybox
- mktemp and rm, available from coreutils or busybox
- sed, available from sed or busybox
- tar, available from tar or busybox
It is recommended to base tarballs for development snapshots of "wpa" on
according git tags from the upstream git repository, the available git tags
can be queried by:
$ git clone git://w1.fi/srv/git/hostap-1.git # 1.x branch
or
$ git clone git://w1.fi/srv/git/hostap.git # >= 2.x branches
changing into the corresponding directory (hostap-1 or hostapd) and calling
git tag.
$ cd hostapd-1
$ git tag
hostap_0_6_3
[…]
hostap_1_0
[…]
hostap_1_0_rc3
[…]
The Debian versions for these tags would be 0.6.3-1, 1.0 or 1.0~rc3 in
debian/changelog. Intermediate states between tags or HEAD are usually best
dealt with by creating a patch series based on the newest matching tag.
Exporting commits between "hostap_1_0" and the current git HEAD:
$ git format-patch hostap_1_0..HEAD
Exporting commits between "hostap_1_0_rc3" and "hostap_1_0":
$ git format-patch hostap_1_0_rc3..hostap_1_0
In both cases numbered patches will be dropped in the base directory of the
git clone. These numbered patches can be imported to the Debian package using
standard procedures for "3.0 (quilt)" source packages.
Tarballs can also be created manually from the upstream git repository:
$ git clone git://w1.fi/srv/git/hostap-1.git
$ cd hostap-1
$ git archive \
--format=tar \
--prefix="wpa-1.0/" \
hostap_1_0 \
README COPYING patches src wpa_supplicant hostapd | \
xz -c6 > wpa_1.0.orig.tar.gz
Arbitrary git tags or commit IDs can be used for this purpose.
Upstream git snapshots can be exported by using a specially crafted version
syntax used in the top most (pending) changelog entry. The required syntax for
correctly parsing this is:
<upstream_version>+git<date>.<revision>+<git_hash>-<debian_revision>
upstream_version := [0-9\.]* --> 2.0
date := [0-9]* --> 20131120 (YYYYMMDD)
revision := [0-9]* --> 1
git_hash := [0-9a-f]* --> 594516b
debian_revision := [0-9*] --> 1
e.g.:
2.0+git20131120.1+594516b-1
Technically any incrementing number can be used for <date>, but it's strongly
recommended to use YYYYMMDD (date --utc +%Y%m%d) and follow it by an
strictly incrementing arbitrary revision number (typically '.1'). The supplied
git hash can be abbreviated, but must be unique (see git describe, without
leading 'g').
The debian/rules get-orig-source target will automatically switch between
hostapd-1.git and hostapd.git (for >= 2.0) as needed, but it will only fetch
the explicitly specified version from a properly formatted, top most,
debian/changelog entry; it will not fetch the last upstream release or git
HEAD automatically.
The Debian packaging for wpa_supplicant/ hostapd is maintained in a subversion
repository at:
Vcs-Svn: svn://anonscm.debian.org/svn/pkg-wpa/wpa/trunk/
Vcs-Browser: http://anonscm.debian.org/viewvc/pkg-wpa/wpa/trunk/
The development mailing list and its mailing list archive is located at:
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-wpa-devel
Work for the wpa package can be coordinated on this mailing list through:
Debian wpasupplicant Maintainers <pkg-wpa-devel@lists.alioth.debian.org>
-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Sat, 28 Dec 2013 22:37:03 +0100
[1] http://hostap.epitest.fi/gitweb/gitweb.cgi?p=hostap-1.git [1.x branch]
http://hostap.epitest.fi/gitweb/gitweb.cgi?p=hostap.git [development]

View File

@ -0,0 +1,39 @@
wpa (2.4-0ubuntu6) xenial; urgency=medium
* debian/patches/wpasupplicant_band_selection_aa517ae2.patch: add the last
missing 5 GHz band selection related cherry-pick from Debian that was not
included in wpa 2.4 (LP: #1517040)
-- Timo Jyrinki <timo-jyrinki@ubuntu.com> Tue, 19 Jan 2016 12:36:00 +0200
wpa (2.4-0ubuntu5) xenial; urgency=medium
* SECURITY UPDATE: unauthorized WNM Sleep Mode GTK control
- debian/patches/CVE-2015-5310.patch: Ignore Key Data in WNM Sleep Mode
Response frame if no PMF in use in wpa_supplicant/wnm_sta.c.
- CVE-2015-5310
* SECURITY UPDATE: EAP-pwd missing last fragment length validation
- debian/patches/CVE-2015-5315-1.patch: Fix last fragment length
validation in src/eap_peer/eap_pwd.c.
- debian/patches/CVE-2015-5315-2.patch: Fix last fragment length
validation in src/eap_server/eap_server_pwd.c.
- CVE-2015-5315
* SECURITY UPDATE: EAP-pwd peer error path failure on unexpected Confirm
message
- debian/patches/CVE-2015-5316.patch: fix error path in
src/eap_peer/eap_pwd.c.
- CVE-2015-5316
* SECURITY UPDATE: denial of service in NDEF record parser
- debian/patches/CVE-2015-8041.patch: validate payload lengths in
src/wps/ndef.c.
- CVE-2015-8041
-- Marc Deslauriers <marc.deslauriers@ubuntu.com> Tue, 10 Nov 2015 13:38:25 -0500
wpa (2.4-0ubuntu4) xenial; urgency=medium
* Add debian/system-sleep/wpasupplicant: Call wpa_cli suspend/resume
before/after suspend, like the pm-utils hook. In some cases this brings
back missing Wifi connection after resuming. (LP: #1422143)
-- Martin Pitt <martin.pitt@ubuntu.com> Mon, 26 Oct 2015 14:24:30 +0100

View File

@ -0,0 +1,54 @@
hostapd (1:0.7.3-5) UNRELEASED; urgency=low
* NOT RELEASED YET
* bump standards version to 3.9.3, no changes necessary.
* update dep-5 version to final 1.0:
- add format qualifier
- s/Upstream-Maintainer/Upstream-Contact/
- s/Upstream-Source/Source/
- use "or" instead of "BSD | GPL-2" for dual-licensed sources
- order licenses alphabetically.
- fix lists of copyright holders for the final syntax
- fix license continuation.
-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Mon, 27 Feb 2012 22:07:19 +0100
hostapd (1:0.7.3-4) unstable; urgency=low
* add myself to uploaders.
* add "hostap: Allow linking with libnl-3" from Ben Greear
<greearb@candelatech.com> to allow building against libnl3 3.2.
* switch build dependency from libnl-dev (libnl1) to libnl-3-dev &&
libnl-genl-3-dev accordingly.
* add libpcap-dev and libbsd-dev to kFreeBSD specific build-depends.
* disable IAPP on kFreeBSD, to avoid FTBS.
* restrict hostapd to linux-any and kfreebsd-any, hurd lacks kernel support.
* raise versioned build-dependency to (>= 3.2.3-2~), we need
libnl-genl-3-200-udeb and expect it in /lib/.
* add "For MS-CHAP, convert the password from UTF-8 to UCS-2" from
Evan Broder <ebroder@mokafive.com>, accepted upstream into hostap-1.git
* fix long description, driver_madwifi is no longer enabled, while driver_bsd
got enabled.
-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Tue, 20 Dec 2011 02:51:49 +0100
hostapd (1:0.7.3-3) unstable; urgency=low
[ Kel Modderman ]
* Use /run/sendsigs.omit.d/ for sendsigs omission pid file and depend on
initscripts (>= 2.88dsf-13.3). (Closes: #633026)
* Migrate existing sendsigs omission pid files from /lib/init/rw to /run.
* Add a loop to ifupdown.sh to wait for creation of hostapd pid file before
attempting creation of sensigs omission pid file, in some cases hostapd
daemon can return before creation of the pid file has been written to disk.
* Adjust standards version to 3.9.2, no further changes required to
satisfy that.
* Only test that DAEMON_CONF is set in init.d script, do not test if what is
set is readable (which assumes only one configuration file is being used).
(Closes: #615821)
[ Stefan Lippers-Hollmann ]
* use new anonscm URIs for alioth.
-- Kel Modderman <kel@otaku42.de> Sun, 11 Dec 2011 20:32:06 +1000

View File

@ -0,0 +1 @@
9

View File

@ -0,0 +1,54 @@
Source: wpa
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
XSBC-Original-Maintainer: Debian wpasupplicant Maintainers <pkg-wpa-devel@lists.alioth.debian.org>
Uploaders: Stefan Lippers-Hollmann <s.l-h@gmx.de>,
Jan Dittberner <jandd@debian.org>
Section: net
Priority: optional
Build-Depends: debhelper (>> 9.20120115),
libdbus-1-dev,
libssl-dev,
libncurses5-dev,
libpcsclite-dev,
libnl-3-dev [linux-any],
libnl-genl-3-dev [linux-any],
libnl-route-3-dev [linux-any],
libpcap-dev [kfreebsd-any],
libbsd-dev [kfreebsd-any],
libreadline-dev,
pkg-config,
docbook-to-man,
docbook-utils,
Standards-Version: 3.9.6
Vcs-Browser: http://anonscm.debian.org/viewvc/pkg-wpa/wpa/trunk/
Vcs-Svn: svn://anonscm.debian.org/pkg-wpa/wpa/trunk/
Homepage: http://w1.fi/wpa_supplicant/
Package: hostapd-realtek
Architecture: linux-any kfreebsd-any
Multi-Arch: foreign
Depends: ${shlibs:Depends},
${misc:Depends},
lsb-base
Breaks: initscripts (<< 2.88dsf-13.3)
Provides: hostapd-realtek
Conflicts: hostapd
Description: IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
Originally, hostapd was an optional user space component for Host AP
driver. It adds more features to the basic IEEE 802.11 management
included in the kernel driver: using external RADIUS authentication
server for MAC address based access control, IEEE 802.1X Authenticator
and dynamic WEP keying, RADIUS accounting, WPA/WPA2 (IEEE 802.11i/RSN)
Authenticator and dynamic TKIP/CCMP keying.
.
The current version includes support for other drivers, an integrated
EAP authenticator (i.e., allow full authentication without requiring
an external RADIUS authentication server), and RADIUS authentication
server for EAP authentication.
.
hostapd works with the following drivers:
.
* mac80211 based drivers with support for master mode [linux]
* Host AP driver for Prism2/2.5/3 [linux]
* Driver interface for FreeBSD net80211 layer [kfreebsd]
* Any wired Ethernet driver for wired IEEE 802.1X authentication.

View File

@ -0,0 +1,422 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: hostapd
Upstream-Contact: Jouni Malinen <j@w1.fi>
Source: git://w1.fi/srv/git/hostap.git
Files: *
Copyright: 2002-2014, Jouni Malinen <j@w1.fi>
License: BSD-3-clause
Files: hostapd/logwatch/*
Copyright: 2005, Henrik Brix Andersen <brix@gentoo.org>
License: BSD-3-clause or GPL-2
Files: hostapd/Android.mk
Copyright: 2008, The Android Open Source Project
License: BSD-3-clause
Files: hostapd/hostapd.8
hostapd/hostapd_cli.1
Copyright: 2005, Faidon Liambotis <faidon@cube.gr>
License: BSD-3-clause
Files: hs20/*
Copyright: 2012-2014, Qualcomm Atheros, Inc.
License: BSD-3-clause
Files: patches/*
Copyright: 2005, Alexey Kobozev <akobozev@cisco.com>
2005-2012, Jouni Malinen <j@w1.fi>
License: BSD-3-clause
Files: src/ap/acs.*
Copyright: 2011, Atheros Communications
2013, Qualcomm Atheros, Inc.
License: BSD-3-clause
Files: src/ap/ap_list.*
src/ap/ap_mlme.*
src/ap/beacon.*
src/ap/hw_features.*
src/ap/vlan_init.*
src/ap/wmm.*
Copyright: 2002-2009, Jouni Malinen <j@w1.fi>
2002-2004, Instant802 Networks, Inc.
2005-2006, Devicescape Software, Inc.
License: BSD-3-clause
Files: src/ap/dfs.*
Copyright: 2002-2013, Jouni Malinen <j@w1.fi>
2013, Qualcomm Atheros, Inc.
License: BSD-3-clause
Files: src/ap/gas_serv.*
src/ap/wnm_ap.*
src/common/ieee802_1x_defs.h
src/common/qca-vendor*
Copyright: 2011-2014, Qualcomm Atheros, Inc.
License: BSD-3-clause
Files: src/ap/hs20.*
wpa_supplicant/hs20_supplicant.*
Copyright: 2009, Atheros Communications, Inc.
2011-2013, Qualcomm Atheros, Inc.
License: BSD-3-clause
Files: src/ap/ieee802_11_ht.c
Copyright: 2002-2009, Jouni Malinen <j@w1.fi>
2007-2008, Intel Corporation
License: BSD-3-clause
Files: src/ap/p2p_hostapd.*
Copyright: 2009-2010, Atheros Communications
License: BSD-3-clause
Files: src/ap/vlan_util.*
Copyright: 2012, Michael Braun <michael-dev@fami-braun.de>
License: BSD-3-clause
Files: src/common/gas.*
Copyright: 2009, Atheros Communications
2011-2012, Qualcomm Atheros
License: BSD-3-clause
Files: src/common/ieee802_11_defs.h
Copyright: 2002-2009, Jouni Malinen <j@w1.fi>
2007-2008, Intel Corporation
License: BSD-3-clause
Files: src/common/wpa_helpers.*
Copyright: 2010-2011, Atheros Communications, Inc.
2011-2012, Qualcomm Atheros, Inc.
License: BSD-3-clause
Files: src/crypto/aes-internal*
Copyright: 2000, Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
2000, Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
2000, Paulo Barreto <paulo.barreto@terra.com.br>
2003-2012, Jouni Malinen <j@w1.fi>
License: BSD-3-clause
Files: src/crypto/des-internal.c
Copyright: 2005, Tom St Denis <tomstdenis@gmail.com>
2006-2009, Jouni Malinen <j@w1.fi>
License: BSD-3-clause
Files: src/crypto/md4-internal.c
Copyright: 1993, Colin Plumb
2004, Todd C. Miller
2006, Jouni Malinen <j@w1.fi>
License: BSD-3-clause
Files: src/crypto/md5-internal.c
Copyright: 1993, Colin Plumb
2003-2005, Jouni Malinen <j@w1.fi>
License: BSD-3-clause
Files: src/crypto/sha1-internal.c
Copyright: 1998, Steve Reid <sreid@sea-to-sky.net>
1998, James H. Brown <jbrown@burgoyne.com>
2001, Saul Kravitz <Saul.Kravitz@celera.com>
2001-2005, Jouni Malinen <j@w1.fi>
License: BSD-3-clause
Files: src/drivers/driver_atheros.c
Copyright: 2004, Sam Leffler <sam@errno.com>
2004, Video54 Technologies
2005-2007, Jouni Malinen <j@w1.fi>
2009, Atheros Communications
License: BSD-3-clause
Files: src/drivers/driver_bsd.c
Copyright: 2004, Sam Leffler <sam@errno.com>
2004, 2Wire, Inc
License: BSD-3-clause
Files: src/drivers/driver_macsec_qca.c
Copyright: 2004, Gunter Burchardt <tira@isx.de>
2005-2009, Jouni Malinen <j@w1.fi>
2013-2014, Qualcomm Atheros, Inc.
License: BSD-3-clause
Files: src/drivers/driver_madwifi.c
Copyright: 2004, Sam Leffler <sam@errno.com>
2004, Video54 Technologies
2004-2007, Jouni Malinen <j@w1.fi>
License: BSD-3-clause
Files: src/drivers/driver_nl80211.c
Copyright: 2002-2014, Jouni Malinen <j@w1.fi>
2003-2004, Instant802 Networks, Inc.
2005-2006, Devicescape Software, Inc.
2007, Johannes Berg <johannes@sipsolutions.net>
2009-2010, Atheros Communications
License: BSD-3-clause
Files: src/drivers/driver_none.c
Copyright: 2008, Atheros Communications
License: BSD-3-clause
Files: src/drivers/driver_openbsd.c
Copyright: 2013, Mark Kettenis <mark.kettenis@xs4all.nl>
License: BSD-3-clause
Files: src/drivers/driver_roboswitch.c
Copyright: 2008-2009, Jouke Witteveen
License: BSD-3-clause
Files: src/drivers/driver_wired.c
Copyright: 2005-2009, Jouni Malinen <j@w1.fi>
2004, Gunter Burchardt <tira@isx.de>
License: BSD-3-clause
Files: src/drivers/nl80211_copy.h
Copyright: 2006-2010, Johannes Berg <johannes@sipsolutions.net>
2008, Michael Wu <flamingice@sourmilk.net>
2008, Luis Carlos Cobo <luisca@cozybit.com>
2008, Michael Buesch <m@bues.ch>
2008-2009, Luis R. Rodriguez <lrodriguez@atheros.com>
2008, Jouni Malinen <jouni.malinen@atheros.com>
2008, Colin McCabe <colin@cozybit.com>
License: ISC
Files: src/eap_common/eap_pwd_common.*
src/eap_peer/eap_pwd.c
src/eap_server/eap_server_pwd.c
Copyright: 2010, Dan Harkins <dharkins@lounge.org>
License: BSD-3-clause
Files: src/eap_peer/eap_proxy*
Copyright: 2011-2013 Qualcomm Atheros, Inc.
License: BSD-3-clause
Files: src/l2_packet/l2_packet_freebsd.c
Copyright: 2003-2005, Jouni Malinen <j@w1.fi>
2005, Sam Leffler <sam@errno.com>
License: BSD-3-clause
Files: src/p2p/*
Copyright: 2009-2010, Atheros Communications
License: BSD-3-clause
Files: src/pae/*
Copyright: 2013-2014, Qualcomm Atheros, Inc.
License: BSD-3-clause
Files: src/rsn_supp/tdls.c
Copyright: 2010-2011, Atheros Communications
License: BSD-3-clause
Files: src/tls/libtommath.c
Copyright: 2005-2007, Tom St Denis <tomstdenis@gmail.com>
License: public-domain
Files: src/utils/browser*
src/utils/http*
src/utils/xml*
Copyright: 2012-2014, Qualcomm Atheros, Inc.
License: BSD-3-clause
Files: src/utils/radiotap.c
Copyright: 2007, Andy Green <andy@warmcat.com>
2009, Johannes Berg <johannes@sipsolutions.net>
License: BSD-3-clause
Files: src/utils/radiotap.h
Copyright: 2003-2004, David Young
License: BSD-3-clause
Files: src/wps/http.h
src/wps/upnp_xml.*
src/wps/wps_upnp.*
src/wps/wps_upnp_event.c
src/wps/wps_upnp_i.h
src/wps/wps_upnp_ssdp.c
src/wps/wps_upnp_web.c
Copyright: 2000-2003, Intel Corporation
2006-2007, Sony Corporation
2008-2009, Atheros Communications
2009, Jouni Malinen <j@w1.fi>
License: BSD-3-clause
Files: src/wps/httpread.*
Copyright: 2008, Ted Merrill, Atheros Communications
License: BSD-3-clause
Files: src/wps/ndef.c
Copyright: 2009-2012, Masashi Honma <honma@ictec.co.jp>
License: BSD-3-clause
Files: src/wps/wps_validate.c
Copyright: 2010, Atheros Communications, Inc.
License: BSD-3-clause
Files: wpa_supplicant/dbus/dbus_common.*
wpa_supplicant/dbus/dbus_common_i.h
wpa_supplicant/dbus/dbus_new.*
wpa_supplicant/dbus/dbus_new_handlers.*
wpa_supplicant/dbus/dbus_new_handlers_wps.c
wpa_supplicant/dbus/dbus_new_helpers.*
wpa_supplicant/dbus/dbus_new_introspect.c
Copyright: 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
2009-2010, Witold Sowa <witold.sowa@gmail.com>
2009-2010, Jouni Malinen <j@w1.fi>
License: BSD-3-clause
Files: wpa_supplicant/dbus/dbus_dict_helpers.*
wpa_supplicant/dbus/dbus_old*
Copyright: 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
License: BSD-3-clause
Files: wpa_supplicant/dbus/dbus_new_handlers_p2p.*
wpa_supplicant/examples/p2p/*
wpa_supplicant/examples/dbus-listen-preq.py
Copyright: 2011-2012, Intel Corporation
License: BSD-3-clause
Files: wpa_supplicant/utils/log2pcap.py
Copyright: Johannes Berg <johannes@sipsolutions.net>, Intel Corporation
License: BSD-3-clause
Files: wpa_supplicant/wpa_gui-qt4/icons/ap.svg
Copyright: 2008, mystica
License: public-domain
Files: wpa_supplicant/wpa_gui-qt4/icons/group.svg
Copyright: 2009, Andrew Fitzsimon / Anonymous
License: public-domain
Files: wpa_supplicant/wpa_gui-qt4/icons/invitation.svg
Copyright: 2009, Jean Victor Balin
License: public-domain
Files: wpa_supplicant/wpa_gui-qt4/icons/laptop.svg
Copyright: 2008, metalmarious
License: public-domain
Files: wpa_supplicant/wpa_gui-qt4/icons/wpa_gui.svg
Copyright: 2008, Bernard Gray <bernard.gray@gmail.com>
License: BSD-3-clause or GPL-2
Files: wpa_supplicant/wpa_gui-qt4/peers.*
wpa_supplicant/wpa_gui-qt4/stringquery.*
Copyright: 2009-2010, Atheros Communications
License: BSD-3-clause
Files: wpa_supplicant/wpa_gui-qt4/signalbar.*
Copyright: 2011, Kel Modderman <kel@otaku42.de>
License: BSD-3-clause
Files: wpa_supplicant/Android.mk
wpa_supplicant/wpa_supplicant_conf.*
Copyright: 2008-2010, The Android Open Source Project
License: BSD-3-clause
Files: wpa_supplicant/ap.*
Copyright: 2003-2009, Jouni Malinen <j@w1.fi>
2009, Atheros Communications
License: BSD-3-clause
Files: wpa_supplicant/autoscan*
Copyright: 2012, Intel Corporation
License: BSD-3-clause
Files: wpa_supplicant/gas_query.*
wpa_supplicant/offchannel.*
wpa_supplicant/p2p_supplicant.*
wpa_supplicant/wifi_display.*
Copyright: 2009-2011, Atheros Communications
2011-2014, Qualcomm Atheros
2011-2014, Jouni Malinen <j@w1.fi>
License: BSD-3-clause
Files: wpa_supplicant/interworking.*
wpa_supplicant/wnm_sta.*
wpa_supplicant/wpas_kay.*
Copyright: 2011-2014, Qualcomm Atheros
2011-2014, Jouni Malinen <j@w1.fi>
License: BSD-3-clause
Files: debian/*
Copyright: 2004-2006, Kyle McMartin <kyle@debian.org>
2005-2009, Faidon Liambotis <paravoid@debian.org>
2006-2008, Reinhard Tartler <siretart@tauware.de>
2006-2012, Kel Modderman <kel@otaku42.de>
2010, Jan Dittberner <jandd@debian.org>
2010-2014, Stefan Lippers-Hollmann <s.l-h@gmx.de>
License: BSD-3-clause
License: BSD-3-clause
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. Neither the name(s) of the above-listed copyright holder(s) nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 THE COPYRIGHT
OWNER OR CONTRIBUTORS 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.
License: GPL-2
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
published by the Free Software Foundation.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
.
On Debian GNU/Linux systems, the complete text of the GNU General Public
License version 2 can be found in `/usr/share/common-licenses/GPL-2'.
.
Note that this distribution of hostapd comes with configuration options that
link it to the OpenSSL library. The OpenSSL license is GPL-incompatible,
therefore in this distribution only the BSD license applies.
License: ISC
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
License: public-domain
Minimal code for RSA support from LibTomMath 0.41
http://libtom.org/
http://libtom.org/files/ltm-0.41.tar.bz2
This library was released in public domain by Tom St Denis.
.
The combination in this file may not use all of the optimized algorithms
from LibTomMath and may be considerable slower than the LibTomMath with its
default settings. The main purpose of having this version here is to make it
easier to build bignum.c wrapper without having to install and build an
external library.

View File

@ -0,0 +1,92 @@
#!/bin/sh
set -e
if [ -n "${1}" ]; then
CURDIR="${1}"
else
echo "ERROR: not called with \$(CURDIR) parameter" >&2
exit 1
fi
# parse versions
VERSION="$(dpkg-parsechangelog -l${CURDIR}/debian/changelog | sed -ne 's,^Version: *\([0-9]*:\)\?\(.*\)$,\2,p')"
DEB_VER="$(echo ${VERSION} | sed 's,\-[0-9a-z\~\.]*,,')"
UP_VER="$(echo ${DEB_VER} | sed 's,\~,\-,g')"
SNAPDATE="$(echo ${DEB_VER} | sed 's/.*\+git\([0-9]*\).*/\1/')"
case "${UP_VER}" in
*+git[0-9\.]*+*)
UP_VER_TAG="$(echo $UP_VER | sed 's,.*+git[0-9\.]*+,,')"
;;
*)
UP_VER_TAG="hostap_$(echo $UP_VER | sed -e 's,\.,_,g' -e 's,\-,_,g')"
;;
esac
# set upstream (git-) Vcs
UP_VCS="git://w1.fi/srv/git/hostap.git"
if dpkg --compare-versions "${DEB_VER}" lt "2~"; then
UP_VCS="git://w1.fi/srv/git/hostap-1.git"
fi
# write to ../{,_}tarballs/, if it exists - ../ otherwise
if [ -d "${CURDIR}/../tarballs" ]; then
ORIG_TARBALL="${CURDIR}/../tarballs/wpa_${DEB_VER}.orig.tar.xz"
elif [ -d "${CURDIR}/../_tarballs" ]; then
ORIG_TARBALL="${CURDIR}/../_tarballs/wpa_${DEB_VER}.orig.tar.xz"
else
ORIG_TARBALL="${CURDIR}/../wpa_${DEB_VER}.orig.tar.xz"
fi
# don't overwrite existing tarballs
if [ -e "${ORIG_TARBALL}" ]; then
echo "ERROR: don't overwrite existing ${ORIG_TARBALL}" >&2
exit 2
fi
TEMP_SOURCE="$(mktemp -d --tmpdir wpa-orig-source.XXXXXXXXXX)"
if [ "$?" -ne 0 ] || [ -z "${TEMP_SOURCE}" ] || [ ! -d "${TEMP_SOURCE}" ]; then
echo "ERROR: failed to create temporary working directory" >&2
exit 3
fi
# clone upstream git repository
echo "clone ${UP_VCS}:"
git clone "${UP_VCS}" "${TEMP_SOURCE}"
if [ "$?" -ne 0 ] || [ ! -d "${TEMP_SOURCE}" ]; then
echo "ERROR: cloning ${UP_VCS} failed" >&2
rm -rf "${TEMP_SOURCE}"
exit 4
fi
# add CONTRIBUTIONS for wpa 2.2~
# (it's available since 2.0~, but only gets included in 2.2~)
if dpkg --compare-versions "${DEB_VER}" ge "2.2~"; then
CONTRIBUTIONS="CONTRIBUTIONS"
fi
# add Hotspot 2.0 OSU server for wpa 2.2~
if dpkg --compare-versions "${DEB_VER}" ge "2.2~"; then
HS20="hs20"
elif dpkg --compare-versions "${DEB_VER}" ge "2.1+" && [ "${SNAPDATE}" -ge "20140526" ]; then
HS20="hs20"
fi
# create new upstream tarball
cd "${TEMP_SOURCE}" && \
git archive \
--format=tar \
--prefix="wpa-${UP_VER}/" \
"${UP_VER_TAG}" \
README COPYING $CONTRIBUTIONS patches src wpa_supplicant hostapd $HS20 | \
xz -c6 > "${ORIG_TARBALL}"
if [ "$?" -ne 0 ] || [ ! -e "${ORIG_TARBALL}" ]; then
echo "ERROR: failure to create ${ORIG_TARBALL}" >&2
rm -rf "${TEMP_SOURCE}"
exit 5
else
echo "SUCCESS: New upstream tarball has been saved at ${ORIG_TARBALL}"
rm -rf "${TEMP_SOURCE}"
exit 0
fi

View File

@ -0,0 +1,38 @@
hostapd for Debian
------------------
This package provides two methods for managing hostapd process(es); an
initscript and an ifupdown hook. Both methods require creation of a
hostapd daemon configuration file (eg. /etc/hostapd/hostapd.conf) to
function correctly.
An example hostapd.conf may be used as a template but _must_ be edited
to suit your local configuration. An example is located at:
/usr/share/doc/hostapd/examples/hostapd.conf.gz
To use the example as a template:
# zcat /usr/share/doc/hostapd/examples/hostapd.conf.gz > \
/etc/hostapd/hostapd.conf
# $EDITOR /etc/hostapd/hostapd.conf
To use the initscript method of starting a hostapd daemon see
/etc/default/hostapd.
To use the ifupdown method, the path to hostapd configuration file can
be specified in a network interfaces configuration stanza in
/etc/network/interfaces like so:
iface eth1 inet static
hostapd /etc/hostapd/hostapd.conf
...
The hostapd process will be started in the pre-up phase of ifup, and be
terminated in the post-down phase of ifdown.
-- Kel Modderman <kel@otaku42.de> Tue, 27 Oct 2009 12:03:01 +1000
Please note:
* If you want to use hostapd with a Prism2/2.5/3 card in WPA mode, you'll need
STA firmware version >= 1.7.0.
-- Faidon Liambotis <faidon@cube.gr>, Mon, 10 Oct 2005 14:57:11 +0300

View File

@ -0,0 +1,20 @@
# Defaults for hostapd initscript
#
# See /usr/share/doc/hostapd/README.Debian for information about alternative
# methods of managing hostapd.
#
# Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
# file and hostapd will be started during system boot. An example configuration
# file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
#
#DAEMON_CONF=""
# Additional daemon options to be appended to hostapd command:-
# -d show more debug messages (-dd for even more)
# -K include key data in debug messages
# -t include timestamps in some debug messages
#
# Note that -B (daemon mode) and -P (pidfile) options are automatically
# configured by the init.d script and must not be added to DAEMON_OPTS.
#
#DAEMON_OPTS=""

View File

@ -0,0 +1,6 @@
hostapd/hostapd.accept
hostapd/hostapd.conf
hostapd/hostapd.deny
hostapd/hostapd.eap_user
hostapd/hostapd.radius_clients
hostapd/hostapd.wpa_psk

View File

@ -0,0 +1,67 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: hostapd
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Should-Start: $network
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Advanced IEEE 802.11 management daemon
# Description: Userspace IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP
# Authenticator
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON_SBIN=/usr/sbin/hostapd
DAEMON_DEFS=/etc/default/hostapd
DAEMON_CONF=
NAME=hostapd
DESC="advanced IEEE 802.11 management"
PIDFILE=/run/hostapd.pid
[ -x "$DAEMON_SBIN" ] || exit 0
[ -s "$DAEMON_DEFS" ] && . /etc/default/hostapd
[ -n "$DAEMON_CONF" ] || exit 0
DAEMON_OPTS="-B -P $PIDFILE $DAEMON_OPTS $DAEMON_CONF"
. /lib/lsb/init-functions
case "$1" in
start)
log_daemon_msg "Starting $DESC" "$NAME"
start-stop-daemon --start --oknodo --quiet --exec "$DAEMON_SBIN" \
--pidfile "$PIDFILE" -- $DAEMON_OPTS >/dev/null
log_end_msg "$?"
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
start-stop-daemon --stop --oknodo --quiet --exec "$DAEMON_SBIN" \
--pidfile "$PIDFILE"
log_end_msg "$?"
;;
reload)
log_daemon_msg "Reloading $DESC" "$NAME"
start-stop-daemon --stop --signal HUP --exec "$DAEMON_SBIN" \
--pidfile "$PIDFILE"
log_end_msg "$?"
;;
restart|force-reload)
$0 stop
sleep 8
$0 start
;;
status)
status_of_proc "$DAEMON_SBIN" "$NAME"
exit $?
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload|reload|status}" >&2
exit 1
;;
esac
exit 0

View File

@ -0,0 +1,2 @@
hostapd/hostapd usr/sbin/
hostapd/hostapd_cli usr/sbin/

View File

@ -0,0 +1,2 @@
etc/hostapd/ifupdown.sh /etc/network/if-pre-up.d/hostapd
etc/hostapd/ifupdown.sh /etc/network/if-post-down.d/hostapd

View File

@ -0,0 +1,2 @@
hostapd/hostapd.8
hostapd/hostapd_cli.1

View File

@ -0,0 +1,30 @@
#!/bin/sh
set -e
rm_conffile() {
local PKGNAME="$1"
local CONFFILE="$2"
[ -e "$CONFFILE" ] || return 0
local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')"
local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \
sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
if [ "$md5sum" = "$old_md5sum" ]; then
echo "Removing obsolete conffile $CONFFILE ..."
rm -f "$CONFFILE"
fi
}
case "$1" in
install|upgrade)
if dpkg --compare-versions "$2" le "1:0.6.9-3"; then
rm_conffile hostapd /etc/hostapd/hostapd.conf
fi
;;
esac
#DEBHELPER#
exit 0

View File

@ -0,0 +1,146 @@
#!/bin/sh
# Copyright (C) 2006-2009 Debian hostapd maintainers
# Faidon Liambotis <paravoid@debian.org>
# Kel Modderman <kel@otaku42.de>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# On Debian GNU/Linux systems, the text of the GPL license,
# version 2, can be found in /usr/share/common-licenses/GPL-2.
# quit if we're called for lo
if [ "$IFACE" = lo ]; then
exit 0
fi
if [ -n "$IF_HOSTAPD" ]; then
HOSTAPD_CONF="$IF_HOSTAPD"
else
exit 0
fi
HOSTAPD_BIN="/usr/sbin/hostapd"
HOSTAPD_PNAME="hostapd"
HOSTAPD_PIDFILE="/run/hostapd.$IFACE.pid"
HOSTAPD_OMIT_PIDFILE="/run/sendsigs.omit.d/hostapd.$IFACE.pid"
if [ ! -x "$HOSTAPD_BIN" ]; then
exit 0
fi
if [ "$VERBOSITY" = "1" ]; then
TO_NULL="/dev/stdout"
else
TO_NULL="/dev/null"
fi
hostapd_msg () {
case "$1" in
verbose)
shift
echo "$HOSTAPD_PNAME: $@" > "$TO_NULL"
;;
stderr)
shift
echo "$HOSTAPD_PNAME: $@" > /dev/stderr
;;
*)
;;
esac
}
test_hostapd_pidfile () {
if [ -n "$1" ] && [ -f "$2" ]; then
if start-stop-daemon --stop --quiet --signal 0 \
--exec "$1" --pidfile "$2"; then
return 0
else
rm -f "$2"
return 1
fi
else
return 1
fi
}
init_hostapd () {
HOSTAPD_OPTIONS="-B -P $HOSTAPD_PIDFILE $HOSTAPD_CONF"
HOSTAPD_MESSAGE="$HOSTAPD_BIN $HOSTAPD_OPTIONS"
test_hostapd_pidfile "$HOSTAPD_BIN" "$HOSTAPD_PIDFILE" && return 0
hostapd_msg verbose "$HOSTAPD_MESSAGE"
start-stop-daemon --start --oknodo --quiet --exec "$HOSTAPD_BIN" \
--pidfile "$HOSTAPD_PIDFILE" -- $HOSTAPD_OPTIONS > "$TO_NULL"
if [ "$?" -ne 0 ]; then
return "$?"
fi
HOSTAPD_PIDFILE_WAIT=0
until [ -s "$HOSTAPD_PIDFILE" ]; do
if [ "$HOSTAPD_PIDFILE_WAIT" -ge 5 ]; then
hostapd_msg stderr \
"timeout waiting for pid file creation"
return 1
fi
HOSTAPD_PIDFILE_WAIT=$(($HOSTAPD_PIDFILE_WAIT + 1))
sleep 1
done
cat "$HOSTAPD_PIDFILE" > "$HOSTAPD_OMIT_PIDFILE"
return 0
}
kill_hostapd () {
HOSTAPD_MESSAGE="stopping $HOSTAPD_PNAME via pidfile: $HOSTAPD_PIDFILE"
test_hostapd_pidfile "$HOSTAPD_BIN" "$HOSTAPD_PIDFILE" || return 0
hostapd_msg verbose "$HOSTAPD_MESSAGE"
start-stop-daemon --stop --oknodo --quiet --exec "$HOSTAPD_BIN" \
--pidfile "$HOSTAPD_PIDFILE" > "$TO_NULL"
[ "$HOSTAPD_OMIT_PIDFILE" ] && rm -f "$HOSTAPD_OMIT_PIDFILE"
}
case "$MODE" in
start)
case "$PHASE" in
pre-up)
init_hostapd || exit 1
;;
*)
hostapd_msg stderr "unknown phase: \"$PHASE\""
exit 1
;;
esac
;;
stop)
case "$PHASE" in
post-down)
kill_hostapd
;;
*)
hostapd_msg stderr "unknown phase: \"$PHASE\""
exit 1
;;
esac
;;
*)
hostapd_msg stderr "unknown mode: \"$MODE\""
exit 1
;;
esac
exit 0

View File

@ -0,0 +1,62 @@
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 82ac61d..3570d96 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -2795,6 +2795,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
}
#endif /* CONFIG_IEEE80211W */
#ifdef CONFIG_IEEE80211N
+ } else if (os_strcmp(buf, "noscan") == 0) {
+ conf->noscan = atoi(pos);
} else if (os_strcmp(buf, "ieee80211n") == 0) {
conf->ieee80211n = atoi(pos);
} else if (os_strcmp(buf, "ht_capab") == 0) {
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index de470a9..f2a0235 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -626,6 +626,7 @@ struct hostapd_config {
int ht_op_mode_fixed;
u16 ht_capab;
+ int noscan;
int ieee80211n;
int secondary_channel;
int no_pri_sec_switch;
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
index fc8786d..0d5b384 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
@@ -472,7 +472,7 @@ static int ieee80211n_check_40mhz(struct hostapd_iface *iface)
struct wpa_driver_scan_params params;
int ret;
- if (!iface->conf->secondary_channel)
+ if (!iface->conf->secondary_channel || iface->conf->noscan)
return 0; /* HT40 not used */
hostapd_set_state(iface, HAPD_IFACE_HT_SCAN);
diff --git a/src/ap/ieee802_11_ht.c b/src/ap/ieee802_11_ht.c
index 11fde2a..87fb67b 100644
--- a/src/ap/ieee802_11_ht.c
+++ b/src/ap/ieee802_11_ht.c
@@ -221,6 +221,9 @@ void hostapd_2040_coex_action(struct hostapd_data *hapd,
if (!(iface->conf->ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET))
return;
+ if (iface->conf->noscan)
+ return;
+
if (len < IEEE80211_HDRLEN + 2 + sizeof(*bc_ie))
return;
@@ -345,6 +348,9 @@ void ht40_intolerant_add(struct hostapd_iface *iface, struct sta_info *sta)
if (iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G)
return;
+ if (iface->conf->noscan)
+ return;
+
wpa_printf(MSG_INFO, "HT: Forty MHz Intolerant is set by STA " MACSTR
" in Association Request", MAC2STR(sta->addr));

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,3 @@
session-ticket.patch
300-noscan.patch
realtek.patch

View File

@ -0,0 +1,21 @@
From: Jeremy Nickurak <jeremy@nickurak.ca>
Subject: Disable the session ticket TLS extension.
Bug-ubuntu: https://bugs.launchpad.net/ubuntu/+source/wpasupplicant/+bug/969343
Bug: http://w1.fi/bugz/show_bug.cgi?id=447
---
src/crypto/tls_openssl.c | 1 +
1 file changed, 1 insertion(+)
Index: b/src/crypto/tls_openssl.c
===================================================================
--- a/src/crypto/tls_openssl.c
+++ b/src/crypto/tls_openssl.c
@@ -1060,6 +1060,7 @@ struct tls_connection * tls_connection_i
#ifdef SSL_OP_NO_COMPRESSION
options |= SSL_OP_NO_COMPRESSION;
#endif /* SSL_OP_NO_COMPRESSION */
+ options |= SSL_OP_NO_TICKET;
SSL_set_options(conn->ssl, options);
conn->ssl_in = BIO_new(BIO_s_mem());

View File

@ -0,0 +1,67 @@
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
include /usr/share/dpkg/buildflags.mk
# The build system doesn't use CPPFLAGS, pass them to CFLAGS/CXXFLAGS to
# enable the missing (hardening) flags
DEB_CFLAGS_MAINT_APPEND = -MMD -Wall $(shell dpkg-buildflags --get CPPFLAGS)
DEB_CXXFLAGS_MAINT_APPEND = $(shell dpkg-buildflags --get CPPFLAGS)
DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
export DEB_CFLAGS_MAINT_APPEND DEB_CXXFLAGS_MAINT_APPEND DEB_LDFLAGS_MAINT_APPEND
UCFLAGS = -MMD -Wall -g -Os -fPIC
BINDIR = /sbin
V = 1
DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
CC=$(DEB_HOST_GNU_TYPE)-gcc
endif
export CC BINDIR V
VERSION := $(shell dpkg-parsechangelog | sed -ne 's,^Version: *\([0-9]*:\)\?\(.*\)$$,\2,p')
override_dh_auto_build:
# build hostapd
cp -v --remove-destination debian/config/config_realtek hostapd/.config
dh_auto_build --sourcedirectory=hostapd \
--buildsystem=makefile \
--parallel
dh_auto_clean --sourcedirectory=src --buildsystem=makefile
override_dh_auto_clean:
dh_auto_clean --sourcedirectory=hostapd \
--buildsystem=makefile
override_dh_auto_install:
$(info Skip dh_auto_install ...)
override_dh_clean:
dh_clean hostapd/.config
override_dh_install:
dh_install
install --mode=755 -D debian/ifupdown/hostapd.sh \
debian/hostapd-realtek/etc/hostapd/ifupdown.sh
override_dh_installchangelogs:
dh_installchangelogs --package=hostapd-realtek hostapd/ChangeLog
override_dh_gencontrol:
dh_gencontrol -phostapd-realtek -- '-v1:$(VERSION)'
dh_gencontrol --remaining-packages
override_dh_builddeb:
dh_builddeb -- -Zxz -z6
### end dh overrides
%:
dh ${@} --parallel
get-orig-source:
chmod +x $(CURDIR)/debian/get-orig-source
$(CURDIR)/debian/get-orig-source $(CURDIR)

View File

@ -0,0 +1 @@
3.0 (quilt)

View File

@ -0,0 +1,2 @@
compression = "xz"
compression-level = 6

View File

@ -31,6 +31,8 @@ Depends: ${shlibs:Depends},
${misc:Depends},
lsb-base
Breaks: initscripts (<< 2.88dsf-13.3)
Provides: hostapd
Conflicts: hostapd-realtek
Description: IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
Originally, hostapd was an optional user space component for Host AP
driver. It adds more features to the basic IEEE 802.11 management

View File

@ -1,651 +0,0 @@
diff --git a/hostapd/main.c b/hostapd/main.c
index a9d7da5..2457f95 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -412,7 +412,7 @@ static int hostapd_global_run(struct hapd_interfaces *ifaces, int daemonize,
static void show_version(void)
{
fprintf(stderr,
- "hostapd v" VERSION_STR "\n"
+ "hostapd v" VERSION_STR " for Realtek rtl871xdrv\n"
"User space daemon for IEEE 802.11 AP management,\n"
"IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator\n"
"Copyright (c) 2002-2014, Jouni Malinen <j@w1.fi> "
diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index 2a4acf2..20d7451 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -810,6 +810,11 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
#ifdef CONFIG_IEEE80211N
tailpos = hostapd_eid_ht_capabilities(hapd, tailpos);
tailpos = hostapd_eid_ht_operation(hapd, tailpos);
+
+ //DRIVER_RTW ADD
+ if(hapd->iconf->ieee80211n)
+ hapd->conf->wmm_enabled = 1;
+
#endif /* CONFIG_IEEE80211N */
tailpos = hostapd_eid_ext_capab(hapd, tailpos);
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
index 4e66d1b..620f246 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
@@ -712,7 +712,10 @@ static int ieee80211n_check_40mhz(struct hostapd_iface *iface)
iface->num_ht40_scan_tries = 1;
eloop_cancel_timeout(ap_ht40_scan_retry, iface, NULL);
eloop_register_timeout(1, 0, ap_ht40_scan_retry, iface, NULL);
- return 1;
+
+ //DRIVER_RTW Modify
+ //return -1;
+ return 0;//ignore this error
}
if (ret < 0) {
diff --git a/src/drivers/driver_bsd.c b/src/drivers/driver_bsd.c
index ca64d5c..05606f0 100644
--- a/src/drivers/driver_bsd.c
+++ b/src/drivers/driver_bsd.c
@@ -47,6 +47,12 @@
#include "l2_packet/l2_packet.h"
+#ifdef HOSTAPD
+#ifdef CONFIG_SUPPORT_RTW_DRIVER
+#define RTW_BSD_HOSTAPD_SET_BEACON (1100)
+#endif
+#endif
+
struct bsd_driver_data {
struct hostapd_data *hapd; /* back pointer */
@@ -792,6 +798,296 @@ handle_read(void *ctx, const u8 *src_addr, const u8 *buf, size_t len)
drv_event_eapol_rx(drv->hapd, src_addr, buf, len);
}
+#ifdef CONFIG_SUPPORT_RTW_DRIVER
+static int rtw_set_beacon_ops(void *priv, const u8 *head, size_t head_len,
+ const u8 *tail, size_t tail_len, int dtim_period,
+ int beacon_int)
+{
+ int ret=0;
+ u8 *pbuf;
+ size_t sz;
+ struct bsd_driver_data *drv = priv;
+
+ if((head_len<24) ||(!head))
+ return -1;
+
+ sz = head_len+tail_len - 24; // 24 = wlan hdr
+
+ printf("%s, beacon_sz=%d\n", __func__, sz);
+
+ pbuf = os_zalloc(sz);
+ if (pbuf == NULL) {
+ return -ENOMEM;
+ }
+
+ os_memcpy(pbuf, (head+24), (head_len-24));// 24=beacon header len.
+
+ os_memcpy(&pbuf[head_len-24], tail, tail_len);
+
+ ret = set80211var(drv, RTW_BSD_HOSTAPD_SET_BEACON, pbuf, sz);
+
+ os_free(pbuf);
+
+ return ret;
+
+}
+
+static struct hostapd_hw_modes *rtw_get_hw_feature_data_ops(
+ void *priv, u16 *num_modes, u16 *flags)
+{
+
+#define MAX_NUM_CHANNEL (14)
+#define MAX_NUM_CHANNEL_5G (24)
+
+ struct hostapd_hw_modes *modes;
+ size_t i;
+ int k;
+
+ printf("%s\n", __func__);
+
+ *num_modes = 3;
+ *flags = 0;
+
+ modes = os_zalloc(*num_modes * sizeof(struct hostapd_hw_modes));
+ if (modes == NULL)
+ return NULL;
+
+ //.1
+ modes[0].mode = HOSTAPD_MODE_IEEE80211G;
+ modes[0].num_channels = MAX_NUM_CHANNEL;
+ modes[0].num_rates = 12;
+ modes[0].channels =
+ os_zalloc(MAX_NUM_CHANNEL * sizeof(struct hostapd_channel_data));
+ modes[0].rates = os_zalloc(modes[0].num_rates * sizeof(int));
+ if (modes[0].channels == NULL || modes[0].rates == NULL)
+ goto fail;
+ for (i = 0; i < MAX_NUM_CHANNEL; i++) {
+ modes[0].channels[i].chan = i + 1;
+ modes[0].channels[i].freq = 2412 + 5 * i;
+ modes[0].channels[i].flag = 0;
+ if (i >= 13)
+ modes[0].channels[i].flag = HOSTAPD_CHAN_DISABLED;
+ }
+ modes[0].rates[0] = 10;
+ modes[0].rates[1] = 20;
+ modes[0].rates[2] = 55;
+ modes[0].rates[3] = 110;
+ modes[0].rates[4] = 60;
+ modes[0].rates[5] = 90;
+ modes[0].rates[6] = 120;
+ modes[0].rates[7] = 180;
+ modes[0].rates[8] = 240;
+ modes[0].rates[9] = 360;
+ modes[0].rates[10] = 480;
+ modes[0].rates[11] = 540;
+
+
+ //.2
+ modes[1].mode = HOSTAPD_MODE_IEEE80211B;
+ modes[1].num_channels = MAX_NUM_CHANNEL;
+ modes[1].num_rates = 4;
+ modes[1].channels =
+ os_zalloc(MAX_NUM_CHANNEL * sizeof(struct hostapd_channel_data));
+ modes[1].rates = os_zalloc(modes[1].num_rates * sizeof(int));
+ if (modes[1].channels == NULL || modes[1].rates == NULL)
+ goto fail;
+ for (i = 0; i < MAX_NUM_CHANNEL; i++) {
+ modes[1].channels[i].chan = i + 1;
+ modes[1].channels[i].freq = 2412 + 5 * i;
+ modes[1].channels[i].flag = 0;
+ if (i >= 11)
+ modes[1].channels[i].flag = HOSTAPD_CHAN_DISABLED;
+ }
+ modes[1].rates[0] = 10;
+ modes[1].rates[1] = 20;
+ modes[1].rates[2] = 55;
+ modes[1].rates[3] = 110;
+
+
+ //.3
+ modes[2].mode = HOSTAPD_MODE_IEEE80211A;
+#ifdef CONFIG_DRIVER_RTL_DFS
+ modes[2].num_channels = MAX_NUM_CHANNEL_5G;
+#else /* CONFIG_DRIVER_RTL_DFS */
+ modes[2].num_channels = 9;
+#endif /* CONFIG_DRIVER_RTL_DFS */
+
+ modes[2].num_rates = 8;
+ modes[2].channels = os_zalloc(modes[2].num_channels * sizeof(struct hostapd_channel_data));
+ modes[2].rates = os_zalloc(modes[2].num_rates * sizeof(int));
+ if (modes[2].channels == NULL || modes[2].rates == NULL)
+ goto fail;
+
+
+ k = 0;
+ // 5G band1 Channel: 36, 40, 44, 48
+ for (i=0; i < 4; i++) {
+ modes[2].channels[k].chan = 36+(i*4);
+ modes[2].channels[k].freq = 5180+(i*20);
+ modes[2].channels[k].flag = 0;
+ k++;
+ }
+
+#ifdef CONFIG_DRIVER_RTL_DFS
+ // 5G band2 Channel: 52, 56, 60, 64
+ for (i=0; i < 4; i++) {
+ modes[2].channels[k].chan = 52+(i*4);
+ modes[2].channels[k].freq = 5260+(i*20);
+ modes[2].channels[k].flag = 0;
+ k++;
+ }
+
+ // 5G band3 Channel: 100, 104, 108. 112, 116, 120, 124, 128, 132, 136, 140
+ for (i=0; i < 11; i++) {
+ modes[2].channels[k].chan = 100+(i*4);
+ modes[2].channels[k].freq = 5500+(i*20);
+ modes[2].channels[k].flag = 0;
+ k++;
+ }
+#endif /* CONFIG_DRIVER_RTL_DFS */
+
+ // 5G band4 Channel: 149, 153, 157, 161, 165
+ for (i=0; i < 5; i++) {
+ modes[2].channels[k].chan = 149+(i*4);
+ modes[2].channels[k].freq = 5745+(i*20);
+ modes[2].channels[k].flag = 0;
+ k++;
+ }
+
+ modes[2].rates[0] = 60;
+ modes[2].rates[1] = 90;
+ modes[2].rates[2] = 120;
+ modes[2].rates[3] = 180;
+ modes[2].rates[4] = 240;
+ modes[2].rates[5] = 360;
+ modes[2].rates[6] = 480;
+ modes[2].rates[7] = 540;
+
+
+ //
+#if 0
+#define HT_CAP_INFO_LDPC_CODING_CAP ((u16) BIT(0))
+#define HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET ((u16) BIT(1))
+#define HT_CAP_INFO_SMPS_MASK ((u16) (BIT(2) | BIT(3)))
+#define HT_CAP_INFO_SMPS_STATIC ((u16) 0)
+#define HT_CAP_INFO_SMPS_DYNAMIC ((u16) BIT(2))
+#define HT_CAP_INFO_SMPS_DISABLED ((u16) (BIT(2) | BIT(3)))
+#define HT_CAP_INFO_GREEN_FIELD ((u16) BIT(4))
+#define HT_CAP_INFO_SHORT_GI20MHZ ((u16) BIT(5))
+#define HT_CAP_INFO_SHORT_GI40MHZ ((u16) BIT(6))
+#define HT_CAP_INFO_TX_STBC ((u16) BIT(7))
+#define HT_CAP_INFO_RX_STBC_MASK ((u16) (BIT(8) | BIT(9)))
+#define HT_CAP_INFO_RX_STBC_1 ((u16) BIT(8))
+#define HT_CAP_INFO_RX_STBC_12 ((u16) BIT(9))
+#define HT_CAP_INFO_RX_STBC_123 ((u16) (BIT(8) | BIT(9)))
+#define HT_CAP_INFO_DELAYED_BA ((u16) BIT(10))
+#define HT_CAP_INFO_MAX_AMSDU_SIZE ((u16) BIT(11))
+#define HT_CAP_INFO_DSSS_CCK40MHZ ((u16) BIT(12))
+#define HT_CAP_INFO_PSMP_SUPP ((u16) BIT(13))
+#define HT_CAP_INFO_40MHZ_INTOLERANT ((u16) BIT(14))
+#define HT_CAP_INFO_LSIG_TXOP_PROTECT_SUPPORT ((u16) BIT(15))
+#endif
+
+ //HOSTAPD_MODE_IEEE80211G
+ modes[0].ht_capab = HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET|HT_CAP_INFO_SHORT_GI20MHZ|
+ HT_CAP_INFO_SHORT_GI40MHZ|HT_CAP_INFO_MAX_AMSDU_SIZE|HT_CAP_INFO_DSSS_CCK40MHZ;
+
+ modes[0].mcs_set[0]= 0xff;
+ modes[0].mcs_set[1]= 0xff;
+
+ //HOSTAPD_MODE_IEEE80211B
+ modes[1].ht_capab = 0;
+
+ //HOSTAPD_MODE_IEEE80211A
+ modes[2].ht_capab = modes[0].ht_capab;
+
+ modes[2].mcs_set[0]= 0xff;
+ modes[2].mcs_set[1]= 0xff;
+
+ return modes;
+
+fail:
+ if (modes) {
+ for (i = 0; i < *num_modes; i++) {
+ os_free(modes[i].channels);
+ os_free(modes[i].rates);
+ }
+ os_free(modes);
+ }
+
+ return NULL;
+
+}
+
+#if 0
+#define IEEE80211_FC0_TYPE_MASK 0x0c
+#define IEEE80211_FC0_TYPE_SHIFT 2
+#define IEEE80211_FC0_TYPE_MGT 0x00
+#define IEEE80211_FC0_TYPE_CTL 0x04
+#define IEEE80211_FC0_TYPE_DATA 0x08
+#define IEEE80211_FC0_SUBTYPE_MASK 0xf0
+#define IEEE80211_FC0_SUBTYPE_SHIFT 4
+#define IEEE80211_FC0_SUBTYPE_ASSOC_REQ 0x00
+#define IEEE80211_FC0_SUBTYPE_ASSOC_RESP 0x10
+#define IEEE80211_FC0_SUBTYPE_REASSOC_REQ 0x20
+#define IEEE80211_FC0_SUBTYPE_REASSOC_RESP 0x30
+#define IEEE80211_FC0_SUBTYPE_PROBE_REQ 0x40
+#define IEEE80211_FC0_SUBTYPE_PROBE_RESP 0x50
+#define IEEE80211_FC0_SUBTYPE_BEACON 0x80
+#define IEEE80211_FC0_SUBTYPE_ATIM 0x90
+#define IEEE80211_FC0_SUBTYPE_DISASSOC 0xa0
+#define IEEE80211_FC0_SUBTYPE_AUTH 0xb0
+#define IEEE80211_FC0_SUBTYPE_DEAUTH 0xc0
+#define IEEE80211_FC0_SUBTYPE_ACTION 0xd0
+#define IEEE80211_FC0_SUBTYPE_ACTION_NOACK 0xe0
+
+#define IEEE80211_APPIE_WPA (IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_BEACON | \
+ IEEE80211_FC0_SUBTYPE_PROBE_RESP)
+
+#endif
+
+#define RTW_IEEE80211_APPIE_BEACON (IEEE80211_FC0_TYPE_MGT|IEEE80211_FC0_SUBTYPE_BEACON)
+#define RTW_IEEE80211_APPIE_PROBE_RESP (IEEE80211_FC0_TYPE_MGT|IEEE80211_FC0_SUBTYPE_PROBE_RESP)
+#define RTW_IEEE80211_APPIE_ASSOC_RESP (IEEE80211_FC0_TYPE_MGT|IEEE80211_FC0_SUBTYPE_ASSOC_RESP)
+
+
+static int rtw_set_wps_assoc_resp_ie(void *priv, const void *ie, size_t len)
+{
+ return bsd_set80211(priv, IEEE80211_IOC_APPIE, RTW_IEEE80211_APPIE_ASSOC_RESP,
+ ie, len);
+}
+
+static int rtw_set_wps_beacon_ie(void *priv, const void *ie, size_t len)
+{
+ return bsd_set80211(priv, IEEE80211_IOC_APPIE, RTW_IEEE80211_APPIE_BEACON,
+ ie, len);
+}
+
+static int rtw_set_wps_probe_resp_ie(void *priv, const void *ie, size_t len)
+{
+ return bsd_set80211(priv, IEEE80211_IOC_APPIE, RTW_IEEE80211_APPIE_PROBE_RESP,
+ ie, len);
+}
+
+static int rtw_set_ap_wps_ie_ops(void *priv, const struct wpabuf *beacon,
+ const struct wpabuf *proberesp, const struct wpabuf *assocresp)
+{
+ if (rtw_set_wps_assoc_resp_ie(priv, assocresp ? wpabuf_head(assocresp) : NULL,
+ assocresp ? wpabuf_len(assocresp) : 0))
+ return -1;
+
+ if (rtw_set_wps_beacon_ie(priv, beacon ? wpabuf_head(beacon) : NULL,
+ beacon ? wpabuf_len(beacon) : 0))
+ return -1;
+
+ return rtw_set_wps_probe_resp_ie(priv,
+ proberesp ? wpabuf_head(proberesp) : NULL,
+ proberesp ? wpabuf_len(proberesp): 0);
+
+}
+#endif
+
+
static void *
bsd_init(struct hostapd_data *hapd, struct wpa_init_params *params)
{
@@ -844,6 +1140,12 @@ bsd_init(struct hostapd_data *hapd, struct wpa_init_params *params)
goto bad;
}
+#ifdef CONFIG_SUPPORT_RTW_DRIVER
+ /* mark up after init */
+ if (bsd_ctrl_iface(drv, 1) < 0)
+ goto bad;
+#endif
+
return drv;
bad:
if (drv->sock_xmit != NULL)
@@ -1282,6 +1584,15 @@ wpa_driver_bsd_event_receive(int sock, void *ctx, void *sock_ctx)
event.interface_status.ifname);
wpa_supplicant_event(ctx, EVENT_INTERFACE_STATUS, &event);
}
+ else{
+ os_strlcpy(event.interface_status.ifname, drv->ifname,
+ sizeof(event.interface_status.ifname));
+ event.interface_status.ievent = EVENT_INTERFACE_ADDED;
+ wpa_printf(MSG_DEBUG, "RTM_IFINFO: Interface '%s' UP",
+ event.interface_status.ifname);
+ wpa_supplicant_event(ctx, EVENT_INTERFACE_STATUS, &event);
+ }
+
break;
}
}
@@ -1594,7 +1905,52 @@ wpa_driver_bsd_get_capa(void *priv, struct wpa_driver_capa *capa)
}
#endif /* HOSTAPD */
-
+#ifdef CONFIG_SUPPORT_RTW_DRIVER
+const struct wpa_driver_ops wpa_driver_bsd_ops = {
+ .name = "bsd",
+ .desc = "BSD 802.11 support",
+#ifdef HOSTAPD
+ .hapd_init = bsd_init,
+ .hapd_deinit = bsd_deinit,
+ .set_privacy = bsd_set_privacy,//del ?
+ .get_seqnum = bsd_get_seqnum,//del ?
+ .flush = bsd_flush,
+ .read_sta_data = bsd_read_sta_driver_data,//del ?
+ .sta_disassoc = bsd_sta_disassoc,
+ .sta_deauth = bsd_sta_deauth,
+ .get_hw_feature_data = rtw_get_hw_feature_data_ops,//add
+ //.sta_remove = rtl871x_sta_remove_ops,//add
+ .set_beacon = rtw_set_beacon_ops, //add
+ .set_ap_wps_ie = rtw_set_ap_wps_ie_ops,//add
+#else /* HOSTAPD */
+ .init = wpa_driver_bsd_init,
+ .deinit = wpa_driver_bsd_deinit,
+ .get_bssid = wpa_driver_bsd_get_bssid,
+ .get_ssid = wpa_driver_bsd_get_ssid,
+ .set_countermeasures = wpa_driver_bsd_set_countermeasures,
+ .scan2 = wpa_driver_bsd_scan,
+ .get_scan_results2 = wpa_driver_bsd_get_scan_results2,
+ .deauthenticate = wpa_driver_bsd_deauthenticate,
+ .disassociate = wpa_driver_bsd_disassociate,
+ .associate = wpa_driver_bsd_associate,
+ .get_capa = wpa_driver_bsd_get_capa,
+ .set_freq = bsd_set_freq, //only for wpa_supplicant
+ .set_ieee8021x = bsd_set_ieee8021x,//only for wpa_supplicant
+ .hapd_set_ssid = bsd_set_ssid,//only for wpa_supplicant
+ .hapd_get_ssid = bsd_get_ssid,//only for wpa_supplicant
+ .sta_set_flags = bsd_set_sta_authorized, //only for wpa_supplicant
+ .set_generic_elem = bsd_set_opt_ie, //only for wpa_supplicant
+#endif /* HOSTAPD */
+ //.set_freq = bsd_set_freq, //only for wpa_supplicant
+ .set_key = bsd_set_key,
+ //.set_ieee8021x = bsd_set_ieee8021x, //only for wpa_supplicant
+ //.hapd_set_ssid = bsd_set_ssid, //only for wpa_supplicant
+ //.hapd_get_ssid = bsd_get_ssid, //only for wpa_supplicant
+ .hapd_send_eapol = bsd_send_eapol, //only for wpa_supplicant
+ //.sta_set_flags = bsd_set_sta_authorized, //only for wpa_supplicant
+ //.set_generic_elem = bsd_set_opt_ie, //only for wpa_supplicant
+};
+#else
const struct wpa_driver_ops wpa_driver_bsd_ops = {
.name = "bsd",
.desc = "BSD 802.11 support",
@@ -1629,3 +1985,4 @@ const struct wpa_driver_ops wpa_driver_bsd_ops = {
.hapd_send_eapol = bsd_send_eapol,
.set_generic_elem = bsd_set_opt_ie,
};
+#endif
diff --git a/src/drivers/driver_wext.c b/src/drivers/driver_wext.c
index e5734bd..80f073d 100644
--- a/src/drivers/driver_wext.c
+++ b/src/drivers/driver_wext.c
@@ -990,6 +990,38 @@ void wpa_driver_wext_scan_timeout(void *eloop_ctx, void *timeout_ctx)
wpa_supplicant_event(timeout_ctx, EVENT_SCAN_RESULTS, NULL);
}
+//added for wps2.0 @20110519
+static int wpa_driver_wext_set_probe_req_ie(struct wpa_driver_wext_data *drv, const u8 *extra_ies,
+ size_t extra_ies_len)
+{
+ unsigned char *pbuf;
+ struct iwreq iwr;
+ int ret = 0;
+
+ pbuf = os_malloc(extra_ies_len);
+ os_memset(pbuf, 0, extra_ies_len);
+
+ os_memset(&iwr, 0, sizeof(iwr));
+ os_strlcpy(iwr.ifr_name, drv->ifname, IFNAMSIZ);
+
+ os_memcpy(pbuf, extra_ies, extra_ies_len);
+
+ iwr.u.data.pointer = (caddr_t)pbuf;
+ iwr.u.data.length = extra_ies_len;
+ iwr.u.data.flags = 0x8766;//magic number
+
+ if (ioctl(drv->ioctl_sock, SIOCSIWPRIV, &iwr) < 0) {
+ perror("ioctl[SIOCSIWMLME]");
+ ret = -1;
+ }
+
+ if(pbuf)
+ os_free(pbuf);
+
+ return ret;
+
+}
+
/**
* wpa_driver_wext_scan - Request the driver to initiate scan
@@ -1012,6 +1044,10 @@ int wpa_driver_wext_scan(void *priv, struct wpa_driver_scan_params *params)
return -1;
}
+ //added for wps2.0 @20110519
+ wpa_driver_wext_set_probe_req_ie(drv, params->extra_ies,
+ params->extra_ies_len);
+
os_memset(&iwr, 0, sizeof(iwr));
os_strlcpy(iwr.ifr_name, drv->ifname, IFNAMSIZ);
@@ -2315,6 +2351,28 @@ static const char * wext_get_radio_name(void *priv)
return drv->phyname;
}
+// Aries 20120120, append rssi information at the end of "status" command
+int wext_signal_poll(void *priv, struct wpa_signal_info *signal_info)
+{
+ struct wpa_driver_wext_data *drv = priv;
+ struct iwreq iwr;
+ struct iw_statistics stat;
+ int ret = 0;
+
+ os_memset(&iwr, 0, sizeof(iwr));
+ os_memset(&stat, 0, sizeof(stat));
+ os_strlcpy(iwr.ifr_name, drv->ifname, IFNAMSIZ);
+ iwr.u.data.pointer = (caddr_t) &stat;
+ iwr.u.data.length = sizeof(struct iw_statistics);
+ iwr.u.data.flags = 1;
+ if (ioctl(drv->ioctl_sock, SIOCGIWSTATS, &iwr) < 0) {
+ perror("ioctl[SIOCGIWSTATS] fail\n");
+ ret = -1;
+ }
+ signal_info->current_signal = stat.qual.level;
+ signal_info->current_noise = stat.qual.noise;
+ return ret;
+}
const struct wpa_driver_ops wpa_driver_wext_ops = {
.name = "wext",
diff --git a/src/drivers/drivers.c b/src/drivers/drivers.c
index d0e42ec..d413c00 100644
--- a/src/drivers/drivers.c
+++ b/src/drivers/drivers.c
@@ -51,6 +51,9 @@ extern struct wpa_driver_ops wpa_driver_atheros_ops; /* driver_atheros.c */
#ifdef CONFIG_DRIVER_NONE
extern struct wpa_driver_ops wpa_driver_none_ops; /* driver_none.c */
#endif /* CONFIG_DRIVER_NONE */
+#ifdef CONFIG_DRIVER_RTW
+extern struct wpa_driver_ops wpa_driver_rtw_ops; /* driver_rtw.c */
+#endif /* CONFIG_DRIVER_RTW */
struct wpa_driver_ops *wpa_drivers[] =
@@ -94,5 +97,8 @@ struct wpa_driver_ops *wpa_drivers[] =
#ifdef CONFIG_DRIVER_NONE
&wpa_driver_none_ops,
#endif /* CONFIG_DRIVER_NONE */
+#ifdef CONFIG_DRIVER_RTW
+ &wpa_driver_rtw_ops,
+#endif /* CONFIG_DRIVER_RTW */
NULL
};
diff --git a/src/drivers/drivers.mak b/src/drivers/drivers.mak
index 7e175f4..b5881db 100644
--- a/src/drivers/drivers.mak
+++ b/src/drivers/drivers.mak
@@ -58,6 +58,10 @@ DRV_CFLAGS += -DCONFIG_DRIVER_BSD
DRV_OBJS += ../src/drivers/driver_bsd.o
CONFIG_L2_FREEBSD=y
CONFIG_DNET_PCAP=y
+ifdef CONFIG_SUPPORT_RTW_DRIVER
+DRV_CFLAGS += -DCONFIG_SUPPORT_RTW_DRIVER -DCONFIG_DRIVER_RTL_DFS
+NEED_AP_MLME=y
+endif
endif
ifdef CONFIG_DRIVER_OPENBSD
@@ -74,6 +78,17 @@ DRV_OBJS += ../src/drivers/driver_test.o
NEED_AP_MLME=y
endif
+ifdef CONFIG_DRIVER_RTW
+#CFLAGS += -DCONFIG_DRIVER_RTL
+#OBJS += driver_rtl.o
+DRV_AP_CFLAGS += -DCONFIG_DRIVER_RTW -DCONFIG_DRIVER_RTL_DFS
+DRV_AP_OBJS += ../src/drivers/driver_rtw.o
+CONFIG_L2_PACKET=linux
+NEED_NETLINK=y
+NEED_LINUX_IOCTL=y
+NEED_AP_MLME=y
+endif
+
ifdef CONFIG_DRIVER_NONE
DRV_CFLAGS += -DCONFIG_DRIVER_NONE
DRV_OBJS += ../src/drivers/driver_none.o
diff --git a/src/eap_peer/eap_wsc.c b/src/eap_peer/eap_wsc.c
index 23e9823..173e71d 100644
--- a/src/eap_peer/eap_wsc.c
+++ b/src/eap_peer/eap_wsc.c
@@ -566,8 +566,13 @@ send_msg:
r = eap_wsc_build_msg(data, ret, id);
if (data->state == FAIL && ret->methodState == METHOD_DONE) {
/* Use reduced client timeout for WPS to avoid long wait */
+#if 0 /* Aries add, 2012/06/12, extend timeout for AP IOT */
+ if (sm->ClientTimeout > 4)
+ sm->ClientTimeout = 4;
+#else
if (sm->ClientTimeout > 2)
sm->ClientTimeout = 2;
+#endif
}
return r;
}
diff --git a/src/wps/wps.c b/src/wps/wps.c
index 648cfd1..0a74d0c 100644
--- a/src/wps/wps.c
+++ b/src/wps/wps.c
@@ -320,11 +320,15 @@ int wps_is_addr_authorized(const struct wpabuf *msg, const u8 *addr,
if (wps_parse_msg(msg, &attr) < 0)
return 0;
+ return is_selected_pin_registrar(&attr);
+// Marked by Albert 2011/11/17
+// Some APs won't carry the AuthorizedMACs in the probe response.
+// So, skip this check will speed up the process to find the current AP out for WPS handshake.
+/*
if (!attr.version2 && ver1_compat) {
/*
* Version 1.0 AP - AuthorizedMACs not used, so revert back to
* old mechanism of using SelectedRegistrar.
- */
return is_selected_pin_registrar(&attr);
}
@@ -341,6 +345,7 @@ int wps_is_addr_authorized(const struct wpabuf *msg, const u8 *addr,
}
return 0;
+*/
}
diff --git a/src/wps/wps_registrar.c b/src/wps/wps_registrar.c
index b917e6b..4738fd5 100644
--- a/src/wps/wps_registrar.c
+++ b/src/wps/wps_registrar.c
@@ -589,9 +589,10 @@ static int wps_build_probe_config_methods(struct wps_registrar *reg,
* These are the methods that the AP supports as an Enrollee for adding
* external Registrars.
*/
- methods = reg->wps->config_methods & ~WPS_CONFIG_PUSHBUTTON;
- methods &= ~(WPS_CONFIG_VIRT_PUSHBUTTON |
- WPS_CONFIG_PHY_PUSHBUTTON);
+ methods = reg->wps->config_methods;
+ //methods = reg->wps->config_methods & ~WPS_CONFIG_PUSHBUTTON;
+ //methods &= ~(WPS_CONFIG_VIRT_PUSHBUTTON |
+ // WPS_CONFIG_PHY_PUSHBUTTON);
wpa_printf(MSG_DEBUG, "WPS: * Config Methods (%x)", methods);
wpabuf_put_be16(msg, ATTR_CONFIG_METHODS);
wpabuf_put_be16(msg, 2);

View File

@ -4,8 +4,8 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
override_dh_autoreconf:
dh_autoreconf --with-xorg-module-dir="/usr/lib/xorg/modules"
override_dh_auto_configure:
dh_auto_configure -- --prefix=/usr --with-xorg-module-dir="/usr/lib/xorg/modules"
override_dh_auto_install:
dh_auto_install

View File

@ -42,7 +42,7 @@ cleaning()
display_alert "Cleaning $DEST/debs for" "$BOARD $BRANCH" "info"
# easier than dealing with variable expansion and escaping dashes in file names
find $DEST/debs -name '*.deb' | grep -E "${CHOSEN_KERNEL/image/.*}|$CHOSEN_UBOOT" | xargs rm -f
[[ -n $RELEASE ]] && rm -f $DEST/debs/$RELEASE/${CHOSEN_ROOTFS}_${REVISION}_${ARCH}.deb
[[ -n $RELEASE ]] && rm -f $DEST/debs/$RELEASE/${CHOSEN_ROOTFS}_*_${ARCH}.deb
fi
;;

View File

@ -52,9 +52,6 @@ if [[ -z $ver1 || $ver1 -lt $ver2 ]]; then
read
fi
# clean unfinished DEB packing
rm -rf $DEST/debs/*/*/
# Script parameters handling
for i in "$@"; do
if [[ $i == *=* ]]; then