Re: How to extract ECC signature bytes from EVP_DigestSignFinal's signature

2014-03-19 Thread axisofevil
I dug into source - it's in DER format so a sleezy hacked function is this: ( I use curve NID_X9_62_prime256v1 ) ECDSA_SIG * sig BIGNUM * r; BIGNUM * s; /* A correct DER-encoded signature has the following form: 0x30: a header

Re: How to extract ECC signature bytes from EVP_DigestSignFinal's signature

2014-03-19 Thread Dr. Stephen Henson
On Tue, Mar 18, 2014, axisofevil wrote: I dug into source - it's in DER format so a sleezy hacked function is this: ( I use curve NID_X9_62_prime256v1 ) ECDSA_SIG * sig BIGNUM * r; BIGNUM * s; /* A correct DER-encoded signature has the following

Re: How to extract ECC signature bytes from EVP_DigestSignFinal's signature

2014-03-19 Thread Jeffrey Walton
On Tue, Mar 18, 2014 at 1:02 PM, axisofevil douglas.b...@ceiva.com wrote: I dug into source - it's in DER format so a sleezy hacked function is this: ( I use curve NID_X9_62_prime256v1 ) ECDSA_SIG * sig BIGNUM * r; BIGNUM * s; /* A correct

How to extract ECC signature bytes from EVP_DigestSignFinal's signature

2014-03-17 Thread axisofevil
I had been using the lower level ECDSA_do_sign for EC signing but had to migrate to EVP functions. If I get signature from EVP_DigestSignFinal(), what format is the signature, and how can I extract the 'real' bytes? I'd expect 32 bytes each for r and s. I need the 'real bytes' for