Build patched Windows openvpn Client


#
#
# Till now the scramble openvpn patch works.
# But read more about the controversy here
# https://tunnelblick.net/cOpenvpn_xorpatch.html#the-openvpn_xorpatch-controversy
#
# Patch sources
# https://github.com/Tunnelblick/Tunnelblick/tree/master/third_party/sources/openvpn
# https://github.com/clayface/openvpn_xorpatch
#
##########################################################
#
#
# for Openvpn 2.4.1 using tunnelblick patch for 32bit windows
# https://www.dropbox.com/s/i3qmr712d8bnqiz/openvpn.exe
# Replace the openvpn.exe file in C:\Program Files\OpenVPN\bin
#
# for Openvpn 2.4.1 using tunnelblick patch for 64bit windows
# https://www.dropbox.com/s/0fie1kr5gppqjfy/openvpn.exe
# Replace the openvpn.exe file in C:\Program Files\OpenVPN\bin
#
# For older versions, see bottom of post.
# But Safest is to make your own patched server and client
#
##########################################################
# Building patched windows openvpn
# Using Ubuntu 14.04 trusty 64-bit server
# Built using a VPS by digitalocean 512MB Ram 20GB SSD Disk Ubuntu 14.04 x64 San Francisco
#
# My Guides
# https://community.openvpn.net/openvpn/wiki/SettingUpGenericBuildsystem
# https://community.openvpn.net/openvpn/wiki/BuildingUsingGenericBuildsystem
#
# And these are the commands to build the openvpn.exe from source code and patch

wget https://community.openvpn.net/openvpn/raw-attachment/wiki/SettingUpGenericBuildsystem/setup-generic-buildsystem.5.sh
chmod +x ./setup-generic-buildsystem.5.sh

# If Ubuntu 14.04 trusty
./setup-generic-buildsystem.5.sh trusty

# Now lets build it without patch
# This will fetch the source code for us.

cd openvpn-build/generic
IMAGEROOT=`pwd`/image-win32 CHOST=i686-w64-mingw32 CBUILD=x86_64-pc-linux-gnu ./build

# We don't want this compiled version, so delete it
rm -rf image-*

# get the patch
cd ~/openvpn-build/generic/patches
wget https://raw.githubusercontent.com/Tunnelblick/Tunnelblick/master/third_party/sources/openvpn/openvpn-2.4.1/patches/02-tunnelblick-openvpn_xorpatch-a.diff
wget https://raw.githubusercontent.com/Tunnelblick/Tunnelblick/master/third_party/sources/openvpn/openvpn-2.4.1/patches/03-tunnelblick-openvpn_xorpatch-b.diff
wget https://raw.githubusercontent.com/Tunnelblick/Tunnelblick/master/third_party/sources/openvpn/openvpn-2.4.1/patches/04-tunnelblick-openvpn_xorpatch-c.diff
wget https://raw.githubusercontent.com/Tunnelblick/Tunnelblick/master/third_party/sources/openvpn/openvpn-2.4.1/patches/05-tunnelblick-openvpn_xorpatch-d.diff
wget https://raw.githubusercontent.com/Tunnelblick/Tunnelblick/master/third_party/sources/openvpn/openvpn-2.4.1/patches/06-tunnelblick-openvpn_xorpatch-e.diff

