Thanks I found it already! Now everything works fine 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of jimmy
Sent: Dienstag, 20. März 2007 13:38
To: openssl-users@openssl.org
Subject: Re: Problem with ecdsa

[pls correct me if i'm wrong]

Jürgen Heiss wrote:
> Hi again,
> 
> Yes, ecdsa_sig is defined like
> 
> {
>     int r;
>     int s;
> }
> 
> But the problem is that I don't know how to get my SignaturValue which is 
> "724PlFGHTTL1cFlLFU6g6UetcPVBEAN6oNpogAUx3rgELFH86gA+NqvjVf316zek" into this 
> struct. 
> 
> The function d2i_ECDSA_SIG which should fill this struct always return 
> -1; ;o(
> 

d2i is for the asn.1 conversion.

you see, as Nils, pointed out your blob is not in asn.1 der format (not 
starting with 0x30..). since ecdsa_sig is BIGNUM *r, *s; you can try using the 
BN_bin2bn() function to directly convert your blob to BIGNUM.

you'll need to do this twice, once for r & once for s. Since Nils told that the 
2 numbers were concat'ed & since most of the time they're the same size, you 
can take one half of the buffer to be r & the other half to be s.

Once you have BIGNUM's you can put them directly into your ECDSA_SIG.


-jb

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


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

Reply via email to