I am working with OpenSSL library. I am trying to access rsa_meth attribute of struct engine_st. The code for doing is as follows:
ctx->client_cert_engine->rsa_meth
where ctx is of type SSL_CTX *.
I tried to include all the necessary header files but still it is giving me:
dereferencing pointer to incomplete type.
Although, if I remove rsa_meth then it works fine.
engine_st (which is what client_cert_engine is) is an internal struct definition (it's in crypto/engine/eng_int.h) and is not exposed in the public header. This is (probably) to prevent a binary compatibility issue in the event of a change to the struct. Instead of trying to dereference, use the getters defined in the engine.h header:
You are dereferencing ctx->client_cert_engine, which is an ENGINE * (pointer to struct engine_st).
Try including
<openssl/engine.h>
.This means that RSA_METH structure is not defined. You need to include its definition which is in openssl/rsa.h
Please include openssl/rsa.h or
add
to your code before this code.