Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dereferencing pointer error during compile #1659

Open
BaderSZ opened this issue Apr 25, 2020 · 7 comments
Open

Dereferencing pointer error during compile #1659

BaderSZ opened this issue Apr 25, 2020 · 7 comments

Comments

@BaderSZ
Copy link

BaderSZ commented Apr 25, 2020

During the compiling process, I came across an dereferencing error in rsa_pem_openssl.c:41:6

Steps to reproduce:

  1. git clone --recursive repo && cd tg/
  2. remove -Werror options in Makefile and Makefile.in
  3. run ./configure && make

Output:

gcc -I. -I. -I./tgl -g -O2  -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include/lua5.2  -DHAVE_CONFIG_H -Wall -Wextra -Wno-missing-field-initializers -Wno-deprecated-declarations -fno-strict-aliasing -fno-omit-frame-pointer -ggdb -Wno-unused-parameter -fPIC -iquote ./tgl -c -MP -MD -MF dep/crypto/rsa_pem_openssl.d -MQ objs/crypto/rsa_pem_openssl.o -o objs/crypto/rsa_pem_openssl.o tgl/crypto/rsa_pem_openssl.c
tgl/crypto/rsa_pem_openssl.c: In function ‘TGLC_rsa_new’:
tgl/crypto/rsa_pem_openssl.c:41:6: error: dereferencing pointer to incomplete type ‘RSA’ {aka ‘struct rsa_st’}
   41 |   ret->e = unwrap_bn (TGLC_bn_new ());
      |      ^~
tgl/crypto/rsa_pem_openssl.c: In function ‘TGLC_rsa_n’:
tgl/crypto/rsa_pem_openssl.c:52:1: warning: control reaches end of non-void function [-Wreturn-type]
   52 | RSA_GETTER(n);
      | ^~~~~~~~~~
tgl/crypto/rsa_pem_openssl.c: In function ‘TGLC_rsa_e’:
tgl/crypto/rsa_pem_openssl.c:53:1: warning: control reaches end of non-void function [-Wreturn-type]
   53 | RSA_GETTER(e);
      | ^~~~~~~~~~
make: *** [Makefile.tgl:20: objs/crypto/rsa_pem_openssl.o] Error 1

@BaderSZ
Copy link
Author

BaderSZ commented Apr 25, 2020

For more information, this was tested on:

  • OS: Debian testing bullseye
  • libreadline-dev: 8.0-4
  • libconfig-dev: 1.5-0.4
  • libssl-dev: 1.1.1f-1
  • lua: 5.2.4-1.1+b3
  • liblua5.2-dev: 5.2.4-1.1+b3
  • libevent-dev: 2.1.11-stable-1
  • libjansson-dev: 2.12-1
  • libpython-dev: 2.7.17-2
  • make: 4.2.1-1.2

@Paulchen232
Copy link

Try this:
sudo apt-get install libssl1.0-dev

@BaderSZ
Copy link
Author

BaderSZ commented Apr 25, 2020

I was able to reproduce this on Fedora 31. Both machines use openssl devel/libssl 1.1.1.

@Paulchen232 I've tested this on CentOS 7.7.1908 as well. It seems to compile with no warnings or errors on it. I'm guessing you're right and it is ssl >1.0 Neither debian sid nor fedora 31 offer openssl 1.0, since openssl <1.1.1 is considered out of support and insecure.

@ShizuhaAki
Copy link

Same problem here, and apt cannot find openssl 1.0

@Paulchen232
Copy link

On ubuntu I think you need this:
Ubuntu

@BaderSZ
Copy link
Author

BaderSZ commented May 1, 2020

@Paulchen232 that won't help. You'll need to use an older distribution that still has OpenSSL 1.0. Fixing this issue for all modern Distros and OSes shouldn't depend on using outdated software.

@Paulchen232
Copy link

Paulchen232 commented May 1, 2020

Perhaps this help:
Secure Sockets Layer toolkit - development files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants