Problem with gcry_pk_verify

Moritz Schulte moritz at duesseldorf.ccc.de
Thu Aug 11 21:57:14 CEST 2005


Jean-Philippe Garcia Ballester wrote:

>   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 :
> (data 
>  (flags pkcs1)
>  (hash sha1 #00D5FAD16E753FEEC40B696EC82D1E602A4D5C1302#)
>  )

Use the %b format character instead of %m; %b lets you insert memory
buffers directly, regardles of MPI formating.  %b expects two arguments:
one of size_t and a pointer to the memory buffer.

Moritz




More information about the Gcrypt-devel mailing list