On Fri, Aug 11, 2006, ?????????????? ???????????? wrote:

> Hello Stephen!
> 
> Thank you *AGAIN* to the help!
> I'm getting much fun with OpenSSL package. :D
> 
> I could not figure out how I should use "openssl rsautl" on those
> purely binary BIGNUMs that are used by Lynksys|Sipura in their
> proprietary "MiniCertificate" standard.
> 

Well rsautl -verify and passing the public key and the signature buffer would
do it. Probably with a -hexdump command too looking at the result below...


> What I did is:
> BN_mod_exp( result, original_sig, pub_exp, pub_mod, ctx);
> 
> Hurray!
> I got this as the "result":
> 01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF \
> FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF \
> FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF \
> FFFFFFFFFFFFFF00A2A420DF49B17508946305979D24DD4040B8FA2C
> 
> The lower digits are exactly the "sha1" hash of the concatenated
> buffer with user name, expiry date etc.
> (It all works this way only if I use the "RSA_F4" as the "public
> exponent")
> This hash seems padded.
> 
> Now my question is - How is this padding called?
> 
> I do think now, I must use not the "RSA_sign()" but the combination of
> low-level functions like "RSA_private_encrypt()" with properly padded
> hashes to them.
> Or, as of my "gen-mc v0.91", I must put some "pad the hash" code
> between the "EVP_DigestFinal_ex()" and the "RSA_sign()".
> 

That padding is not standard and just includes the "raw" digest. Yes you are
correct you can't use RSA_sign() for that. You should get that padding by
feeding the digest into RSA_private_encrypt() with the RSA_PKCS1_PADDING type.

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to