gpgme fails encrypting on 64bit debian

Simone Pagan Griso simone.pagangriso at gmail.com
Thu Apr 18 09:33:19 CEST 2013


Dear Werner,
 thanks for your answer and help (and sorry my late reply!).
I've changed the test program according to your suggestions.
In particular, to answer your question, the gpgme-config --libs --cflags
gives me:
-lgpgme -L/usr/lib/x86_64-linux-gnu -lgpg-error

I've also left the default engine info and got the same error. Then I
turned on the debug as you suggested.
I attach the output I've got. I went through it trying to get any clue on
the what is causing the error but got a bit lost: the impression I have
from the debug info is that the encryption is successful but then there's
an error right after(?). Thanks for your help, it's really appreciated!
 Cheers,
Simone



On Wed, Apr 10, 2013 at 9:32 PM, Werner Koch <wk at gnupg.org> wrote:

> On Wed, 10 Apr 2013 10:54, simone.pagangriso at gmail.com said:
>
> > gcc -m64 -D_FILE_OFFSET_BITS=64 -g test2.c -lgpgme
> > -L/usr/lib/x86_64-linux-gnu -lgpg-error -o test2
>
> Why do you want to tweak gcc options if you are anyway on a 64 bit
> system?  Also they seem to be harmelss, hast gpgme been build with the
> same options?  What does
>   gpgme-config --cflags --libs
> tell you?
>
> > //---- test program
> > #include <stdio.h>   /* printf            */
> > #include <unistd.h>  /* write             */
> > #include <errno.h>   /* errno             */
> > #include <locale.h>  /* locale support    */
> > #include <string.h>  /* string support    */
> > #include <stdlib.h>  /* memory management */
>
> gpgme.h ist missing but below you are using constants defined by
> gpgme.h.
>
> >   char *pDest = malloc(65536);
>
> (please always check for malloc error!)
>
> >   p = (char *) gpgme_check_version(NULL);
> >   printf("version=%s\n",p);
>
> Don't cast without a good reason.
>
> >   p = (char *) gpgme_get_protocol_name(GPGME_PROTOCOL_OpenPGP);
> >   printf("Protocol name: %s\n",p);
>
> Ditto.
>
>
> >   err = gpgme_ctx_set_engine_info (ceofcontext, GPGME_PROTOCOL_OpenPGP,
> >                                enginfo->file_name,enginfo->home_dir);
> >   if(err != GPG_ERR_NO_ERROR) return 5;
>
> Try first without setting a non default engine info.
>
>
> To debug your problem, I suggest to run the program like this:
>
>  GPGME_DEBUG=9:/tmp/gpgme.log:
>
> and check the log file.
>
>
> Shalom-Salam,
>
>    Werner
>
>
> --
> Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20130418/24c71351/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gpgme.log
Type: application/octet-stream
Size: 24330 bytes
Desc: not available
URL: </pipermail/attachments/20130418/24c71351/attachment-0001.obj>


More information about the Gnupg-users mailing list