Skip to content

SSL_get_tlsext_status_ocsp_resp expects pointer to non-const pointer #3477

@pps83

Description

@pps83

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

const unsigned char *p;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions