Hi,

Your sample runs perfectly here: compiled using VC++ 2008 against 1.0.0a in Release and Debug modes and ran on Windows 7 system (hardware DEP enabled). What compiler are you using? Can you perform a debug build and give us a crash trace?

--
Mounir IDRASSI
IDRIX
http://www.idrix.fr

On 06/10/2010 00:31, Kenneth Goldman wrote:
I'm getting a PEM_write_PUBKEY() segfault.  This is existing code that
works
with 0.9.8 with Windows or 1.0.0. with Linux, but fails with 1.0.0. and
Windows.
What's my latent bug?

Here's a small sample that fails:

     RSA *rsa = RSA_generate_key(512, 65537, NULL, NULL);
     EVP_PKEY *pkey = EVP_PKEY_new();
     EVP_PKEY_assign_RSA(pkey, rsa);
     FILE *file = fopen("tmp.pem", "wb");

     PEM_write_PUBKEY(file, pkey);

In my actual application, I set rsa->n and rsa->e to bignums that
I generate.  I think that should be enough to write the public key.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to