wahern / luaossl

Most comprehensive OpenSSL module in the Lua universe.
http://25thandclement.com/~william/projects/luaossl.html
Other
140 stars 49 forks source link

Can't compile openssl #198

Closed BugAlpha closed 2 years ago

BugAlpha commented 2 years ago

OPENSSL VERSION : 1.1.1l FIPS 24 Aug 2021 OS : Fedora 35 Error:

enabling Lua 5.4
cp /home/mohammed/git_src/luaossl/config.h.guess /home/mohammed/git_src/luaossl/config.h
cp /home/mohammed/git_src/luaossl/config.h /home/mohammed/git_src/luaossl/src/config.h
mkdir -p /home/mohammed/git_src/luaossl/src/5.4
cc -O2 -std=gnu99 -fPIC -g -Wall -Wextra  -Wno-missing-field-initializers  -Wno-override-init -Wno-unused  -I/usr/include -D_REENTRANT -D_THREAD_SAFE -D_GNU_SOURCE  -DHAVE_CONFIG_H -DCOMPAT53_PREFIX=luaossl -c -o /home/mohammed/git_src/luaossl/src/5.4/openssl.o /home/mohammed/git_src/luaossl/src/openssl.c
/home/mohammed/git_src/luaossl/src/openssl.c:2294:3: error: conflicting types for ‘EVP_KDF_CTX’; have ‘struct <anonymous>’
 2294 | } EVP_KDF_CTX;
      |   ^~~~~~~~~~~
In file included from /usr/include/openssl/err.h:20,
                 from /home/mohammed/git_src/luaossl/src/openssl.c:70:
/usr/include/openssl/ossl_typ.h:100:31: note: previous declaration of ‘EVP_KDF_CTX’ with type ‘EVP_KDF_CTX’ {aka ‘struct evp_kdf_ctx_st’}
  100 | typedef struct evp_kdf_ctx_st EVP_KDF_CTX;
      |                               ^~~~~~~~~~~
/home/mohammed/git_src/luaossl/src/openssl.c:2296:13: error: conflicting types for ‘EVP_KDF_CTX_free’; have ‘void(EVP_KDF_CTX *)’
 2296 | static void EVP_KDF_CTX_free(EVP_KDF_CTX *kctx) {
      |             ^~~~~~~~~~~~~~~~
In file included from /home/mohammed/git_src/luaossl/src/openssl.c:617:
/usr/include/openssl/kdf.h:29:6: note: previous declaration of ‘EVP_KDF_CTX_free’ with type ‘void(EVP_KDF_CTX *)’ {aka ‘void(struct evp_kdf_ctx_st *)’}
   29 | void EVP_KDF_CTX_free(EVP_KDF_CTX *ctx);
      |      ^~~~~~~~~~~~~~~~
/home/mohammed/git_src/luaossl/src/openssl.c:2324:21: error: conflicting types for ‘EVP_KDF_CTX_new_id’; have ‘EVP_KDF_CTX *(int)’
 2324 | static EVP_KDF_CTX *EVP_KDF_CTX_new_id(int id) {
      |                     ^~~~~~~~~~~~~~~~~~
In file included from /home/mohammed/git_src/luaossl/src/openssl.c:617:
/usr/include/openssl/kdf.h:28:14: note: previous declaration of ‘EVP_KDF_CTX_new_id’ with type ‘EVP_KDF_CTX *(int)’ {aka ‘struct evp_kdf_ctx_st *(int)’}
   28 | EVP_KDF_CTX *EVP_KDF_CTX_new_id(int id);
      |              ^~~~~~~~~~~~~~~~~~
/home/mohammed/git_src/luaossl/src/openssl.c:2403: warning: "EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND" redefined
 2403 | #define EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND
      | 
In file included from /home/mohammed/git_src/luaossl/src/openssl.c:617:
/usr/include/openssl/kdf.h:65: note: this is the location of the previous definition
   65 | # define EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND  0
      | 
/home/mohammed/git_src/luaossl/src/openssl.c:2409: warning: "EVP_KDF_HKDF_MODE_EXTRACT_ONLY" redefined
 2409 | #define EVP_KDF_HKDF_MODE_EXTRACT_ONLY EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY
      | 
In file included from /home/mohammed/git_src/luaossl/src/openssl.c:617:
/usr/include/openssl/kdf.h:66: note: this is the location of the previous definition
   66 | # define EVP_KDF_HKDF_MODE_EXTRACT_ONLY        1
      | 
/home/mohammed/git_src/luaossl/src/openssl.c:2413: warning: "EVP_KDF_HKDF_MODE_EXPAND_ONLY" redefined
 2413 | #define EVP_KDF_HKDF_MODE_EXPAND_ONLY EVP_PKEY_HKDEF_MODE_EXPAND_ONLY
      | 
In file included from /home/mohammed/git_src/luaossl/src/openssl.c:617:
/usr/include/openssl/kdf.h:67: note: this is the location of the previous definition
   67 | # define EVP_KDF_HKDF_MODE_EXPAND_ONLY         2
      | 
/home/mohammed/git_src/luaossl/src/openssl.c:2416:12: error: conflicting types for ‘EVP_KDF_vctrl’; have ‘int(EVP_KDF_CTX *, int,  __va_list_tag *)’
 2416 | static int EVP_KDF_vctrl(EVP_KDF_CTX *kctx, int cmd, va_list args) {
      |            ^~~~~~~~~~~~~
In file included from /home/mohammed/git_src/luaossl/src/openssl.c:617:
/usr/include/openssl/kdf.h:33:5: note: previous declaration of ‘EVP_KDF_vctrl’ with type ‘int(EVP_KDF_CTX *, int,  __va_list_tag *)’ {aka ‘int(struct evp_kdf_ctx_st *, int,  __va_list_tag *)’}
   33 | int EVP_KDF_vctrl(EVP_KDF_CTX *ctx, int cmd, va_list args);
      |     ^~~~~~~~~~~~~
/home/mohammed/git_src/luaossl/src/openssl.c:2581:12: error: conflicting types for ‘EVP_KDF_ctrl’; have ‘int(EVP_KDF_CTX *, int, ...)’
 2581 | static int EVP_KDF_ctrl(EVP_KDF_CTX *kctx, int cmd, ...) {
      |            ^~~~~~~~~~~~
In file included from /home/mohammed/git_src/luaossl/src/openssl.c:617:
/usr/include/openssl/kdf.h:32:5: note: previous declaration of ‘EVP_KDF_ctrl’ with type ‘int(EVP_KDF_CTX *, int, ...)’ {aka ‘int(struct evp_kdf_ctx_st *, int, ...)’}
   32 | int EVP_KDF_ctrl(EVP_KDF_CTX *ctx, int cmd, ...);
      |     ^~~~~~~~~~~~
/home/mohammed/git_src/luaossl/src/openssl.c:2592:15: error: conflicting types for ‘EVP_KDF_size’; have ‘size_t(EVP_KDF_CTX *)’ {aka ‘long unsigned int(EVP_KDF_CTX *)’}
 2592 | static size_t EVP_KDF_size(EVP_KDF_CTX *kctx) {
      |               ^~~~~~~~~~~~
In file included from /home/mohammed/git_src/luaossl/src/openssl.c:617:
/usr/include/openssl/kdf.h:35:8: note: previous declaration of ‘EVP_KDF_size’ with type ‘size_t(EVP_KDF_CTX *)’ {aka ‘long unsigned int(struct evp_kdf_ctx_st *)’}
   35 | size_t EVP_KDF_size(EVP_KDF_CTX *ctx);
      |        ^~~~~~~~~~~~
/home/mohammed/git_src/luaossl/src/openssl.c:2610:12: error: conflicting types for ‘EVP_KDF_derive’; have ‘int(EVP_KDF_CTX *, unsigned char *, size_t *)’ {aka ‘int(EVP_KDF_CTX *, unsigned char *, long unsigned int *)’}
 2610 | static int EVP_KDF_derive(EVP_KDF_CTX *kctx, unsigned char *out, size_t *outlen) {
      |            ^~~~~~~~~~~~~~
In file included from /home/mohammed/git_src/luaossl/src/openssl.c:617:
/usr/include/openssl/kdf.h:36:5: note: previous declaration of ‘EVP_KDF_derive’ with type ‘int(EVP_KDF_CTX *, unsigned char *, size_t)’ {aka ‘int(struct evp_kdf_ctx_st *, unsigned char *, long unsigned int)’}
   36 | int EVP_KDF_derive(EVP_KDF_CTX *ctx, unsigned char *key, size_t keylen);
      |     ^~~~~~~~~~~~~~
/home/mohammed/git_src/luaossl/src/openssl.c: In function ‘kdf_derive’:
/home/mohammed/git_src/luaossl/src/openssl.c:2403:46: error: ‘EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND’ undeclared (first use in this function)
 2403 | #define EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND
      |                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mohammed/git_src/luaossl/src/openssl.c:12142:33: note: in expansion of macro ‘EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND’
12142 |                                 EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND,
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mohammed/git_src/luaossl/src/openssl.c:2403:46: note: each undeclared identifier is reported only once for each function it appears in
 2403 | #define EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND
      |                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mohammed/git_src/luaossl/src/openssl.c:12142:33: note: in expansion of macro ‘EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND’
12142 |                                 EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND,
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mohammed/git_src/luaossl/src/openssl.c:2409:40: error: ‘EVP_KDF_HKDF_MODE_EXTRACT_ONLY’ undeclared (first use in this function)
 2409 | #define EVP_KDF_HKDF_MODE_EXTRACT_ONLY EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mohammed/git_src/luaossl/src/openssl.c:12145:33: note: in expansion of macro ‘EVP_KDF_HKDF_MODE_EXTRACT_ONLY’
12145 |                                 EVP_KDF_HKDF_MODE_EXTRACT_ONLY,
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mohammed/git_src/luaossl/src/openssl.c:2413:39: error: ‘EVP_KDF_HKDF_MODE_EXPAND_ONLY’ undeclared (first use in this function)
 2413 | #define EVP_KDF_HKDF_MODE_EXPAND_ONLY EVP_PKEY_HKDEF_MODE_EXPAND_ONLY
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mohammed/git_src/luaossl/src/openssl.c:12148:33: note: in expansion of macro ‘EVP_KDF_HKDF_MODE_EXPAND_ONLY’
12148 |                                 EVP_KDF_HKDF_MODE_EXPAND_ONLY,
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

What i have tried: Installing luaossl from luarocks Tried solution from #175

BugAlpha commented 2 years ago

Solution was adding CFLAGS="-O2 -fPIC -DHAVE_EVP_KDF_CTX=1" after make install