vtsls/openssl.c:
const unsigned char *p;
...
long len = SSL_get_tlsext_status_ocsp_resp(BACKEND->handle, &p);
However, SSL_get_tlsext_status_ocsp_resp is declared as long SSL_get_tlsext_status_ocsp_resp(ssl, unsigned char **resp);
SSL_get_tlsext_status_ocsp_resp is preprocessed into a call to long SSL_ctrl(SSL *ssl, int cmd, long larg, void *parg); where parg is the last p argument. Effectively, const gets lost if const unsigned char** gets converted to void*. In ms compiler that results in a compilation error.
If I change declaration to unsigned char *p; then it fails to compile on linux a few lines below:
openssl.c:1712:33: error: passing 'unsigned char **' to parameter of type 'const unsigned char **' discards qualifiers in nested pointer types
vtsls/openssl.c:
However, SSL_get_tlsext_status_ocsp_resp is declared as
long SSL_get_tlsext_status_ocsp_resp(ssl, unsigned char **resp);SSL_get_tlsext_status_ocsp_respis preprocessed into a call tolong SSL_ctrl(SSL *ssl, int cmd, long larg, void *parg);where parg is the lastpargument. Effectively, const gets lost ifconst unsigned char**gets converted tovoid*. In ms compiler that results in a compilation error.If I change declaration to
unsigned char *p;then it fails to compile on linux a few lines below:curl/lib/vtls/openssl.c
Line 1695 in 2fa0d57