Hello;
   
  I have compiled the source code from the version OpenSSL 0.9.8e. Now I am 
trying to use the libraries generated in the following program portion : 
   
   
  RSA *rsa=NULL;
  RSA *ConstructedRSA = NULL;
   
  unsigned char *pvk_buf, *p ;
  int pvk_len;
  
  
  ERR_load_crypto_strings();
  rsa = RSA_new();
  ConstructedRSA = RSA_new();
  rsa = RSA_generate_key(1024, RSA_F4, NULL, NULL);
  if (rsa == NULL)
  {
  ERR_print_errors_fp(stderr);
  exit(1);
  }
  result = RSA_check_key(rsa);
  if (result <= 0)
  {
  ERR_print_errors_fp(stderr);
  exit(1);
  }
  pvk_len = i2d_RSAPrivateKey(rsa, NULL);
  if(pvk_len>0){
  pvk_buf = (unsigned char *)malloc(pvk_len);
  memset(pvk_buf,0,pvk_len);
  p = pvk_buf;
  i2d_RSAPrivateKey(rsa, &p);
  
  ConstructedRSA = d2i_RSAPrivateKey(NULL, (const unsigned char **)&p, pvk_len);
   
  The problem is that the  buffer p don't contain any values for the rsa key.
  So, what is wrong ?
   
  Thanks

       
---------------------------------
Be smarter than spam. See how smart SpamGuard is at giving junk email the boot 
with the All-new Yahoo! Mail  

Reply via email to