[noPoll] Compile failure with SSL 1.0.2h

Félix xcodexif en xif.fr
Jue Mayo 26 22:30:51 CEST 2016


I already faced this problem some times ago, but I was waiting for the release of the new version of OpenSSL on arch to confirm this.
I should have reported thus before the new release of noPoll...
This is observed also with LibreSSL on OS X.

The new, recommended way in OpenSSL is (I think) to use TLS_client_method/TLS_server_method. From the doc :

> TLS_method(), TLS_server_method(), TLS_client_method()
> These are the general-purpose version-flexible SSL/TLS methods. The actual protocol version used will be negotiated to the highest version mutually supported by the client and the server. The supported protocols are SSLv3, TLSv1, TLSv1.1 and TLSv1.2. Applications should use these methods, and avoid the version-specific methods described below.

I propose for noPoll to use an auto-detection of available methods in the autoconf, and to use TLS_{client,server}_method by default if available.
But I am not an OpenSSL expert at all.

Moreover, there is a minor issue on OS X :

nopoll-regression-client.c:539:18: error: format specifies type 'long' but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat]
                                        total_read, stat_buf.st_size, retries); 
                                                    ^~~~~~~~~~~~~~~~
nopoll-regression-client.c:1220:26: error: format specifies type 'long' but the argument has type '__darwin_suseconds_t' (aka 'int') [-Werror,-Wformat]
                iterator, diff.tv_sec, diff.tv_usec);
                                       ^~~~~~~~~~~~

A simple cast should resolve this issue.

Thanks again Francis for your great job !

Le 26 mai 2016 à 19:36, Chris Severance <aur.severach en spamgourmet.com> a écrit :

> https://aur.archlinux.org/packages/nopoll/
> 
> Not compiling. Something in SSL seems to have changed.
> 
> % gcc --version
> gcc (GCC) 6.1.1 20160501
> Copyright (C) 2016 Free Software Foundation, Inc.
> 
> % openssl
> OpenSSL> version
> OpenSSL 1.0.2h  3 May 2016
> OpenSSL> quit
> 
> % gcc ... nopoll_conn.c
> nopoll_conn.c: In function '__nopoll_conn_get_ssl_context':
> nopoll_conn.c:550:35: error: implicit declaration of function
> 'SSLv3_client_method' [-Werror=implicit-function-declaration]
>   return SSL_CTX_new (is_client ? SSLv3_client_method () :
>   SSLv3_server_method ());
>                                   ^~~~~~~~~~~~~~~~~~~
> nopoll_conn.c:550:60: error: implicit declaration of function
> 'SSLv3_server_method' [-Werror=implicit-function-declaration]
>   return SSL_CTX_new (is_client ? SSLv3_client_method () :
>   SSLv3_server_method ());
>                                                            ^~~~~~~~~~~~~~~~~~~
> nopoll_conn.c:550:23: error: passing argument 1 of 'SSL_CTX_new' makes
> pointer from integer without a cast [-Werror=int-conversion]
>   return SSL_CTX_new (is_client ? SSLv3_client_method () :
>   SSLv3_server_method ());
>                       ^~~~~~~~~
> In file included from ./nopoll_private.h:46:0,
>                 from nopoll_conn.c:50:
> /usr/include/openssl/ssl.h:2131:10: note: expected 'const SSL_METHOD *
> {aka const struct ssl_method_st *}' but argument is of type 'int'
> SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth);
>          ^~~~~~~~~~~

----
Félix Faisant - xif.fr - PGP Pub Key footprint : CE67 00AE C4C3 2446 032C F89A 4E4F A7AF F464 8355



Más información sobre la lista de distribución noPoll