prbinu / tls-scan

An Internet scale, blazing fast SSL/TLS scanner ( non-blocking, event-driven )
https://prbinu.github.io/tls-scan
Other
283 stars 54 forks source link

/home/e/Downloads/ts-build-root/build/tls-scan-master/cert-parser.c:514: undefined reference to `SSLv3_client_method' collect2: error: ld returned 1 exit status #16

Closed ealashwali closed 5 years ago

ealashwali commented 5 years ago

I need to compile tls-scan on OpenSSL 1.1.0g with default settings (sslv3 disabled) except that I enable weak-ciphers because I need one DES cipher. Here is my config line that I edited in the 1.1.0 build file here: https://github.com/prbinu/tls-scan/blob/master/build-x86-64-openssl-1.1.0.sh I just changed the ./config command to: ./config enable-static-engine enable-weak-ssl-ciphers enable-zlib no-shared --prefix=${OUTDIR} --openssldir=${OUTDIR}/ssl -I${OUTDIR}/include -L${OUTDIR}/lib --with-zlib-lib=${OUTDIR}/lib --with-zlib-include=${OUTDIR}/include

When I run this command: sudo ./build-x86-64-openssl-1.1.0.sh I get these errors and warnings, apparently, tls-scan requires SSLv3 methods, but I do not want to enable SSLv3 in my case. All what I need is shown in my configuration command above, weak-ciphers but no weak versions needed. Can you please help me fix the issue?


cert-parser.c:514:12: warning: implicit declaration of function ‘SSLv3_client_method’; did you mean ‘SSLv23_client_method’? [-Wimplicit-function-declaration]
     return SSLv3_client_method();
            ^~~~~~~~~~~~~~~~~~~
            SSLv23_client_method
cert-parser.c:514:12: warning: return makes pointer from integer without a cast [-Wint-conversion]
     return SSLv3_client_method();
            ^~~~~~~~~~~~~~~~~~~~~
cert-parser.c:516:5: warning: ‘TLSv1_client_method’ is deprecated [-Wdeprecated-declarations]
     return TLSv1_client_method();
     ^~~~~~
In file included from /home/e/Downloads/ts-build-root/include/openssl/ct.h:13:0,
                 from /home/e/Downloads/ts-build-root/include/openssl/ssl.h:61,
                 from cert-parser.c:5:
/home/e/Downloads/ts-build-root/include/openssl/ssl.h:1626:45: note: declared here
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_client_method(void)) /* TLSv1.0 */
                                             ^
/home/e/Downloads/ts-build-root/include/openssl/opensslconf.h:96:35: note: in definition of macro ‘DECLARE_DEPRECATED’
 # define DECLARE_DEPRECATED(f)    f __attribute__ ((deprecated));
                                   ^
/home/e/Downloads/ts-build-root/include/openssl/ssl.h:1626:1: note: in expansion of macro ‘DEPRECATEDIN_1_1_0’
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_client_method(void)) /* TLSv1.0 */
 ^~~~~~~~~~~~~~~~~~
cert-parser.c:518:5: warning: ‘TLSv1_1_client_method’ is deprecated [-Wdeprecated-declarations]
     return TLSv1_1_client_method();
     ^~~~~~
In file included from /home/e/Downloads/ts-build-root/include/openssl/ct.h:13:0,
                 from /home/e/Downloads/ts-build-root/include/openssl/ssl.h:61,
                 from cert-parser.c:5:
/home/e/Downloads/ts-build-root/include/openssl/ssl.h:1632:45: note: declared here
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_1_client_method(void)) /* TLSv1.1 */
                                             ^
/home/e/Downloads/ts-build-root/include/openssl/opensslconf.h:96:35: note: in definition of macro ‘DECLARE_DEPRECATED’
 # define DECLARE_DEPRECATED(f)    f __attribute__ ((deprecated));
                                   ^
/home/e/Downloads/ts-build-root/include/openssl/ssl.h:1632:1: note: in expansion of macro ‘DEPRECATEDIN_1_1_0’
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_1_client_method(void)) /* TLSv1.1 */
 ^~~~~~~~~~~~~~~~~~
cert-parser.c:520:5: warning: ‘TLSv1_2_client_method’ is deprecated [-Wdeprecated-declarations]
     return TLSv1_2_client_method();
     ^~~~~~
In file included from /home/e/Downloads/ts-build-root/include/openssl/ct.h:13:0,
                 from /home/e/Downloads/ts-build-root/include/openssl/ssl.h:61,
                 from cert-parser.c:5:
/home/e/Downloads/ts-build-root/include/openssl/ssl.h:1638:45: note: declared here
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_2_client_method(void)) /* TLSv1.2 */
                                             ^
/home/e/Downloads/ts-build-root/include/openssl/opensslconf.h:96:35: note: in definition of macro ‘DECLARE_DEPRECATED’
 # define DECLARE_DEPRECATED(f)    f __attribute__ ((deprecated));
                                   ^
/home/e/Downloads/ts-build-root/include/openssl/ssl.h:1638:1: note: in expansion of macro ‘DEPRECATEDIN_1_1_0’
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_2_client_method(void)) /* TLSv1.2 */
 ^~~~~~~~~~~~~~~~~~
gcc -I./include -I /home/e/Downloads/ts-build-root/include -Wall -Wundef -Wshadow -Wunreachable-code -Wswitch-default -Wcast-align -pedantic -g -std=c99 -Wl,-rpath,/home/e/Downloads/ts-build-root/lib -D_GNU_SOURCE   -c -o common.o common.c
common.c: In function ‘init_stats’:
common.c:15:3: warning: implicit declaration of function ‘gettimeofday’ [-Wimplicit-function-declaration]
   gettimeofday(&st->start_time, NULL);
   ^~~~~~~~~~~~
gcc -I./include -I /home/e/Downloads/ts-build-root/include -Wall -Wundef -Wshadow -Wunreachable-code -Wswitch-default -Wcast-align -pedantic -g -std=c99 -Wl,-rpath,/home/e/Downloads/ts-build-root/lib -D_GNU_SOURCE   -c -o proto-adapters.o proto-adapters.c
proto-adapters.c: In function ‘on_smtp_read’:
proto-adapters.c:203:31: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 123 [-Wformat-truncation=]
     snprintf(ehlo, 128, "EHLO %s\r\n", cli->host);
                               ^~
proto-adapters.c:203:5: note: ‘snprintf’ output between 8 and 263 bytes into a destination of size 128
     snprintf(ehlo, 128, "EHLO %s\r\n", cli->host);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -I./include -I /home/e/Downloads/ts-build-root/include -Wall -Wundef -Wshadow -Wunreachable-code -Wswitch-default -Wcast-align -pedantic -g -std=c99 -Wl,-rpath,/home/e/Downloads/ts-build-root/lib -D_GNU_SOURCE   -c -o main.o main.c
main.c: In function ‘ts_ssl_destroy’:
main.c:241:3: warning: ‘ERR_remove_thread_state’ is deprecated [-Wdeprecated-declarations]
   ERR_remove_thread_state(NULL);
   ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/e/Downloads/ts-build-root/include/openssl/ct.h:13:0,
                 from /home/e/Downloads/ts-build-root/include/openssl/ssl.h:61,
                 from main.c:17:
/home/e/Downloads/ts-build-root/include/openssl/err.h:247:25: note: declared here
 DEPRECATEDIN_1_1_0(void ERR_remove_thread_state(void *))
                         ^
/home/e/Downloads/ts-build-root/include/openssl/opensslconf.h:96:35: note: in definition of macro ‘DECLARE_DEPRECATED’
 # define DECLARE_DEPRECATED(f)    f __attribute__ ((deprecated));
                                   ^
/home/e/Downloads/ts-build-root/include/openssl/err.h:247:1: note: in expansion of macro ‘DEPRECATEDIN_1_1_0’
 DEPRECATEDIN_1_1_0(void ERR_remove_thread_state(void *))
 ^~~~~~~~~~~~~~~~~~
main.c: In function ‘main’:
main.c:1427:53: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
     fprintf(stderr, " [%d] elapsed-time        : %llu.%llu secs\n",
                                                  ~~~^
                                                  %lu
                                             getpid(),  et/1000000, et%1000000);
                                                        ~~~~~~~~~~
main.c:1427:58: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
     fprintf(stderr, " [%d] elapsed-time        : %llu.%llu secs\n",
                                                       ~~~^
                                                       %lu
                                             getpid(),  et/1000000, et%1000000);
                                                                    ~~~~~~~~~~
main.c:1453:39: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
     fprintf(stderr, "elapsed-time: %llu.%llu secs\n", et/1000000, et%1000000);
                                    ~~~^               ~~~~~~~~~~
                                    %lu
main.c:1453:44: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
     fprintf(stderr, "elapsed-time: %llu.%llu secs\n", et/1000000, et%1000000);
                                         ~~~^                      ~~~~~~~~~~
                                         %lu
main.c: In function ‘ts_scan_tcp_connect’:
main.c:769:24: warning: ‘%d’ directive writing between 1 and 5 bytes into a region of size between 0 and 255 [-Wformat-overflow=]
   sprintf(ip_port, "%s:%d", cli->ip, cli->port);
                        ^~
main.c:769:3: note: ‘sprintf’ output between 3 and 262 bytes into a destination of size 256
   sprintf(ip_port, "%s:%d", cli->ip, cli->port);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -o tls-scan cert-parser.o common.o proto-adapters.o main.o -L /home/e/Downloads/ts-build-root/lib -L /home/e/Downloads/ts-build-root/lib -lssl -L /home/e/Downloads/ts-build-root/lib -lcrypto -L /home/e/Downloads/ts-build-root/lib -levent -L /home/e/Downloads/ts-build-root/lib -levent_openssl -ldl -lpthread -L /home/e/Downloads/ts-build-root/lib -lz -lrt
cert-parser.o: In function `ts_tls_get_method':
/home/e/Downloads/ts-build-root/build/tls-scan-master/cert-parser.c:514: undefined reference to `SSLv3_client_method'
collect2: error: ld returned 1 exit status
Makefile:32: recipe for target 'tls-scan' failed
make: *** [tls-scan] Error 1
prbinu commented 5 years ago

Is this still an issue?

ealashwali commented 5 years ago

Yes. I can't compile tls-scan with OpenSSL1.1.0g without enabling ssl3 (which I do not want to enable as if it enabled it gets negotiated, and I do not want this).

prbinu commented 5 years ago

/home/e/Downloads/ts-build-root/build/tls-scan-master/cert-parser.c:514: undefined reference to `SSLv3_client_method' collect2: error: ld returned 1 exit status

You probably need to comment out the above line in order to proceed.

ealashwali commented 5 years ago

The line you are referring to the error message I get: /home/e/Downloads/ts-build-root/build/tls-scan-master/cert-parser.c:514: undefined reference toSSLv3_client_method'` collect2: error: ld returned 1 exit status

If you mean just commenting that line, it is a return statement in a switch statement. I tried to return "null", it compiles. When I run tls-scan to connect to a host I get error dump memory I guess.

Note that I need SSLv3 ciphers, but not version. These are two separate things.

ealashwali commented 5 years ago

If I want to compile my local modified version, will the ./build take my local files? or fetch a new fresh online from your repo.?

prbinu commented 5 years ago

if you are using build-x86-64-openssl-1.1.0.sh, then it pulls/overwrite locally modified version. However you may modify the script (comment-out pull/overwrite lines)