On Fri, 23 Mar 2001, Kenneth R. Robinette wrote:

> I am trying to import the public RSA key (modulus) created on a
> Smart Card into an OpenSSL/OpenSSH key structure.  The size of
> the Smart Card public/private key pair is 1024 bits, and the key pair
> was generated onboard the Smart Card.
>
> If I check the size of k->rsa->n after the RSA_generate_key, the
> result from BN_num_bytes is 128 and from BN_num_bits is 1024.
>
> If I check the size of k->rsa->n after the BN_bin2bn call the result
> from BN_num_bytes is 128 and from BN_num_bits is 1023.
>
> What is causing the difference in the BN_num_bits result?

I think that the RSA key generated by your smartcard is really a 1023 bits
one. That means that one of the 2 random primes used to compose the
modulus is not 512 bits long, but 511 bits.

There's nothing OpenSSL can do for this. Call your smartcard vendor to get
more info.

-- 
Erwann ABALEA
[EMAIL PROTECTED]
RSA PGP Key ID: 0x2D0EABD5
-----
Stupidity has no limits, genius does.

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

Reply via email to