James wrote:
>
> > dear all,
> >
> > i'm wrapping some of the functionality of the openssl library into a
> > set of C++ classes (as something to do really :) and i've hit a slight
> > snag: i can't find any way of duplicating EVP_PKEY instances! is there
> > a function similar to X509_dup() for EVP_PKEY's or am i going to have
> > to be brute-force about it!
>
> I've been doing the same thing, mostly as a way of learning the internals
> of OpenSSL.
>
> The only way I found to duplicate EVP_PKEYs was a brute force method,
> checking the type of the key, creating a new instance, and using
> EVP_PKEY_copy_parameters(). There are a couple of obscure flags in the
> EVP_PKEY structure that seem to affect the reference counting in the key
> being copied - I'm going to have to poke around a bit more before I can
> convince myself that I'm not leaking unfreed keys :-)
>
Hmm no EVP_PKEY_dup() function? Thats an omission which will be fixed.
Steve.
--
Dr Stephen N. Henson. http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED]
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]