Salut,
Je ne connais pas du tout cette interface, mais j'ai trouvé ça sur le net:
A frequent cause of problems is attempting to use the PEM routines like this:
X509 *x;
PEM_read_bio_X509(bp, &x, 0, NULL);
this is a bug because an attempt will be made to reuse the data at x which is an uninitialised pointer.
Ou un peu plus loin dans le même article:
BUGS
The PEM read routines in some versions of OpenSSL will not correctly reuse an existing structure. Therefore the following:
PEM_read_bio_X509(bp, &x, 0, NULL);
where x already contains a valid certificate, may not work, whereas:
X509_free(x);
x = PEM_read_bio_X509(bp, NULL, 0, NULL);
is guaranteed to work.
Peut être devrais-tu essayer de modifier ton appel:
pkey = PEM_read_bio_PrivateKey( bio, &pkey, NULL, password );
Par:
pkey = PEM_read_bio_PrivateKey( bio, NULL, NULL, password );
Partager