haproxytech / haproxy-lua-oauth

JWT Validation implementation for HAProxy Lua host
Apache License 2.0
105 stars 50 forks source link

Unable to install on Centos8 #9

Closed rossworth closed 3 years ago

rossworth commented 4 years ago

Using Centos 8.2.2004 When installing using ./install.sh luajwt the following error is generated during luaossl installation

/usr/src/luaossl-master/src/openssl.c:12146:5: note: in expansion of macro ‘EVP_KDF_HKDF_MODE_EXPAND_ONLY’
     EVP_KDF_HKDF_MODE_EXPAND_ONLY,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [/usr/src/luaossl-master/src/GNUmakefile:63: /usr/src/luaossl-master/src/5.3/openssl.o] Error 1

I believe this is related to https://github.com/wahern/luaossl/issues/175 but I don't understand how to fix the installer so that the install completes.

NickMRamirez commented 4 years ago

I am also seeing this error. It certainly looks like a problem coming from the luaossl-master library. Here is the full output:

$ sudo ./install.sh luajwt
[+] Installing yum dependencies
[+] Downloading Lua
[+] Building Lua
[+] Installing Lua
[+] Downloading haproxy-lua-jwt dependencies
[+] Installing haproxy-lua-jwt dependencies
//usr/src/luaossl-master/src/openssl.c:2294:3: error: conflicting types for ‘EVP_KDF_CTX’
 } EVP_KDF_CTX;
   ^~~~~~~~~~~
In file included from /usr/include/openssl/err.h:20,
                 from /usr/src/luaossl-master/src/openssl.c:70:
/usr/include/openssl/ossl_typ.h:100:31: note: previous declaration of ‘EVP_KDF_CTX’ was here
 typedef struct evp_kdf_ctx_st EVP_KDF_CTX;
                               ^~~~~~~~~~~
