[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RSA sign/verify and hash generation functions
From: |
Nikos Mavrogiannopoulos |
Subject: |
Re: RSA sign/verify and hash generation functions |
Date: |
Sun, 19 Dec 2010 05:08:10 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 |
On 12/17/2010 12:17 AM, Murray S. Kucherawy wrote:
>> -----Original Message-----
>> From: Nikos Mavrogiannopoulos [mailto:address@hidden On Behalf Of Nikos
>> Mavrogiannopoulos
>> Sent: Thursday, December 16, 2010 1:23 PM
>> To: Murray S. Kucherawy
>> Cc: address@hidden
>> Subject: Re: RSA sign/verify and hash generation functions
>>
>>> bits = 0;
>>> gnutls_pubkey_init(&X)
>>> gnutls_pubkey_import(X, &keydata, GNUTLS_X509_FMT_DER);
>>> gnutls_pubkey_verify_hash(X, 0, &digest, &signature); <== works; returns 1
>>> gnutls_pubkey_get_pk_algorithm(X, &bits);
>>> assert(bits > 0); <== FAILS
>>>
>>> It looks like key->bits is never set to anything by
>>> gnutls_pubkey_import().
>> It was not set when importing from a raw format. Should work now.
> No improvement. The diff I see in your repository updated
> gnutls_pubkey_import_rsa_raw(), but not gnutls_pubkey_import(), and the
> latter doesn't appear to call the former.
I missed that one, should be ok now.
>>>> gnutls_x509_privkey_init(A)
>>>> gnutls_x509_privkey_import(A)
>>>> gnutls_privkey_init(P)
>>>> gnutls_privkey_import_x509(P,A)
>>>> gnutls_pubkey_init(B)
>>>> gnutls_pubkey_import_privkey(B,P)
>>> Works for me. Let me know when you'd like me to grab a snapshot and
>>> try it.
>> Should work by now.
> Trying to make sense of the "usage" parameter for that last function call. I
> imagine for this application (RSA verifying), I need to set it to
> GNUTLS_KEY_DIGITAL_SIGNATURE?
It's only useful if you export the public key to a certificate or
certificate request. The digital signature is usage is ok.
regards,
Nikos
- RE: RSA sign/verify and hash generation functions, (continued)
- RE: RSA sign/verify and hash generation functions, Murray S. Kucherawy, 2010/12/09
- Re: RSA sign/verify and hash generation functions, Nikos Mavrogiannopoulos, 2010/12/13
- RE: RSA sign/verify and hash generation functions, Murray S. Kucherawy, 2010/12/14
- Re: RSA sign/verify and hash generation functions, Nikos Mavrogiannopoulos, 2010/12/14
- RE: RSA sign/verify and hash generation functions, Murray S. Kucherawy, 2010/12/14
- RE: RSA sign/verify and hash generation functions, Murray S. Kucherawy, 2010/12/15
- Re: RSA sign/verify and hash generation functions, Nikos Mavrogiannopoulos, 2010/12/16
- RE: RSA sign/verify and hash generation functions, Murray S. Kucherawy, 2010/12/16
- Re: RSA sign/verify and hash generation functions, Nikos Mavrogiannopoulos, 2010/12/16
- RE: RSA sign/verify and hash generation functions, Murray S. Kucherawy, 2010/12/16
- Re: RSA sign/verify and hash generation functions,
Nikos Mavrogiannopoulos <=
- RE: RSA sign/verify and hash generation functions, Murray S. Kucherawy, 2010/12/20
- RE: RSA sign/verify and hash generation functions, Murray S. Kucherawy, 2010/12/08