Nicholas Brawn wrote:
>
> I've just tried out something under the latest openssl library, and it's
> coredumping in BN_print() (after i call BN_print_fp). The actual code
> snippet is here:
>
> void
> dh_genparams()
> {
> DH *dh;
> FILE *output;
>
> fprintf(stderr,"Generating new DH parameters, please be
> patient...\n");
> dh = DH_generate_parameters(PRIME_LEN, DH_GENERATOR_5, NULL,
> NULL);
> BN_print_fp(stderr,dh->pub_key);
>
> output = fopen(PEMFILE,"w");
> PEM_write_DHparams(output,dh);
>
> return;
> }
>
>
> I see two possibilities here:
> 1. BN_print() has a bug.
> 2. I've fubared my code.
>
Maybe 2 :-)
I'd say dh->pub_key is NULL because you are just generating parameters
and not a public/private key pair.
If you want keys as well then call DH_generate_key() on 'dh'.
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]