# We apply patch the long way
cd $HOME/openvpn-build/generic/sources
tar xfz ./openvpn-2.4.1.tar.gz
rm openvpn-2.4.1.tar.gz
cp ~/openvpn-build/generic/patches/02-tunnelblick-openvpn_xorpatch-a.diff ~/openvpn-build/generic/sources/openvpn-2.4.1
cp ~/openvpn-build/generic/patches/03-tunnelblick-openvpn_xorpatch-b.diff ~/openvpn-build/generic/sources/openvpn-2.4.1
cp ~/openvpn-build/generic/patches/04-tunnelblick-openvpn_xorpatch-c.diff ~/openvpn-build/generic/sources/openvpn-2.4.1
cp ~/openvpn-build/generic/patches/05-tunnelblick-openvpn_xorpatch-d.diff ~/openvpn-build/generic/sources/openvpn-2.4.1
cp ~/openvpn-build/generic/patches/06-tunnelblick-openvpn_xorpatch-e.diff ~/openvpn-build/generic/sources/openvpn-2.4.1
cd ~/openvpn-build/generic/sources/openvpn-2.4.1
git apply --check 02-tunnelblick-openvpn_xorpatch-a.diff
git apply --check 03-tunnelblick-openvpn_xorpatch-b.diff
git apply --check 04-tunnelblick-openvpn_xorpatch-c.diff
git apply --check 05-tunnelblick-openvpn_xorpatch-d.diff
git apply --check 06-tunnelblick-openvpn_xorpatch-e.diff
git apply 02-tunnelblick-openvpn_xorpatch-a.diff
git apply 03-tunnelblick-openvpn_xorpatch-b.diff
git apply 04-tunnelblick-openvpn_xorpatch-c.diff
git apply 05-tunnelblick-openvpn_xorpatch-d.diff
git apply 06-tunnelblick-openvpn_xorpatch-e.diff
cd ~/openvpn-build/generic/sources
tar cfz ./openvpn-2.4.1.tar.gz ./openvpn-2.4.1
rm -rf ./openvpn-2.4.1

# Now lets build it
cd ~/openvpn-build/generic/

# build for openvpn 32 bit
IMAGEROOT=`pwd`/image-win32 CHOST=i686-w64-mingw32 CBUILD=x86_64-pc-linux-gnu ./build

# build for openvpn 64 bit
IMAGEROOT=`pwd`/image-win64 CHOST=x86_64-w64-mingw32 CBUILD=x86_64-pc-linux-gnu ./build

# Check we have openvpn.exe
ls $HOME/openvpn-build/generic/image-win32/openvpn/bin
ls $HOME/openvpn-build/generic/image-win64/openvpn/bin

# Use Winscp, copy openvpn.exe from ubuntu server
# to windows c\:
# Then in windows, copy over to openvpn bin directory

