Dr. Stephen Henson wrote:
> 
> I've done a quick check setting rsa->e to NULL in rsautl and it seems to work
> just fine: the security checks aren't performed if 'e' is NULL. That's using
> the -sign option which goes through RSA_private_encrypt().
> 
> What made you think this function returned -1?
> 
> You can't load a private key using PEM_read_bio_RSAPrivateKey() unless all
> components are present but that's because they are all mandatory fields in the
> RSAPrivateKey ASN1 definition. If you set the fields using some other method
> then that doesn't apply.
> 
Actually, I'm using libcrypto programmatically so I know for sure that
RSA_private_encrypt() returned -1 when not passing 'e' to the RSA
structure. (note that I set the other fields using simple assign as done
in the sample C test file included with source distribution).

As for hacking myself through the RSA code, I looked at the OpenSSL
source RSA_private_encrypt() but I do not understand the source code
since this is a function pointer that seems to be never initialized (it
must be implicitly initialized somewhere but I cannot find where...).

But, anyway, using BN/modexp functions I coded myself an RSA CRT Private
encrypt/decrypt operation that does the job and I use the public key
method for RSA STD Private Keys operation and it seems to work good.


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

Reply via email to