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.