I tried an other xmlfile.
 
<dsig:SignatureValue>Xa4w7I1obBULyZoZRuq5UHIwQVle8NmugYafWWaOU+GoWgp2e745PA7DTT0xztaH</dsig:SignatureValue>
 
When I decode this SignatureValue with the following function
 
char *unbase64(unsigned char *input, int length)
{
  BIO *b64, *bmem;
 
  char *buffer = (char *)malloc(length);
  memset(buffer, 0, length);
 
  b64 = BIO_new(BIO_f_base64());
  bmem = BIO_new_mem_buf(input, length);
  bmem = BIO_push(b64, bmem);
 
  BIO_read(bmem, buffer, length);
 
  BIO_free_all(bmem);
  return buffer;
}
 
I get this value
 
+ data 0x0310b668 "]®0ìhl ÉšFê¹Pr0AY^ðÙ®†ŸYfŽSá¨Zv{¾9<ÃM=1ÎÖ‡" const 
unsigned char *
 
But still the function d2i_ECDSA_SIG failse ;o(
 
Any ideas what went wrong?

Thanks
Jürgen
 

________________________________

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jürgen Heiss
Sent: Freitag, 16. März 2007 10:30
To: openssl-users@openssl.org
Subject: Problem with ecdsa


Hi everybody,
 
I try to verify a xml file which was signed with ecdsa-sha1.
I alredy read to SignatureValue from the xmlfile. which is.
 
724PlFGHTTL1cFlLFU6g6UetcPVBEAN6oNpogAUx3rgELFH86gA+NqvjVf316zek
 
so this is the base64 encoded version. 
 
But if i call  ecdsa_verify, this doesn't work, because d21_ECDSA need an DER 
encoded version.
Because of this i tried to use BIO_f_base64();
The result was.
 
+ data 0x03198598 "ïn.”Q‡M2õpYK.N éG­põA..z Úh€.1Þ¸.,Qüê" const unsigned char *
 
But still the function d2i_ECDSA failse!
 
 
 ANY IDEAS? I really don't know anymore what else to do!!!
 
 
 
int ECDSA_verify(int type, const unsigned char *dgst, int dgst_len,  const 
unsigned char *sigbuf, int sig_len, EC_KEY *eckey)
{
 ECDSA_SIG *s = NULL;
  int ret=-1;
  unsigned char *p;
 
  s = ECDSA_SIG_new();
  if (s == NULL) return(ret);
  if (d2i_ECDSA_SIG(&s, &sigbuf, sig_len) == NULL) goto err; --> here happens 
the error.
  ret=ECDSA_do_verify(dgst, dgst_len, s, eckey);
 err:
  ECDSA_SIG_free(s);
  return(ret);
  }

Reply via email to