However, i found some (old) sample code for EVP_PKEY_dup() under following
URL http://www.mail-archive.com/[EMAIL PROTECTED]/msg17680.html
and i have recompiled it to the following:
Unfortunately, it does crash with a segmentation 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 (rsa) {
9: EVP_PKEY_set1_RSA(pkey, RSAPrivateKey_dup(rsa));
10: RSA_free(rsa);
11: }
12: }
13: else {
14: pkey = 0;
15: }
16: return pkey;
17: }
Any idea ?
Kind regards, ara ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]