#
# Guide: Building OpenVPN and it's dependencies
#
# The ''./build'' command fetches all the dependencies, builds them and builds OpenVPN.
# To build a native binary:
# IMAGEROOT=`pwd`/image-native ./build
#
# To build for Windows 32bit on Linux 64bit:
# IMAGEROOT=`pwd`/image-win32 CHOST=i686-w64-mingw32 CBUILD=x86_64-pc-linux-gnu ./build
#
# To build for Windows 64bit on Linux 64bit:
# IMAGEROOT=`pwd`/image-win64 CHOST=x86_64-w64-mingw32 CBUILD=x86_64-pc-linux-gnu ./build
#
# To build for Arm on Linux 64bit:
# IMAGEROOT=`pwd`/image-arm CHOST=arm-linux-gnueabi CBUILD=x86_64-pc-linux-gnu ./build
#####################################################################
#
# old Patched openvpn for earlier versions
#
# for Openvpn 2.4.0 using tunnelblick patch 32bit
# https://www.dropbox.com/s/z3ox14scp18koao/openvpn.exe
# Replace the openvpn.exe file in C:\Program Files\OpenVPN\bin
#
# for Openvpn 2.4.0 using tunnelblick patch 64bit
# https://www.dropbox.com/s/hh986ugknpnkxsg/openvpn.exe
# Replace the openvpn.exe file in C:\Program Files\OpenVPN\bin
#
# for Openvpn 2.3.10 clayface patch 32bit
# https://www.dropbox.com/s/sw2rqr0g50tvw9f/openvpn.exe
# Replace the openvpn.exe file in C:\Program Files (x86)\OpenVPN\bin
#
# for Openvpn 2.3.10 clayface patch 64bit
# https://www.dropbox.com/s/ivn5xsni15cucjy/openvpn.exe
# Replace the openvpn.exe file in C:\Program Files\OpenVPN\bin
#
# for Openvpn 2.3.10 tunnelblick patch 32bit
# https://www.dropbox.com/s/qagttkh0zna7hyl/openvpn.exe
# Replace the openvpn.exe file in C:\Program Files (x86)\OpenVPN\bin
#
# for Openvpn 2.3.10 tunnelblick patch 64bit
# https://www.dropbox.com/s/r2xrlqqe040k4cp/openvpn.exe
# Replace the openvpn.exe file in C:\Program Files\OpenVPN\bin
#
# for Openvpn 2.3.6 32bit
# https://www.dropbox.com/s/nxzv3d0tfcs331m/openvpn.exe
# Replace the openvpn.exe file in C:\Program Files (x86)\OpenVPN\bin
#
# for Openvpn 2.3.6 64bit
# https://www.dropbox.com/s/benu8o3n2jck7ni/openvpn.exe
# Replace the openvpn.exe file in C:\Program Files\OpenVPN\bin
#
# for Openvpn 2.3.5 32bit
# https://www.dropbox.com/s/gbpwf2lafhbd1e3/openvpn.exe
# Replace the openvpn.exe file in C:\Program Files (x86)\OpenVPN\bin
#
# for Openvpn 2.3.5 64bit
# https://www.dropbox.com/s/is3c7g9l5hh6guh/openvpn.exe
# Replace the openvpn.exe file in C:\Program Files\OpenVPN\bin
#
# for Openvpn 2.3.4 32bit
# https://www.dropbox.com/s/l01si68evyfxqar/openvpn.exe
# Replace the openvpn.exe file in C:\Program Files (x86)\OpenVPN\bin
#
# for Openvpn 2.3.4 64bit
# https://www.dropbox.com/s/4jhdgnvgs2c29d6/openvpn.exe
# Replace the openvpn.exe file in C:\Program Files\OpenVPN\bin
#
# for Openvpn 2.3.2 32bit
# https://www.dropbox.com/sh/7i36q61cbahonup/fK4ItfTreB/openvpn.exe
# Replace the openvpn.exe file in openvpn/bin
#
# for Openvpn 2.3.2 64bit
# https://www.dropbox.com/s/01s0vq98oxlhim2/openvpn.exe
# Replace the openvpn.exe file in C:\Program Files\OpenVPN\bin
#
# for Openvpn 2.2.2
# http://www.obfsvpn.com/openvpn.7z
# unzip and Replace the openvpn.exe file in the openvpn/bin directory
# Usually C:\Program Files (x86)\OpenVPN\bin
#

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

7 Responses to Build patched Windows openvpn Client

  1. Gerry says:

    Would you please consider creating a tutorial for compiling an Android client that can connect to the RaspberryPI Scrambled OpenVPN server? Perhaps using OpenVPN-ICS available at https://code.google.com/p/ics-openvpn/ Thank you!

  2. Tony says:

    Thanks for providing updated binaries when there are new versions of OpenVPN!

  3. Tony says:

    Hi, can you please build updated Windows binaries with the patch? Setting up a Windows build env is a bit difficult. Also, could you apply the patch from tunnelblick (as you linked) as they stated the original patches had some issues.

    Thanks!

  4. modfiles says:

    hi
    how can i use the option –disable-plugin-auth-pam in ./configure using setup-generic-buildsystem.5.sh?
    im trying to compile for arm using this command
    IMAGEROOT=’pwd’/image-arm CHOST=arm-linux-gnueabi CBUILD=x86_64-pc-linux-gnu ./build
    but i always get
    configure: error: libpam required but missing
    i tried fixing it by doing apt-get install libpam0g-dev but to no avail
    i have read some post that if i get error compiling for arm related to libpam, just use the option –disable-plugin-auth-pam in configure but i have no idea how to do that in generic-buildsystem.5.sh
    your help will be greatly appreciated

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s