gpgme_op_verify behaves weird

Francois Gaudin alf at bordel-ambiant.org
Wed Sep 6 11:13:58 CEST 2006


I'v solved my problem and it was because of Qt ...
really weird...

(message is a QString)

int message_length = message.toAscii().size() ;
char * message_char = (char *) calloc(message_length+1,sizeof(char)) ;
memcpy(message_char,message.toAscii().data(),message_length) ;
result = gpgme_data_new_from_mem(&msg,message_char,message_length,0) ;

Seems to have a lack of \0 or too many, I don't known, when I put directly a 
hard coded string it works and from a QString I need to really care with 
initializing all bytes with \0 (with the calloc). A 
memcpy(qstring_str.toAscii(),hardcoded_string,length+1) returns 0.

Good luck for those who use Qt (C++) and C api ...

Thanks to all

Le Mercredi 6 Septembre 2006 10:59, Werner Koch a écrit :
> On Tue,  5 Sep 2006 15:36, Marcus Brinkmann said:
> > see if they verify on the command line.  You may also want to try
> > running with environment variable GPGME_DEBUG=3, to see the
> > communication between GPGME and GPG.
>
> Another option is to put "debug 512" into gpg.conf.  This will create
> files with the actual hashed content.  Compare what you signed and
> what you verified.
>
>
> Salam-Shalom,
>
>    Werner
--
Francois Gaudin



More information about the Gnupg-devel mailing list