Page 1 of 1

Compiling OpenVPN 2.4 on Linux Mint 18

Posted: Thu Jun 15, 2017 8:35 am
by Normando
Good day,

Linux Mint 18 came with OpenVPN 2.3. I need to update it to 2.4 in order to connect to a server.
Upon make, I receive the following:

g

Code: Select all

cc -DHAVE_CONFIG_H -I. -I../.. -I../../include  -I../../include -I../../src/compat   -I/usr/local/include    -DPLUGIN_LIBDIR=\"/usr/local/lib/openvpn/plugins\"  -g -O2 -std=c99 -MT crypto.o -MD -MP -MF .deps/crypto.Tpo -c -o crypto.o crypto.c
In file included from crypto.h:131:0,
                 from crypto.c:36:
crypto.c: In function ‘init_key_ctx’:
crypto.c:855:32: error: invalid application of ‘sizeof’ to incomplete type ‘cipher_ctx_t {aka struct evp_cipher_ctx_st}’
         ALLOC_OBJ(ctx->cipher, cipher_ctx_t);
                                ^
buffer.h:1015:61: note: in definition of macro ‘ALLOC_OBJ’
         check_malloc_return((dptr) = (type *) malloc(sizeof(type))); \
                                                             ^
crypto.c:879:30: error: invalid application of ‘sizeof’ to incomplete type ‘hmac_ctx_t {aka struct hmac_ctx_st}’
         ALLOC_OBJ(ctx->hmac, hmac_ctx_t);
                              ^
buffer.h:1015:61: note: in definition of macro ‘ALLOC_OBJ’
         check_malloc_return((dptr) = (type *) malloc(sizeof(type))); \
                                                             ^
Makefile:662: recipe for target 'crypto.o' failed
make[3]: *** [crypto.o] Error 1
make[3]: Leaving directory '/home/user/Downloads/openvpn-2.4.2/src/openvpn'
Makefile:418: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/user/Downloads/openvpn-2.4.2/src'
Makefile:604: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/user/Downloads/openvpn-2.4.2'
Makefile:491: recipe for target 'all' failed
make: *** [all] Error 2
Initially .configure demanded several dependencies to be installed most of which I got through apt-get. However, I had to compile and install the latest openssl which overwrote default one. Long story short, i think it was resolved following https://serverfault.com/questions/81844 ... pto-so-1-1.

Any suggestion as to why I receive the above error message?

Many thanks!

Re: Compiling OpenVPN 2.4 on Linux Mint 18

Posted: Thu Jun 15, 2017 8:53 am
by Normando
I just found this: https://community.openvpn.net/openvpn/ticket/802
The openssl version I installed is 1.1.0f. Is that why I am getting the error message above?
If so, any idea if I can downgrade openssl and what version?
Thanks,

Re: Compiling OpenVPN 2.4 on Linux Mint 18

Posted: Thu Jun 15, 2017 9:29 am
by Normando
Wonderful, i just screwed myself over. Compiled and Installed 1.0.2 from source and now openssl does not work at all: bash:

Code: Select all

user@machine ~/Downloads/openssl-1.0.2l $ openssl
bash: /usr/local/bin/openssl: No such file or directory
Thats what i get for being sleep deprived and irritated.
Any suggestions at this point would go a long way.

Re: Compiling OpenVPN 2.4 on Linux Mint 18

Posted: Thu Jun 15, 2017 1:00 pm
by TinCanTech
Officially, OpenVPN does not currently support OpenSSL 1.1x
and (technically) Linux Mint (Ubuntu) also officially uses OpenSSL 1.0.1f

So, you cannot use OpenSSL 1.1.x to build OpenVPN
and you better be careful what you do with OpenSSL Source 1.1x
because you can easily shoot yourself in the foot ..

If you want to get OpenVPN 2.4.x go here:
https://community.openvpn.net/openvpn/w ... twareRepos