-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
884babf
commit 75d73f3
Showing
19 changed files
with
1,721 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
if PACKAGE_openvpn-mbedtls | ||
|
||
config OPENVPN_mbedtls_ENABLE_LZO | ||
bool "Enable LZO compression support" | ||
default n | ||
|
||
config OPENVPN_mbedtls_ENABLE_LZ4 | ||
bool "Enable LZ4 compression support" | ||
default y | ||
|
||
#config OPENVPN_mbedtls_ENABLE_EUREPHIA | ||
# bool "Enable support for the eurephia plug-in" | ||
# default n | ||
|
||
config OPENVPN_mbedtls_ENABLE_MANAGEMENT | ||
bool "Enable management server support" | ||
default n | ||
|
||
#config OPENVPN_mbedtls_ENABLE_PKCS11 | ||
# bool "Enable pkcs11 support" | ||
# default n | ||
|
||
config OPENVPN_mbedtls_ENABLE_FRAGMENT | ||
bool "Enable internal fragmentation support (--fragment)" | ||
default y | ||
|
||
config OPENVPN_mbedtls_ENABLE_MULTIHOME | ||
bool "Enable multi-homed UDP server support (--multihome)" | ||
default y | ||
|
||
config OPENVPN_mbedtls_ENABLE_PORT_SHARE | ||
bool "Enable TCP server port-share support (--port-share)" | ||
default y | ||
|
||
config OPENVPN_mbedtls_ENABLE_DEF_AUTH | ||
bool "Enable deferred authentication" | ||
default y | ||
|
||
config OPENVPN_mbedtls_ENABLE_PF | ||
bool "Enable internal packet filter" | ||
default y | ||
|
||
config OPENVPN_mbedtls_ENABLE_IPROUTE2 | ||
bool "Enable support for iproute2" | ||
default n | ||
|
||
config OPENVPN_mbedtls_ENABLE_SMALL | ||
bool "Enable size optimization" | ||
default y | ||
help | ||
enable smaller executable size (disable OCC, usage | ||
message, and verb 4 parm list) | ||
|
||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
if PACKAGE_openvpn-openssl | ||
|
||
config OPENVPN_openssl_ENABLE_LZO | ||
bool "Enable LZO compression support" | ||
default y | ||
|
||
config OPENVPN_openssl_ENABLE_LZ4 | ||
bool "Enable LZ4 compression support" | ||
default y | ||
|
||
config OPENVPN_openssl_ENABLE_X509_ALT_USERNAME | ||
bool "Enable the --x509-username-field feature" | ||
default n | ||
|
||
#config OPENVPN_openssl_ENABLE_EUREPHIA | ||
# bool "Enable support for the eurephia plug-in" | ||
# default n | ||
|
||
config OPENVPN_openssl_ENABLE_MANAGEMENT | ||
bool "Enable management server support" | ||
default n | ||
|
||
#config OPENVPN_openssl_ENABLE_PKCS11 | ||
# bool "Enable pkcs11 support" | ||
# default n | ||
|
||
config OPENVPN_openssl_ENABLE_FRAGMENT | ||
bool "Enable internal fragmentation support (--fragment)" | ||
default y | ||
|
||
config OPENVPN_openssl_ENABLE_MULTIHOME | ||
bool "Enable multi-homed UDP server support (--multihome)" | ||
default y | ||
|
||
config OPENVPN_openssl_ENABLE_PORT_SHARE | ||
bool "Enable TCP server port-share support (--port-share)" | ||
default y | ||
|
||
config OPENVPN_openssl_ENABLE_DEF_AUTH | ||
bool "Enable deferred authentication" | ||
default y | ||
|
||
config OPENVPN_openssl_ENABLE_PF | ||
bool "Enable internal packet filter" | ||
default y | ||
|
||
config OPENVPN_openssl_ENABLE_IPROUTE2 | ||
bool "Enable support for iproute2" | ||
default n | ||
|
||
config OPENVPN_openssl_ENABLE_SMALL | ||
bool "Enable size optimization" | ||
default y | ||
help | ||
enable smaller executable size (disable OCC, usage | ||
message, and verb 4 parm list) | ||
|
||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
if PACKAGE_openvpn-wolfssl | ||
|
||
config OPENVPN_wolfssl | ||
bool | ||
default y | ||
select WOLFSSL_HAS_OPENVPN | ||
|
||
config OPENVPN_wolfssl_ENABLE_LZO | ||
bool "Enable LZO compression support" | ||
default n | ||
|
||
config OPENVPN_wolfssl_ENABLE_LZ4 | ||
bool "Enable LZ4 compression support" | ||
default y | ||
|
||
config OPENVPN_wolfssl_ENABLE_X509_ALT_USERNAME | ||
bool "Enable the --x509-username-field feature" | ||
default n | ||
|
||
#config OPENVPN_wolfssl_ENABLE_EUREPHIA | ||
# bool "Enable support for the eurephia plug-in" | ||
# default n | ||
|
||
config OPENVPN_wolfssl_ENABLE_MANAGEMENT | ||
bool "Enable management server support" | ||
default n | ||
|
||
#config OPENVPN_wolfssl_ENABLE_PKCS11 | ||
# bool "Enable pkcs11 support" | ||
# default n | ||
|
||
config OPENVPN_wolfssl_ENABLE_FRAGMENT | ||
bool "Enable internal fragmentation support (--fragment)" | ||
default y | ||
|
||
config OPENVPN_wolfssl_ENABLE_MULTIHOME | ||
bool "Enable multi-homed UDP server support (--multihome)" | ||
default y | ||
|
||
config OPENVPN_wolfssl_ENABLE_PORT_SHARE | ||
bool "Enable TCP server port-share support (--port-share)" | ||
default y | ||
|
||
config OPENVPN_wolfssl_ENABLE_DEF_AUTH | ||
bool "Enable deferred authentication" | ||
default y | ||
|
||
config OPENVPN_wolfssl_ENABLE_PF | ||
bool "Enable internal packet filter" | ||
default y | ||
|
||
config OPENVPN_wolfssl_ENABLE_IPROUTE2 | ||
bool "Enable support for iproute2" | ||
default n | ||
|
||
config OPENVPN_wolfssl_ENABLE_SMALL | ||
bool "Enable size optimization" | ||
default y | ||
help | ||
enable smaller executable size (disable OCC, usage | ||
message, and verb 4 parm list) | ||
|
||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
# | ||
# Copyright (C) 2010-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:=openvpn | ||
|
||
PKG_VERSION:=2.5.8 | ||
PKG_RELEASE:=21 | ||
|
||
PKG_SOURCE_URL:=\ | ||
https://build.openvpn.net/downloads/releases/ \ | ||
https://swupdate.openvpn.net/community/releases/ | ||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz | ||
PKG_HASH:=skip | ||
|
||
PKG_MAINTAINER:=Magnus Kroken <[email protected]> | ||
|
||
PKG_INSTALL:=1 | ||
PKG_FIXUP:=autoreconf | ||
PKG_BUILD_PARALLEL:=1 | ||
PKG_BUILD_FLAGS:=gc-sections | ||
PKG_LICENSE:=GPL-2.0 | ||
PKG_CPE_ID:=cpe:/a:openvpn:openvpn | ||
|
||
include $(INCLUDE_DIR)/package.mk | ||
|
||
define Package/openvpn/Default | ||
TITLE:=Open source VPN solution using $(2) | ||
SECTION:=net | ||
CATEGORY:=Network | ||
URL:=http://openvpn.net | ||
SUBMENU:=VPN | ||
MENU:=1 | ||
DEPENDS:=+kmod-tun +OPENVPN_$(1)_ENABLE_LZO:liblzo +OPENVPN_$(1)_ENABLE_IPROUTE2:ip $(3) | ||
VARIANT:=$(1) | ||
PROVIDES:=openvpn openvpn-crypto | ||
endef | ||
|
||
Package/openvpn-openssl=$(call Package/openvpn/Default,openssl,OpenSSL,+PACKAGE_openvpn-openssl:libopenssl) | ||
Package/openvpn-mbedtls=$(call Package/openvpn/Default,mbedtls,mbedTLS,+PACKAGE_openvpn-mbedtls:libmbedtls) | ||
Package/openvpn-wolfssl=$(call Package/openvpn/Default,wolfssl,WolfSSL \(experimental\),+PACKAGE_openvpn-wolfssl:libwolfssl) | ||
|
||
define Package/openvpn/config/Default | ||
source "$(SOURCE)/Config-$(1).in" | ||
endef | ||
|
||
Package/openvpn-openssl/config=$(call Package/openvpn/config/Default,openssl) | ||
Package/openvpn-mbedtls/config=$(call Package/openvpn/config/Default,mbedtls) | ||
Package/openvpn-wolfssl/config=$(call Package/openvpn/config/Default,wolfssl) | ||
|
||
ifeq ($(BUILD_VARIANT),mbedtls) | ||
CONFIG_OPENVPN_MBEDTLS:=y | ||
endif | ||
ifeq ($(BUILD_VARIANT),openssl) | ||
CONFIG_OPENVPN_OPENSSL:=y | ||
endif | ||
ifeq ($(BUILD_VARIANT),wolfssl) | ||
CONFIG_OPENVPN_WOLFSSL:=y | ||
endif | ||
|
||
CONFIGURE_VARS += \ | ||
IPROUTE=/sbin/ip \ | ||
NETSTAT=/sbin/netstat | ||
|
||
define Build/Configure | ||
$(call Build/Configure/Default, \ | ||
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_SMALL),--enable-small) \ | ||
--disable-selinux \ | ||
--disable-systemd \ | ||
--disable-plugins \ | ||
--disable-debug \ | ||
--disable-pkcs11 \ | ||
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_LZO),--enable,--disable)-lzo \ | ||
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_LZ4),--enable,--disable)-lz4 \ | ||
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_X509_ALT_USERNAME),--enable,--disable)-x509-alt-username \ | ||
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_MANAGEMENT),--enable,--disable)-management \ | ||
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_FRAGMENT),--enable,--disable)-fragment \ | ||
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_MULTIHOME),--enable,--disable)-multihome \ | ||
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_IPROUTE2),--enable,--disable)-iproute2 \ | ||
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_DEF_AUTH),--enable,--disable)-def-auth \ | ||
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_PF),--enable,--disable)-pf \ | ||
$(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_PORT_SHARE),--enable,--disable)-port-share \ | ||
$(if $(CONFIG_OPENVPN_OPENSSL),--with-crypto-library=openssl --with-openssl-engine=no) \ | ||
$(if $(CONFIG_OPENVPN_MBEDTLS),--with-crypto-library=mbedtls) \ | ||
$(if $(CONFIG_OPENVPN_WOLFSSL),--with-crypto-library=wolfssl) \ | ||
) | ||
endef | ||
|
||
define Package/openvpn-$(BUILD_VARIANT)/conffiles | ||
/etc/config/openvpn | ||
/etc/openvpn.user | ||
endef | ||
|
||
define Package/openvpn-$(BUILD_VARIANT)/install | ||
$(INSTALL_DIR) \ | ||
$(1)/usr/sbin \ | ||
$(1)/usr/share/openvpn \ | ||
$(1)/etc/init.d \ | ||
$(1)/etc/config \ | ||
$(1)/etc/openvpn \ | ||
$(1)/lib/functions \ | ||
$(1)/lib/upgrade/keep.d \ | ||
$(1)/usr/libexec \ | ||
$(1)/etc/hotplug.d/openvpn | ||
|
||
$(INSTALL_BIN) \ | ||
$(PKG_INSTALL_DIR)/usr/sbin/openvpn \ | ||
$(1)/usr/sbin/ | ||
|
||
$(INSTALL_BIN) \ | ||
files/openvpn.init \ | ||
$(1)/etc/init.d/openvpn | ||
|
||
$(INSTALL_BIN) \ | ||
files/usr/libexec/openvpn-hotplug \ | ||
$(1)/usr/libexec/openvpn-hotplug | ||
|
||
$(INSTALL_DATA) \ | ||
files/lib/functions/openvpn.sh \ | ||
$(1)/lib/functions/openvpn.sh | ||
|
||
$(INSTALL_DATA) \ | ||
files/etc/hotplug.d/openvpn/01-user \ | ||
$(1)/etc/hotplug.d/openvpn/01-user | ||
|
||
$(INSTALL_DATA) \ | ||
files/etc/openvpn.user \ | ||
$(1)/etc/openvpn.user | ||
|
||
$(INSTALL_DATA) \ | ||
files/openvpn.options \ | ||
$(1)/usr/share/openvpn/openvpn.options | ||
|
||
$(INSTALL_CONF) files/openvpn.config \ | ||
$(1)/etc/config/openvpn | ||
|
||
$(INSTALL_DATA) \ | ||
files/openvpn.upgrade \ | ||
$(1)/lib/upgrade/keep.d/openvpn | ||
endef | ||
|
||
$(eval $(call BuildPackage,openvpn-openssl)) | ||
$(eval $(call BuildPackage,openvpn-mbedtls)) | ||
$(eval $(call BuildPackage,openvpn-wolfssl)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
[ -e "/etc/openvpn.user" ] && { | ||
env -i ACTION="$ACTION" INSTANCE="$INSTANCE" \ | ||
/bin/sh \ | ||
/etc/openvpn.user \ | ||
$* | ||
} | ||
|
||
# Wrap user defined scripts on up/down events | ||
case "$ACTION" in | ||
up) command=$user_up ;; | ||
down) command=$user_down ;; | ||
*) command= ;; | ||
esac | ||
|
||
if [ -n "$command" ]; then | ||
shift | ||
exec /bin/sh -c "$command $*" | ||
fi | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
# | ||
# This file is interpreted as shell script. | ||
# Put your custom openvpn action here, they will | ||
# be executed with each opevnp event. | ||
# | ||
# $ACTION | ||
# <down> down action is generated after the TUN/TAP device is closed | ||
# <up> up action is generated after the TUN/TAP device is opened | ||
# $INSTANCE Name of the openvpn instance which went up or down | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
|
||
get_openvpn_option() { | ||
local config="$1" | ||
local variable="$2" | ||
local option="$3" | ||
|
||
local value="$(sed -rne 's/^[ \t]*'"$option"'[ \t]+'"'([^']+)'"'[ \t]*$/\1/p' "$config" | tail -n1)" | ||
[ -n "$value" ] || value="$(sed -rne 's/^[ \t]*'"$option"'[ \t]+"(([^"\\]|\\.)+)"[ \t]*$/\1/p' "$config" | tail -n1 | sed -re 's/\\(.)/\1/g')" | ||
[ -n "$value" ] || value="$(sed -rne 's/^[ \t]*'"$option"'[ \t]+(([^ \t\\]|\\.)+)[ \t]*$/\1/p' "$config" | tail -n1 | sed -re 's/\\(.)/\1/g')" | ||
[ -n "$value" ] || return 1 | ||
|
||
export -n "$variable=$value" | ||
return 0 | ||
} | ||
|
Oops, something went wrong.