GPGME-verify: GPG_ERR_SOURCE_UNKNOWN

Arturo 'Buanzo' Busleiman buanzo at buanzo.com.ar
Wed Apr 11 13:14:29 CEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hi group!

Thanks for the suggestion of using gpgme. Although I couldn't use it on the Enigform Firefox
extension, I'm using it for an Apache module (mod_auth_openpgp). As I was having some issues with
gpgme sig verification, I took t-verify.c, removed all that didn't seemed necessary for a bare-bones
test, and I'm getting the GPG_ERR_SOURCE_UNKNOWN error.

I'm linking against gpgme 1.1.4 and libgpg-error 1.5. The error I'm getting is: 55536

This is the code:

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <gpgme.h>
#include "t-support.h"

char test_text1[] = "variable=dsa"; /* I tried with and without \n at the end */
char test_sig1[] =  "-----BEGIN PGP SIGNATURE-----\n"
"Version: GnuPG v1.4.6 (GNU/Linux)\n"
"\n"
"iD8DBQFGHLqoAlpOsGhXcE0RAs8yAJ4vfspPFR1KHaD0woc+bSuTX9J2NwCeKtZOVNJTNs0Nj6LMzRs5blgxKWg==k+5M\n"
"-----END PGP SIGNATURE------\n";

int
main (int argc, char *argv[])
{
  gpgme_ctx_t ctx;
  gpgme_error_t err;
  gpgme_data_t sig, text;
  gpgme_verify_result_t result;

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

  err = gpgme_data_new_from_mem (&text, test_text1, strlen (test_text1), 0);
  fail_if_err (err);
  err = gpgme_data_new_from_mem (&sig, test_sig1, strlen (test_sig1), 0);
  fail_if_err (err);
  err = gpgme_op_verify (ctx, sig, text, NULL);
  fail_if_err (err);
  result = gpgme_op_verify_result (ctx);
  printf("GPGME error: %u\n",gpgme_err_code((int)result));

  gpgme_data_release (sig);
  gpgme_data_release (text);
  gpgme_release (ctx);
  return 0;
}

Do you notice anything wrong? I'm even compiling with:

gcc -o v v.c -I/usr/include/gpgme -lgpgme -lgpg-error -Wall -ansi -pedantic

(nothing shows there).

- --
Arturo "Buanzo" Busleiman - Consultor Independiente en Seguridad Informatica
Foros GNU/Buanzo: Respeto, Soluciones y Buena Onda: http://foros.buanzo.com.ar
Consulting and Secure Mail Hosting: http://www.buanzo.com.ar/pro/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGHMMVAlpOsGhXcE0RCgKEAKCAKe+7coQVduxs6TQp9klaK92+NgCdH2QQ
Q+Dn38oVQLUNE7uOstR9pTA=
=y01X
-----END PGP SIGNATURE-----



More information about the Gnupg-devel mailing list