Re: RSA_public_decrypt problem UPDATE

2007-08-02 Thread Marek Marcola
Hello, > I have found the reason for the problem. Deep inside my program was a bug > that switched modulus and exponent, so I set the wrong values to n and e. My first suggestion :-) > I've fixed the bug and also removed the leading 00 so that I get a good 128 > byte long modulus and a 4 byte lo

RE: RSA_public_decrypt problem

2007-08-01 Thread David Schwartz
> Same mistake as before: 119 means RSA_R_WRONG_SIGNATURE_LENGTH > > Frank Wockenfuß Perhaps you aren't using the same padding as the signature was made with? Perhaps what you have isn't really a signature at all. It's hard to say. DS ___

RE: RSA_public_decrypt problem

2007-08-01 Thread David Schwartz
> I do > > ENGINE_load_builtin_engines(); > > before calling the decrypt function. There is no other engine > attached, I use the standard engines from OpenSSL 0.9.8e. > > Are there other way to verify the signature with only the public key? RSA_verify. DS _

RE: RSA_public_decrypt problem

2007-08-01 Thread David Schwartz
> This is the first call in the engine and the set of n and e > doesn't raise any error (I've just tested it). The error occurs > on RSA_public_decrypt. > > Frank Wockenfuß I see no way RSA_public_decrypt can make ERR_GET_REASON return 101. If you're 100% absolutely positively sure that's happeni

RE: RSA_public_decrypt problem

2007-08-01 Thread David Schwartz
> > You're right, I get RSA_R_BAD_E_VALUE (101). Just took the wrong > > define for the mail. ERR_GET_REASON returns 101. > Only the RSA key generation function can produce this error. > Perhaps you had it left over from a previous function you called? > Perhaps your engine can generate this erro

Re: RSA_public_decrypt problem

2007-08-01 Thread Marek Marcola
Hello, > I'm trying to use the RSA_public_decrypt function but I need to set up the > public key "manually". > I have the public exponent and modulus in the form of an array of 'unsigned > char' and have converted these to BIGNUM format using > BN_bin2bn. I assigned them to the RSA fields n and e

RE: RSA_public_decrypt problem

2007-08-01 Thread David Schwartz
> You're right, I get RSA_R_BAD_E_VALUE (101). Just took the wrong > define for the mail. ERR_GET_REASON returns 101. Only the RSA key generation function can produce this error. Perhaps you had it left over from a previous function you called? Perhaps your engine can generate this error in respo

RE: RSA_public_decrypt problem

2007-08-01 Thread David Schwartz
> I'm trying to use the RSA_public_decrypt function but I need to > set up the public key "manually". > I have the public exponent and modulus in the form of an array of > 'unsigned char' and have converted these to BIGNUM format using > BN_bin2bn. I assigned them to the RSA fields n and e. > The