/usr/src/luaossl-master/src/openssl.c:2296:13: error: conflicting types for ‘EVP_KDF_CTX_free’
 static void EVP_KDF_CTX_free(EVP_KDF_CTX *kctx) {
             ^~~~~~~~~~~~~~~~
In file included from /usr/src/luaossl-master/src/openssl.c:617:
/usr/include/openssl/kdf.h:29:6: note: previous declaration of ‘EVP_KDF_CTX_free’ was here
 void EVP_KDF_CTX_free(EVP_KDF_CTX *ctx);
      ^~~~~~~~~~~~~~~~
/usr/src/luaossl-master/src/openssl.c:2324:21: error: conflicting types for ‘EVP_KDF_CTX_new_id’
 static EVP_KDF_CTX *EVP_KDF_CTX_new_id(int id) {
                     ^~~~~~~~~~~~~~~~~~
In file included from /usr/src/luaossl-master/src/openssl.c:617:
/usr/include/openssl/kdf.h:28:14: note: previous declaration of ‘EVP_KDF_CTX_new_id’ was here
 EVP_KDF_CTX *EVP_KDF_CTX_new_id(int id);
              ^~~~~~~~~~~~~~~~~~
/usr/src/luaossl-master/src/openssl.c:2403: warning: "EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND" redefined
 #define EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND

In file included from /usr/src/luaossl-master/src/openssl.c:617:
/usr/include/openssl/kdf.h:65: note: this is the location of the previous definition
 # define EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND  0

/usr/src/luaossl-master/src/openssl.c:2409: warning: "EVP_KDF_HKDF_MODE_EXTRACT_ONLY" redefined
 #define EVP_KDF_HKDF_MODE_EXTRACT_ONLY EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY

In file included from /usr/src/luaossl-master/src/openssl.c:617:
/usr/include/openssl/kdf.h:66: note: this is the location of the previous definition
 # define EVP_KDF_HKDF_MODE_EXTRACT_ONLY        1

/usr/src/luaossl-master/src/openssl.c:2413: warning: "EVP_KDF_HKDF_MODE_EXPAND_ONLY" redefined
 #define EVP_KDF_HKDF_MODE_EXPAND_ONLY EVP_PKEY_HKDEF_MODE_EXPAND_ONLY

In file included from /usr/src/luaossl-master/src/openssl.c:617:
/usr/include/openssl/kdf.h:67: note: this is the location of the previous definition
 # define EVP_KDF_HKDF_MODE_EXPAND_ONLY         2

/usr/src/luaossl-master/src/openssl.c:2416:12: error: conflicting types for ‘EVP_KDF_vctrl’
 static int EVP_KDF_vctrl(EVP_KDF_CTX *kctx, int cmd, va_list args) {
            ^~~~~~~~~~~~~
In file included from /usr/src/luaossl-master/src/openssl.c:617:
/usr/include/openssl/kdf.h:33:5: note: previous declaration of ‘EVP_KDF_vctrl’ was here
 int EVP_KDF_vctrl(EVP_KDF_CTX *ctx, int cmd, va_list args);
     ^~~~~~~~~~~~~
/usr/src/luaossl-master/src/openssl.c:2581:12: error: conflicting types for ‘EVP_KDF_ctrl’
 static int EVP_KDF_ctrl(EVP_KDF_CTX *kctx, int cmd, ...) {
            ^~~~~~~~~~~~
In file included from /usr/src/luaossl-master/src/openssl.c:617:
/usr/include/openssl/kdf.h:32:5: note: previous declaration of ‘EVP_KDF_ctrl’ was here
 int EVP_KDF_ctrl(EVP_KDF_CTX *ctx, int cmd, ...);
     ^~~~~~~~~~~~
/usr/src/luaossl-master/src/openssl.c:2592:15: error: conflicting types for ‘EVP_KDF_size’
 static size_t EVP_KDF_size(EVP_KDF_CTX *kctx) {
               ^~~~~~~~~~~~
In file included from /usr/src/luaossl-master/src/openssl.c:617:
/usr/include/openssl/kdf.h:35:8: note: previous declaration of ‘EVP_KDF_size’ was here
 size_t EVP_KDF_size(EVP_KDF_CTX *ctx);
        ^~~~~~~~~~~~
/usr/src/luaossl-master/src/openssl.c:2610:12: error: conflicting types for ‘EVP_KDF_derive’
 static int EVP_KDF_derive(EVP_KDF_CTX *kctx, unsigned char *out, size_t *outlen) {
            ^~~~~~~~~~~~~~
In file included from /usr/src/luaossl-master/src/openssl.c:617:
/usr/include/openssl/kdf.h:36:5: note: previous declaration of ‘EVP_KDF_derive’ was here
 int EVP_KDF_derive(EVP_KDF_CTX *ctx, unsigned char *key, size_t keylen);
     ^~~~~~~~~~~~~~
-/usr/src/luaossl-master/src/openssl.c: In function ‘kdf_derive’:
/usr/src/luaossl-master/src/openssl.c:2403:46: error: ‘EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND’ undeclared (first use in this function)
 #define EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/luaossl-master/src/openssl.c:12140:5: note: in expansion of macro ‘EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND’
     EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/luaossl-master/src/openssl.c:2403:46: note: each undeclared identifier is reported only once for each function it appears in
 #define EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/luaossl-master/src/openssl.c:12140:5: note: in expansion of macro ‘EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND’
     EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\/usr/src/luaossl-master/src/openssl.c:2409:40: error: ‘EVP_KDF_HKDF_MODE_EXTRACT_ONLY’ undeclared (first use in this function)
 #define EVP_KDF_HKDF_MODE_EXTRACT_ONLY EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/luaossl-master/src/openssl.c:12143:5: note: in expansion of macro ‘EVP_KDF_HKDF_MODE_EXTRACT_ONLY’
     EVP_KDF_HKDF_MODE_EXTRACT_ONLY,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/luaossl-master/src/openssl.c:2413:39: error: ‘EVP_KDF_HKDF_MODE_EXPAND_ONLY’ undeclared (first use in this function)
 #define EVP_KDF_HKDF_MODE_EXPAND_ONLY EVP_PKEY_HKDEF_MODE_EXPAND_ONLY
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/luaossl-master/src/openssl.c:12146:5: note: in expansion of macro ‘EVP_KDF_HKDF_MODE_EXPAND_ONLY’
     EVP_KDF_HKDF_MODE_EXPAND_ONLY,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [/usr/src/luaossl-master/src/GNUmakefile:63: /usr/src/luaossl-master/src/5.3/openssl.o] Error 1
[+] Downloading haproxy-lua-jwt
[+] Installing haproxy-lua-jwt
NickMRamirez commented 4 years ago

As a temporary workaround, I found that using an older version of the luaossl package works.

In the download_luajwt_deps function, replace:

curl -sLO https://github.com/wahern/luaossl/archive/master.zip
unzip -qo master.zip

with:

curl -sLO https://github.com/wahern/luaossl/archive/rel-20181207.zip
unzip -qo rel-20181207.zip

In the install_luajwt_deps function, replace:

cd luaossl-master/

with:

cd luaossl-rel-20181207
NickMRamirez commented 4 years ago

Related to wahern/luaossl#175

NickMRamirez commented 3 years ago

The latest check-in fixes this by pinning the version of luaossl that we use to "rel-20181207".