openvpn_xorpatch icon indicating copy to clipboard operation
openvpn_xorpatch copied to clipboard

How to use the patch?

Open Ghost-Recon131 opened this issue 6 years ago • 5 comments
trafficstars

Could you please tell me where to put the openvpn_xor.patch file? I'm quiet new to this stuff. Thanks!

Ghost-Recon131 avatar Jan 29 '19 00:01 Ghost-Recon131

@Ghost-Recon131 checkout my PKGBUILD for the AUR package I manage that may help....

https://aur.archlinux.org/packages/openvpn-xor-git/

and in particular:

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=openvpn-xor-git

patches are split amongst a few files.. you can download all files archived via:

https://aur.archlinux.org/cgit/aur.git/snapshot/openvpn-xor-git.tar.gz

ozmartian avatar Jan 30 '19 00:01 ozmartian

Thanks, but what do I do with the patches? Do I just put them in the OpenVPN install folder?

Ghost-Recon131 avatar Jan 30 '19 05:01 Ghost-Recon131

you run them against the openvpn source code... copy them all into the the extracted openvpn source code folder and simply use "git apply" or "patch -p1"... i prefer the git method as its easier and more cross platform (works for Win/Linux/macOS)...

checkout lines 28 - 41 of the PkGBUILD script which is where this happens:

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=openvpn-xor-git#n28

once patched you then build as per normal openvpn building instructions...

ozmartian avatar Jan 30 '19 06:01 ozmartian

I seem to get an error about missing files /40227626/51963182-da804d00-24b6-11e9-827a-4ce84aa68a12.png) image

Ghost-Recon131 avatar Jan 30 '19 06:01 Ghost-Recon131

$ /usr/local/src/openvpn-2.4.6$ patch -p1 < openvpn_xor.patch patching file src/openvpn/forward.c patching file src/openvpn/options.c Hunk #1 succeeded at 812 (offset 1 line). Hunk #2 succeeded at 977 (offset 2 lines). Hunk #3 succeeded at 1497 (offset 16 lines). Hunk #4 succeeded at 5994 (offset 25 lines). patching file src/openvpn/options.h patching file src/openvpn/socket.c patching file src/openvpn/socket.h

all files owned by user - so no sudo needed

you must edit the version of openvpn - the patch is aimed at 2.4.4 - i pulled 2.4.6 and it worked straight away - i have yet to test it this is what the patch looks like:

diff -Naur openvpn_new-2.4.4/src/openvpn/forward.c openvpn-2.4.4/src/openvpn/forward.c --- openvpn_new-2.4.4/src/openvpn/forward.c 2017-09-26 10:27:35.000000000 +0100 +++ openvpn-2.4.4/src/openvpn/forward.c 2017-12-04 19:25:15.248200599 +0000 @@ -729,7 +729,10 @@ .... ... status = link_socket_read(c->c2.link_socket,

maximlomans avatar Sep 30 '20 15:09 maximlomans