On Tue, Jul 04, 2017 at 11:07:31AM +0300, Dmitry Sivachenko wrote:
> On FreeBSD it does fix a build (though new warning appear which I can't
> explain because of the lack of SSL knowledge):
>
> src/ssl_sock.c:803:2: warning: incompatible integer to pointer conversion
> assigning to 'void (*)(void)' from 'long' [-Wint-conversion]
> SSL_CTX_get_tlsext_status_cb(ctx, &callback);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> src/ssl_sock.c:801:6: note: expanded from macro 'SSL_CTX_get_tlsext_status_cb'
> ...= SSL_CTX_ctrl(ctx,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB,0, (void
> (**)(void))cb)
> ^
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 1 warning generated.
According to the man page, SSL_CTX_ctrl() returns a long. So the patch should
be changed so that the macro is defined this way :
#define SSL_CTX_get_tlsext_status_cb(ctx, cb) \
*cb = (void *)SSL_CTX_ctrl(ctx,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB,0, (void
(**)(void))cb)
> The patch was taken form OpenBSD, so in general it should be fine.
Aside the added warning ;-)
> Review from some SSL-aware guys on your side would be nice.
I'll ping Emeric about it, but I prefer to ensure it works before, it
will reduce his sighing ;-)
Cheers,
willy