httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William A Rowe Jr <wr...@rowe-clan.net>
Subject Re: SSL_CTX_set_ecdh_auto noop OpenSSL 1.1.0?
Date Thu, 16 Feb 2017 23:20:54 GMT
On Thu, Feb 16, 2017 at 4:39 PM, Yann Ylavic <ylavic.dev@gmail.com> wrote:
> On Thu, Feb 16, 2017 at 11:33 PM, Yann Ylavic <ylavic.dev@gmail.com> wrote:
>> On Thu, Feb 16, 2017 at 10:52 PM, William A Rowe Jr <wrowe@rowe-clan.net> wrote:
>>> I'm not clear that this was a good usage of the current API...
>>>
>>> In file included from httpd-2.x/modules/ssl/ssl_private.h:90:0,
>>>                  from httpd-2.x/modules/ssl/ssl_engine_init.c:29:
>>> httpd-2.x/modules/ssl/ssl_engine_init.c: In function ‘ssl_init_server_certs’:
>>> include/openssl/ssl.h:1287:51: warning: statement with no effect
>>> [-Wunused-value]
>>>  # define SSL_CTX_set_ecdh_auto(dummy, onoff)      ((onoff) != 0)
>>>                                                    ^
>>> httpd-2.x/modules/ssl/ssl_engine_init.c:1328:9: note: in expansion of
>>> macro ‘SSL_CTX_set_ecdh_auto’
>>>          SSL_CTX_set_ecdh_auto(mctx->ssl_ctx, 1);
>>>          ^~~~~~~~~~~~~~~~~~~~~
>>
>> Looks like OpenSSL missed a cast to void in its macro implementation.
>> I think goal was to still evaluate "onoff", but in this case
>> "((void)((onoff) != 0))" or the usual "do (void)((onoff) != 0); while
>> (0)" would have been more clean/compatible...
>
> Wait, SSL_CTX_set_ecdh_auto() used to return an int so the macro is
> right actually.
> Hmm, picky compiler :)
>
>>
>> I guess we'll have to work around this with our own (void) casting.
>
> That still holds...

It was complaining about the unused 'dummy'. IMO, and perhaps the fact
that (1 != 0) evaluates to a constant expression.

Easier to drop it from the compilation path for 1.1.0+

Mime
View raw message