GPGME signing failed: Bad passphrase

Justus Winter justus at
Tue Jul 19 13:54:59 CEST 2016

yuriping at writes:

> Hi, SirI have test "tests/gpg/t-sign.c" and done some necessary
> modification as following:0. file "t-support.h", function
> "passphrase_cb"    char *pass = "057128"; // altered
> with the passphrase of my key1. file "t-sign.c", function "main"#if 1
> // be 0 originally, now enable this section  {   
> gpgme_key_t akey;//    err = gpgme_get_key (ctx,
> "0x68697734", &akey, 0);    err = gpgme_get_key
> (ctx, "0x5FEC9A32", &akey, 1);    // ID of my key
> 0x5FEC9A32    fail_if_err (err);    err
> = gpgme_signers_add (ctx, akey);    fail_if_err
> (err);    gpgme_key_unref (akey);  }#endifRun
> ./t-sign, the program stoped at   /* First a normal
> signature.  */  err = gpgme_data_new (&out); 
> fail_if_err (err);  err = gpgme_op_sign (ctx, in, out,
> GPGME_SIG_MODE_NORMAL);// stop infinitely here  fail_if_err
> (err);  result = gpgme_op_sign_result (ctx);  check_result
> (result, GPGME_SIG_MODE_NORMAL);  print_data (out); 
> gpgme_data_release (out);I don't know how to solve this issue.I just
> want to invoke GPGME, to sign a file with passphrase delivery
> automatically...Thank a lot for any reply!

You may or may not need to configure gpgme to use the loopback pinentry
mode, and may or may not (depending on your specific version of gnupg)
allow the loopback pinentry mode in the first place.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: </pipermail/attachments/20160719/d2d41e65/attachment.sig>

More information about the Gnupg-users mailing list