RSA);
RSA *rsa = EVP_PKEY_get1_RSA(pkey);
assert(rsa);
However, EVP_PKEY_get1_RSA(pkey) returns 0 with the error message
3073587352:error:0607907F:digital envelope
routines:EVP_PKEY_get1_RSA:expecting an rsa key:p_lib.c:288:
I had a look at the implementation of this function and found this:
Hi,
I need to set app data to an RSA object encapsulated in an EVP_PKEY, so
I did the following:
void set_app_data(EVP_PKEY *pkey)
{
...
rsa = EVP_PKEY_get1_RSA(pkey);
RSA_set_app_data(rsa, app_data);
RSA_free(rsa);
...
}
We shouldn't access
fault on line 7:
1: EVP_PKEY* _EVP_PKEY_dup(EVP_PKEY* p)
2: {
3: EVP_PKEY* pkey = EVP_PKEY_new();
4:
5: // ONLY FOR RSA
6: if (EVP_PKEY_type(p->type) == EVP_PKEY_RSA) {
7: RSA* rsa = EVP_PKEY_get1_RSA(p); //< crashes here
8: if (rs