[GPGME] Verify ASCII armor signature fails

Laurent Cheylus foxy at free.fr
Sun Dec 15 17:56:06 CET 2002


Hi,

I use GPGME 0.3.13 and GnuPG 1.2.1 on Linux to develop an email plugin
for Balsa (http://balsa.gnome.org). But I have some problems with
"gpgme_op_verify".

I have an function to verify ASCII armor gpg signed message (ASCII mode
in RFC 2440) :

char* libbalsa_gpg_sign_verify(gchar *text, gchar *sign)
{
    GpgmeCtx ctx;
    GpgmeError err;
    GpgmeData sig, txt;
    GpgmeSigStat status;
    char *result;

    err = gpgme_new (&ctx);
    fail_if_err (err);

    err = gpgme_data_new_from_mem (&txt,text,strlen(text),1);
    fail_if_err (err);
    err = gpgme_data_new_from_mem (&sig,sign,strlen(sign),1);
    fail_if_err (err);

    err = gpgme_op_verify (ctx,sig,txt,&status);
    fail_if_err (err);
    result = sig_status_full(ctx,status);

    gpgme_data_release (sig);
    gpgme_data_release (txt);
    gpgme_release (ctx);

    return result;
}

where 'text' is text part of message without "-----BEGIN PGP SIGNED
MESSAGE-----" anchor and 'sign' is sign part of message with "-----BEGIN
PGP SIGNED MESSAGE----- [...] -----BEGIN PGP SIGNATURE-----" anchor.
Text and sign are "dash escaped" as needed in RFC 2440.

But when I try to run 'libbalsa_gpg_sign_verify', program hangs at
'gpgme_op_verify' call. What's wrong ?

Thx, Foxy.

-- 
Laurent Cheylus <foxy at free.fr> OpenPGP ID 0x5B766EC2




More information about the Gnupg-devel mailing list