Skip to content

Commit

Permalink
reaver: import from oldpackages.
Browse files Browse the repository at this point in the history
 - Update copyright year.
 - Add PKG_LICENSE:=GPL-2.0 from the Google Code project page.
 - Add autoreconf as the PKG_FIXUP method.
 - Add myself as the package maintainer.
 - Add a patch to fix building with musl-libc.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
  • Loading branch information
yousong committed Aug 21, 2015
1 parent 6b4b26f commit 1e29676
Show file tree
Hide file tree
Showing 5 changed files with 738 additions and 0 deletions.
55 changes: 55 additions & 0 deletions net/reaver/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#
# Copyright (C) 2012-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=reaver
PKG_REV:=113
PKG_VERSION:=r$(PKG_REV)
PKG_RELEASE:=1
PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://reaver-wps.googlecode.com/svn/trunk
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_PROTO:=svn
PKG_LICENSE:=GPL-2.0

PKG_AUTOMAKE_PATHS:=src
PKG_FIXUP:=autoreconf

include $(INCLUDE_DIR)/package.mk

CONFIGURE_PATH:=src
MAKE_PATH:=src

define Package/reaver
SECTION:=net
CATEGORY:=Network
SUBMENU:=wireless
TITLE:=Efficient brute force attack against Wifi Protected Setup
URL:=https://code.google.com/p/reaver-wps/
DEPENDS:=+libpcap +libsqlite3
endef

define Package/reaver/description
Reaver targets the external registrar functionality mandated by the WiFi
Protected Setup specification.
Access points will provide authenticated registrars with their current
wireless configuration (including the WPA PSK), and also accept a new
configuration from the registrar.
endef

define Package/reaver/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/{reaver,wash} $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/reaver
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/reaver.db $(1)/etc/reaver/
endef

$(eval $(call BuildPackage,reaver))

4 comments on commit 1e29676

@hnyman
Copy link
Contributor

@hnyman hnyman commented on 1e29676 Aug 26, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build seems to fail for mips platforms, e.g. ar71xx, lantiq etc.
The reason looks like a mips16 incompatibility. You might need to disable MIPS16 for the package.

E.g.
http://buildbot.openwrt.org:8010/broken_packages/lantiq/reaver/compile.txt
http://buildbot.openwrt.org:8010/broken_packages/ar71xx/reaver/compile.txt

mips-openwrt-linux-musl-gcc -DCONF_DIR='"/etc/reaver"' -DREAVER_DATABASE='"/etc/reaver/reaver.db"' -Wall -Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -mdsp -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  builder.c -c
{standard input}: Assembler messages:
{standard input}:79: Error: unrecognized opcode `wsbh $2,$2'
{standard input}:90: Error: unrecognized opcode `wsbh $3,$17'
{standard input}:208: Error: unrecognized opcode `wsbh $2,$2'
make[3]: *** [builder.o] Error 1

@yousong
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. The issue was also reproduced on my build environment. I will disable MIPS16 for this package.

P.S. is it possible that this is a toolchain bug?

@yousong
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for the record, the following was emitted by gcc with -S flag.

  75 #APP
  76  # 21 "/home/yousong/trunk-openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/asm/swab.h" 1
  77         .set    push
  78     .set    arch=mips32r2
  79     wsbh    $2, $2
  80     .set    pop

@yousong
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out that this issue was not triggered on QEMU Malta Little Endian because those wsbh was not used when calling __cpu_to_le16().

Please sign in to comment.