Opened 6 months ago

Closed 4 months ago

#1467 closed Bug / Defect (wontfix)

Building 2.4.12 on Ubuntu Jammy fails

Reported by: Werner1 Owned by:
Priority: minor Milestone:
Component: Building / Compiling Version: OpenVPN 2.4.9 (Community Ed)
Severity: Not set (select this one, unless your'e a OpenVPN developer) Keywords: EVP_PKEY
Cc:

Description

Hey there,

I tried to compile OpenVPN 2.4 branch from tarball on Ubuntu Jammy but ran into build errors.

gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include  -I../../include -I../../src/compat        -DPLUGIN_LIBDIR=\"/usr/local/lib/openvpn/plugins\"  -Wall -Wno-unused-parameter -Wno-unused-function -g -O2 -std=c99 -MT fdmisc.o -MD -MP -MF .deps/fdmisc.Tpo -c -o fdmisc.o fdmisc.c
mv -f .deps/comp-lz4.Tpo .deps/comp-lz4.Po
In file included from crypto_openssl.h:32,
                 from crypto_backend.h:33,
                 from crypto.h:128,
                 from crypto_openssl.c:42:
openssl_compat.h:281:1: error: static declaration of ‘EVP_PKEY_get_id’ follows non-static declaration
  281 | EVP_PKEY_id(const EVP_PKEY *pkey)
      | ^~~~~~~~~~~
/usr/include/openssl/evp.h:1306:5: note: previous declaration of ‘EVP_PKEY_get_id’ with type ‘int(const EVP_PKEY *)’ {aka ‘int(const struct evp_pkey_st *)’}
 1306 | int EVP_PKEY_get_id(const EVP_PKEY *pkey);
      |     ^~~~~~~~~~~~~~~
In file included from crypto_openssl.c:44:
openssl_compat.h: In function ‘EVP_PKEY_get_id’:
openssl_compat.h:283:23: error: invalid use of incomplete typedef ‘EVP_PKEY’ {aka ‘const struct evp_pkey_st’}
  283 |     return pkey ? pkey->type : EVP_PKEY_NONE;
      |                       ^~

Full configure and make log:
https://paste.debian.net/hidden/6269dd9e/
All dependencies were installed via apt.
The building was performed withing an LXC container.

I did not select Milestone or Version since I could not find the proper ones.
I selected "minor" for priority since branch is oldstable and Ubuntu ships their own packages made from stable branch.

Please let me know if I missed something.

Change History (2)

comment:1 Changed 5 months ago by Selva Nair

/usr/include/openssl/evp.h:1306:5: note: previous declaration of ‘EVP_PKEY_get_id’ with type ‘int(const EVP_PKEY *)’ {aka ‘int(const struct evp_pkey_st *)’}
 1306 | int EVP_PKEY_get_id(const EVP_PKEY *pkey);

Looks like you are building against OpenSSL 3 which is not supported in OpenVPN 2.4 branch. Either install OpenSSL 1.1.1 and build against it by specifying OPENSSL_CFLAGS and OPENSSL_LIBS to configure, or use the latest 2.5 release.

comment:2 Changed 4 months ago by Gert Döring

Resolution: wontfix
Status: newclosed
Version: OpenVPN 2.4.9 (Community Ed)

Yeah, what Selva said. Use 2.5.7.

2.4.x is very old, and should not be used for new deployments - 2.4.12 is, technically, "a new release" but that's just maintenance, bugfixes for old code base.

Closing this ticket, as OpenSSL 3 support will not be added to 2.4

Note: See TracTickets for help on using tickets.