Problem with gcry_pk_verify

Jean-Philippe Garcia Ballester giga at
Wed Aug 10 22:46:07 CEST 2005

  I'm using libgcrypt to make a SSH library. So I build a sexp :
gcry_sexp_build(&gcryhash,NULL,"(data(flags pkcs1)(hash sha1 %m))",bn);
where bn is the mpi where the hash is stocked. The problem is that when
the most significant bit is set, the sexp is built like this :
 (flags pkcs1)
 (hash sha1 #00D5FAD16E753FEEC40B696EC82D1E602A4D5C1302#)
0s are printed because the number is positive, but when gcry_pk_verify gets the mpi, it says the number needs 21 bytes, and is therefore not a valid sha1, failing with GPG_ERR_CONFLICT. How can I solve the problem?

Jean-Philippe Garcia Ballester
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : /pipermail/attachments/20050810/4150b2da/attachment.pgp

More information about the Gcrypt-devel mailing list