Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Patch openvpn 2.3 (xor.patch) on Mac OSX 10.9 macports

Posted on 2014-02-02
2
Medium Priority
?
1,201 Views
Last Modified: 2014-03-05
HI, I need to patch openvpn on my mac, so I can use the "scramble" and "scramble obfuscate" config flags that are helpful for obfuscating traffic.

(my server is configured with this patch, so I can not connect if my client does not support it.) In windows I have build the openvpn client successfully, but on Mac I am not familiar with the process.

The patch I need to apply is this:
https://github.com/clayface/openvpn_xorpatch/blob/master/openvpn_xor.patch

I have download xcode and Macports on my mac 10.9 (mavericks), and I just need the commands in order to:

-download source code of openvpn2.3
-apply openvpn_xor.patch from the github above
-build, make, install openvpn2 through macports

can someone help?

in LInux, the commands are the below, for reference:

# Now download OpenVPN source code and update with patch 
cd $HOME
wget https://github.com/OpenVPN/openvpn/archive/release/2.3.zip
unzip 2.3.zip

wget https://github.com/clayface/openvpn_xorpatch/archive/master.zip
unzip master.zip

cp openvpn_xorpatch-master/openvpn_xor.patch openvpn-release-2.3/
cd openvpn-release-2.3/
git apply --check openvpn_xor.patch
git apply openvpn_xor.patch
cd $HOME
sudo mv ./openvpn-release-2.3/ /etc/openvpn

# We need to add a few components to be able to compile
sudo apt-get update
sudo apt-get install gcc make automake autoconf dh-autoreconf file patch perl dh-make debhelper devscripts gnupg lintian quilt libtool pkg-config libssl-dev liblzo2-dev libpam0g-dev libpkcs11-helper1-dev -y
sudo apt-get update

# This is the bit where we make the new openvpn server
cd /etc/openvpn/
sudo autoreconf -i -v -f
sudo ./configure --prefix=/usr
sudo make
sudo make install
sudo nano /etc/init.d/openvpn

# goto pastebin, copy RAW
# http://pastebin.com/Bvpuejt0

# or sudo wget http://pastebin.com/raw.php?i=Bvpuejt0 -O /etc/init.d/openvpn
# or sudo wget https://gist.github.com/john564/6765292/raw/0a97df1237a138a5a941bbec45b6cd41e973f840/etc+init.d+openvpn -O /etc/init.d/openvpn

sudo chmod +x /etc/init.d/openvpn
sudo update-rc.d openvpn defaults

Open in new window

0
Comment
Question by:sk391
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 30

Accepted Solution

by:
serialband earned 2000 total points
ID: 39830508
The basic command are the same, so you can do just about the same thing.  You'll just have to install wget and git if you haven't already done so.  I went from Fink, to MacPorts to HomeBrew, so my MacPorts command is a bit rusty.  I can get you started, but I haven't use MacPorts in a while and don't remember how or where everything gets placed.  Too much new data has pushed out the old.
port install git.
port install wget

Open in new window


Once you've installed wget and git, this first part is the same.
# Now download OpenVPN source code and update with patch 
cd $HOME
wget https://github.com/OpenVPN/openvpn/archive/release/2.3.zip
unzip 2.3.zip

wget https://github.com/clayface/openvpn_xorpatch/archive/master.zip
unzip master.zip

cp openvpn_xorpatch-master/openvpn_xor.patch openvpn-release-2.3/
cd openvpn-release-2.3/
git apply --check openvpn_xor.patch
git apply openvpn_xor.patch
cd $HOME
sudo mv ./openvpn-release-2.3/ /etc/openvpn

Open in new window


You'll also have to change the debian/ubuntu apt-get command to port selfupdate and also run softwareupdate -i -a if you want to update your mac.  Unfortunately, I don't know if MacPorts has all these tools.  You might want to skip this part and run the working make commands below first to see what you actually need.  I took out gcc, make and some of the other "make/conf" tools, because you should have them with xcode.  It's best not to attempt to install duplicates that may confuse everything or possibly be out of date.
# We need to add a few components to be able to compile
sudo port selfupdate
sudo port install  dh-autoreconf  perl dh-make debhelper devscripts gnupg lintian quilt libtool pkg-config libssl-dev liblzo2-dev libpam0g-dev libpkcs11-helper1-dev -y
sudo port selfupdate

Open in new window

The last line depends on whether MacPorts actually places the openvpn startup in init.d, since Macs don't really use init.d.  The use launchctl to configure the launchdaemons/launchagents.
# This is the bit where we make the new openvpn server
cd /etc/openvpn/
sudo autoreconf -i -v -f
sudo ./configure --prefix=/usr
sudo make
sudo make install
sudo nano /etc/init.d/openvpn

Open in new window

The last lines also depend on how MacPorts handles the installation.  Does MacPorts put everything in /etc/ as linux does, or does it put it somewhere else.
# goto pastebin, copy RAW
# http://pastebin.com/Bvpuejt0

# or sudo wget http://pastebin.com/raw.php?i=Bvpuejt0 -O /etc/init.d/openvpn
# or sudo wget https://gist.github.com/john564/6765292/raw/0a97df1237a138a5a941bbec45b6cd41e973f840/etc+init.d+openvpn -O /etc/init.d/openvpn

sudo chmod +x /etc/init.d/openvpn
sudo update-rc.d openvpn defaults

Open in new window

                                 
I hope this puts you on the right track.
0
 
LVL 1

Author Comment

by:sk391
ID: 39830571
thank you, I will try this, i also saw there is something called "local repository" for macports, if I create a portfile in my local machine and add "file:///path" to my repositories sources, i should be able to do "port install -s openvpn2" to install openvpn2 from source, and add "patchfiles xor_openvpn.patch" in the portfile?

guide.macports.org/#development.local-repositories

http://guide.macports.org/#development.patches
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we have discussed about the OS X EI Capitan and how to fix Wi-Fi issue in OS X El Capitan. We have explained how to delete system level preferences and create a new Wi-Fi location to resolve Wi-Fi issue.
Set up iPhone and iPad email signatures to always send in high-quality HTML with this step-by step guide.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question