Hi all,
 
 thanks for your help on DH stuff :-)
Now I have a pb with RSA_sign().

I have a buffer and I want to sign it with my private key.

So I generate a key:

openssl genrsa -out key.pem 1024

then I have the following code:

"
rsa = RSA_new();
get_my_priv_RSA(&rsa);

sigbuf = malloc(RSA_size(rsa));
  
length_buffer = 99;
  
if (RSA_sign(NID_md5, 
       buf, 
       length_buffer, 
       sigbuf, 
      &siglen,
       rsa) != 1) {
   printf("Error while signing buffer..\n");
   error = ERR_get_error();
  if (error != NULL) {
          ERR_error_string(error, error_buf);
          printf("%s\n", error_buf);
      }
  }
"
I have no pb with "get_my_priv_RSA()"

but what is strange is that if length_buffer >= 100 then I have the
following errors :

error:0406C06E:rsa routines:RSA_padding_add_PKCS1_type_1:data too large
for key size


if length_buffer is the real length of my buffer then I have the following
errors:

error:04075070:rsa routines:RSA_sign:digest too big for rsa key

so I don't understand what is going on with the value 100...and more I
don't know how to sign my real buffer (length ~= 500 octets)

If anyone has an idea..don't hesitate :-)

Have a good week-end,

[EMAIL PROTECTED]

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

Reply via email to