summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Sarawinski2017-04-16 15:17:10 +0200
committerTimo Sarawinski2017-04-16 15:17:10 +0200
commitf768947ff88af48c56faabb8b9252c8ce53aacfe (patch)
treeb2e3e9dc7bb9b472475b09185cf156ff7f75af61
downloadaur-f768947ff88af48c56faabb8b9252c8ce53aacfe.tar.gz
first version
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD55
-rw-r--r--crda.conf.d4
-rw-r--r--db.txt.patch74
-rw-r--r--wireless-regdb.install13
5 files changed, 167 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..0c05b0db80c9
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = wireless-regdb-pentest
+ pkgdesc = Central Regulatory Domain Database with txpower/channels modified for pentesters. please respect the law in your country
+ pkgver = 2017.03.07
+ pkgrel = 1
+ url = http://wireless.kernel.org/en/developers/Regulatory
+ arch = any
+ license = custom
+ makedepends = crda
+ depends = sh
+ provides = wireless-regdb
+ conflicts = wireless-regdb
+ backup = etc/conf.d/wireless-regdom
+ source = https://www.kernel.org/pub/software/network/wireless-regdb/wireless-regdb-2017.03.07.tar.xz
+ source = crda.conf.d
+ source = db.txt.patch
+ sha256sums = 371eafa3b26ece916ef83aca02c4bed2e54099eb5b8c6d22d3a4358dce6535b9
+ sha256sums = 192428fd959806705356107bffc97b8b379854e79bd013c4ee140e5202326e2b
+ sha256sums = 464037af76e3a90548f30a4a0fcacc35053da8ea9d077c76f9ab728cf0772313
+
+pkgname = wireless-regdb-pentest
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..9a01c2c57d22
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,55 @@
+# $Id$
+# Maintainer: Thomas Bächler <thomas@archlinux.org>
+
+pkgname=wireless-regdb-pentest
+_pkgname=wireless-regdb
+pkgver=2017.03.07
+pkgrel=1
+pkgdesc="Central Regulatory Domain Database with txpower/channels modified for pentesters. please respect the law in your country"
+arch=('any')
+url="http://wireless.kernel.org/en/developers/Regulatory"
+backup=(etc/conf.d/wireless-regdom)
+license=('custom')
+depends=('sh')
+makedepends=('crda')
+conflicts=('wireless-regdb')
+provides=('wireless-regdb')
+source=(https://www.kernel.org/pub/software/network/wireless-regdb/wireless-regdb-${pkgver}.tar.xz
+ 'crda.conf.d'
+ 'db.txt.patch')
+sha256sums=('371eafa3b26ece916ef83aca02c4bed2e54099eb5b8c6d22d3a4358dce6535b9'
+ '192428fd959806705356107bffc97b8b379854e79bd013c4ee140e5202326e2b'
+ '464037af76e3a90548f30a4a0fcacc35053da8ea9d077c76f9ab728cf0772313')
+
+prepare() {
+ cd "${srcdir}"/"${_pkgname}"-"${pkgver}"
+ patch -Np1 -i ../db.txt.patch
+}
+
+package() {
+ # Install and verify regulatory.bin file
+ msg "Installing and verifying the regulatory.bin file ..."
+ install -D -m644 "${srcdir}"/${_pkgname}-${pkgver}/regulatory.bin "${pkgdir}"/usr/lib/crda/regulatory.bin
+ # This creates a depend/makedepend loop:
+ # crda depends on wireless-regdb (but strictly doesn't makedepend on it)
+ # wireless-regdb makedepends on crda
+ if /usr/bin/regdbdump "${pkgdir}"/usr/lib/crda/regulatory.bin > /dev/null; then
+ msg "Regulatory database verification was succesful."
+ else
+ error "Regulatory database verification failed."
+ return 1
+ fi
+ install -D -m644 "${srcdir}"/${_pkgname}-${pkgver}/sforshee.key.pub.pem "${pkgdir}"/usr/lib/crda/pubkeys/sforshee.key.pub.pem
+ install -D -m644 "${srcdir}"/${_pkgname}-${pkgver}/LICENSE "${pkgdir}"/usr/share/licenses/wireless-regdb/LICENSE
+ install -D -m644 "${srcdir}"/${_pkgname}-${pkgver}/regulatory.bin.5 "${pkgdir}"/usr/share/man/man5/regulatory.bin.5
+
+ msg "Installing /etc/conf.d/wireless-regdom ..."
+ install -D -m644 "${srcdir}"/crda.conf.d "${pkgdir}"/etc/conf.d/wireless-regdom
+ for dom in $(grep ^country "${srcdir}"/${_pkgname}-${pkgver}/db.txt | cut -d' ' -f2 | sed 's|:||g'); do
+ echo "#WIRELESS_REGDOM=\"${dom}\"" >> "${pkgdir}"/etc/conf.d/wireless-regdom.tmp
+ done
+ sort -u "${pkgdir}"/etc/conf.d/wireless-regdom.tmp >> "${pkgdir}"/etc/conf.d/wireless-regdom
+ rm "${pkgdir}"/etc/conf.d/wireless-regdom.tmp
+
+ install -D -m644 "${srcdir}"/${_pkgname}-${pkgver}/LICENSE "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
+}
diff --git a/crda.conf.d b/crda.conf.d
new file mode 100644
index 000000000000..8511238b967d
--- /dev/null
+++ b/crda.conf.d
@@ -0,0 +1,4 @@
+#
+# Wireless regulatory domain configuration
+#
+
diff --git a/db.txt.patch b/db.txt.patch
new file mode 100644
index 000000000000..06bc8f27a278
--- /dev/null
+++ b/db.txt.patch
@@ -0,0 +1,74 @@
+--- a/db.txt 2017-03-07 14:13:09.000000000 +0100
++++ b/db.txt 2017-04-16 14:53:01.930630453 +0200
+@@ -1,18 +1,18 @@
+ # This is the world regulatory domain
+ country 00:
+- (2402 - 2472 @ 40), (20)
++ (2402 - 2472 @ 40), (30)
+ # Channel 12 - 13.
+- (2457 - 2482 @ 20), (20), NO-IR, AUTO-BW
++ (2457 - 2482 @ 20), (30), NO-IR, AUTO-BW
+ # Channel 14. Only JP enables this and for 802.11b only
+- (2474 - 2494 @ 20), (20), NO-IR, NO-OFDM
++ (2474 - 2494 @ 20), (30), NO-IR, NO-OFDM
+ # Channel 36 - 48
+- (5170 - 5250 @ 80), (20), NO-IR, AUTO-BW
++ (5170 - 5250 @ 80), (30), NO-IR, AUTO-BW
+ # Channel 52 - 64
+- (5250 - 5330 @ 80), (20), NO-IR, DFS, AUTO-BW
++ (5250 - 5330 @ 80), (30), NO-IR, DFS, AUTO-BW
+ # Channel 100 - 144
+- (5490 - 5730 @ 160), (20), NO-IR, DFS
++ (5490 - 5730 @ 160), (30), NO-IR, DFS
+ # Channel 149 - 165
+- (5735 - 5835 @ 80), (20), NO-IR
++ (5735 - 5835 @ 80), (30), NO-IR
+ # IEEE 802.11ad (60GHz), channels 1..3
+ (57240 - 63720 @ 2160), (0)
+
+@@ -360,12 +360,12 @@
+ # https://www.bundesnetzagentur.de/SharedDocs/Downloads/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Frequenzen/Allgemeinzuteilungen/2011_08_MGWS_pdf.pdf
+
+ country DE: DFS-ETSI
+- (2400 - 2483.5 @ 40), (100 mW)
+- (5150 - 5250 @ 80), (100 mW), NO-OUTDOOR, AUTO-BW
+- (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW
+- (5470 - 5725 @ 160), (500 mW), DFS
++ (2400 - 2483.5 @ 40), (30)
++ (5150 - 5250 @ 80), (30), NO-OUTDOOR, AUTO-BW
++ (5250 - 5350 @ 80), (30), NO-OUTDOOR, DFS, AUTO-BW
++ (5470 - 5725 @ 160), (30), DFS
+ # short range devices (ETSI EN 300 440-1)
+- (5725 - 5875 @ 80), (25 mW)
++ (5725 - 5875 @ 80), (30)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
+ (57000 - 66000 @ 2160), (40)
+
+@@ -462,10 +462,10 @@
+ (57000 - 66000 @ 2160), (40)
+
+ country GB: DFS-ETSI
+- (2402 - 2482 @ 40), (20)
+- (5170 - 5250 @ 80), (20), AUTO-BW
+- (5250 - 5330 @ 80), (20), DFS, AUTO-BW
+- (5490 - 5710 @ 160), (27), DFS
++ (2402 - 2482 @ 40), (30)
++ (5170 - 5250 @ 80), (30), AUTO-BW
++ (5250 - 5330 @ 80), (30), DFS, AUTO-BW
++ (5490 - 5710 @ 160), (30), DFS
+ # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (57000 - 66000 @ 2160), (40)
+
+@@ -1216,9 +1216,9 @@
+ country US: DFS-FCC
+ (2402 - 2472 @ 40), (30)
+ # 5.15 ~ 5.25 GHz: 30 dBm for master mode, 23 dBm for clients
+- (5170 - 5250 @ 80), (23), AUTO-BW
+- (5250 - 5330 @ 80), (23), DFS, AUTO-BW
+- (5490 - 5730 @ 160), (23), DFS
++ (5170 - 5250 @ 80), (30), AUTO-BW
++ (5250 - 5330 @ 80), (30), DFS, AUTO-BW
++ (5490 - 5730 @ 160), (30), DFS
+ (5735 - 5835 @ 80), (30)
+ # 60g band
+ # reference: http://cfr.regstoday.com/47cfr15.aspx#47_CFR_15p255
diff --git a/wireless-regdb.install b/wireless-regdb.install
new file mode 100644
index 000000000000..7b5a05de3488
--- /dev/null
+++ b/wireless-regdb.install
@@ -0,0 +1,13 @@
+post_install() {
+ post_upgrade
+}
+
+post_upgrade() {
+ # If crda is installed, we verify the integrity of the database
+ # If not, we skip this step silently
+ if [ -x /usr/bin/regdbdump ]; then
+ if ! /usr/bin/regdbdump /usr/lib/crda/regulatory.bin > /dev/null; then
+ echo "Failed to verify the integrity of the wireless regulatory database, CRDA will not work."
+ fi
+ fi
+}