Turns out my problem is just a variation of the Why do I get a "PRNG not
seeded" error message? at http://www.openssl.org/support/faq.html#6

If I revise the test program to read:

#include <openssl/rsa.h>
#include <openssl/bn.h>
#include <openssl/err.h>
#include <openssl/rand.h>

static const char rnd_seed[] = "string to make the random number generator
think it has entropy";

int main(void) {
  RSA *key;

//  RAND_seed(rnd_seed, sizeof rnd_seed); /* or OAEP may fail */

  key=RSA_generate_key(32,3,NULL,NULL);

  if(key==NULL) {
    printf("NO RSA!\n\n");
    ERR_load_crypto_strings();
    ERR_print_errors_fp(stdout);
  }
  else
    printf("RSA OK!\n");

  return(0);
}

Leaving the RAND_seed() function commented out, as above, causes the test to
fail, as it should, and it does return the correct error. Removing the
comments gets "RSA OK!".

So it appears there's nothing wrong with my build of OpenSSL (I do have to
go back and test a build with rsaref2 to see if that was working all along,
too).

Thank you to the folks that responded. I never would have figured it out on
my own.

-David Hesprich

--
David G. Hesprich, CISSP
Technical Solutions Consultant
Sprint Enterprise Network Services
Numeric Pager:800-724-3329 PIN 382-8387
Alpha Pager: [EMAIL PROTECTED]

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to