Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: GnuPG: devel

gpgme usage

 

 

GnuPG devel RSS feed   Index | Next | Previous | View Threaded


comp.ogz at gmail

Mar 4, 2009, 7:39 AM

Post #1 of 6 (954 views)
Permalink
gpgme usage

Hi,

I was trying to use the gpgme. I checked the tests directory and decided
to play with the t-decrypt.c. I changed it a little so as to use my own
keys at my system[1]. I also changed "t-support.h" so as to use my
password[2].

I compiled as

$ gcc mytest-decrypt.c `gpgme-config --libs` -o myencrypt

and run as

$ ./myencrypt

Here is what i got:

Oguz Yarimtepe comp.ogz [at] gmail Oguz Yarimtepe <comp.ogz [at] gmail>
t-support.h:56: Unspecified source: Invalid argument

When i comment the print_data (out); line at the mytest-decrypt.c, it
works, of course without no output. I am trying to decrypt the
cipher-1.asc.gpg file which is encrypted by using gpg command with the
key at my system.

[1] http://rafb.net/p/hBDQia89.html
[2] http://rafb.net/p/0aO1A239.html

It seems i am doing something wrong or misunderstood the basics. Can you
guide me please?




_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


wk at gnupg

Mar 5, 2009, 3:24 AM

Post #2 of 6 (911 views)
Permalink
Re: gpgme usage [In reply to]

On Wed, 4 Mar 2009 16:39, comp.ogz [at] gmail said:

> $ gcc mytest-decrypt.c `gpgme-config --libs` -o myencrypt

Use

gcc mytest-decrypt.c `gpgme-config --cflags --libs` -o myencrypt

> Oguz Yarimtepe comp.ogz [at] gmail Oguz Yarimtepe <comp.ogz [at] gmail>
> t-support.h:56: Unspecified source: Invalid argument

You modified t-support and I don't know theversion of gpgme youare
using. Thus I can't see anything from this error message.

My guess is that you need to enable Large File support. The gpgme
manual has a chapter on this.

> [1] http://rafb.net/p/hBDQia89.html

Please don't do this: It will eventually go away, some people are
reading mail without having a net connection and it is harder to comment
on the code. Better include the code directly and strip off parts which
are not required. The message limit here is 40k which should be
sufficient for most examples.


Salam-Shalom,

Werner

--
Die Gedanken sind frei. Auschnahme regelt ein Bundeschgesetz.


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


comp.ogz at gmail

Mar 5, 2009, 6:51 AM

Post #3 of 6 (900 views)
Permalink
Re: gpgme usage [In reply to]

On Thu, 2009-03-05 at 12:24 +0100, Werner Koch wrote:
> On Wed, 4 Mar 2009 16:39, comp.ogz [at] gmail said:
>
> > $ gcc mytest-decrypt.c `gpgme-config --libs` -o myencrypt
>
> Use
>
> gcc mytest-decrypt.c `gpgme-config --cflags --libs` -o myencrypt

I had tried whether there is an output of --cflags usage but because
gpgme-config --cflags doesnt produce anything, i didn't add it.

>

> You modified t-support and I don't know theversion of gpgme youare
> using. Thus I can't see anything from this error message.
>

It is gpgme1.0-1.1.5. I just apt-get source libgpgme11-dev and checked
the files.

> My guess is that you need to enable Large File support. The gpgme
> manual has a chapter on this.

Should i really enable it? It is just the text file (cipher-1.asc at the
tests directory.)

>
> > [1] http://rafb.net/p/hBDQia89.html
>

> Please don't do this: It will eventually go away, some people are
> reading mail without having a net connection and it is harder to comment
> on the code. Better include the code directly and strip off parts which
> are not required. The message limit here is 40k which should be
> sufficient for most examples.
>
>

Ok i am sending the files then with this mail. The t-decrypt.c is the
modified one. t-support.h is just showing which part i changed.

> Salam-Shalom,
>
> Werner
>
--
Oguz Yarimtepe
http://www.loopbacking.info
Attachments: t-decrypt.c (2.80 KB)
  t-support.h (0.24 KB)


wk at gnupg

Mar 5, 2009, 2:00 PM

Post #4 of 6 (897 views)
Permalink
Re: gpgme usage [In reply to]

On Thu, 5 Mar 2009 15:51, comp.ogz [at] gmail said:

>> My guess is that you need to enable Large File support. The gpgme
>> manual has a chapter on this.
>
> Should i really enable it? It is just the text file (cipher-1.asc at the
> tests directory.)

If your system does not use LFS by default it can't work. Recall that
you use a gpgme_data_seek in print_data and that function takes an
off_t. GPGME has been build with LFS support and if your system doesn't
use LFS by default we have a 32 / 64 bit mismatch in the off_t and thus
the stack gets corrupted. gpgme_data_seek sees other arguments than you
passed and thus it returns you an error. Please read the manual.


Salam-Shalom,

Werner

--
Die Gedanken sind frei. Auschnahme regelt ein Bundeschgesetz.


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


comp.ogz at gmail

Mar 9, 2009, 2:40 AM

Post #5 of 6 (881 views)
Permalink
Re: gpgme usage [In reply to]

Hi,

On Fri, Mar 6, 2009 at 12:00 AM, Werner Koch <wk [at] gnupg> wrote:
> On Thu,  5 Mar 2009 15:51, comp.ogz [at] gmail said:
>
>
> If your system does not use LFS by default it can't work.  Recall that
> you use a gpgme_data_seek in print_data and that function takes an
> off_t.  GPGME has been build with LFS support and if your system doesn't
> use LFS by default we have a 32 / 64 bit mismatch in the off_t and thus
> the stack gets corrupted.  gpgme_data_seek sees other arguments than you
> passed and thus it returns you an error.  Please read the manual.
>
>

I didn't need LFS so i recompiled gpgme by disabling lfs support,
after your warning and reading the manual detaily. Then the code
worked. I thought some people may had the same issue in the future and
encounter with the thread. Better to make a feedback on the list.

Thank you.


--
Ošuz Yarżmtepe
www.loopbacking.info

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


marcus.brinkmann at ruhr-uni-bochum

Mar 13, 2009, 2:25 PM

Post #6 of 6 (885 views)
Permalink
Re: gpgme usage [In reply to]

Oguz Yarimtepe wrote:
> I didn't need LFS so i recompiled gpgme by disabling lfs support,
> after your warning and reading the manual detaily. Then the code
> worked. I thought some people may had the same issue in the future and
> encounter with the thread. Better to make a feedback on the list.

It would be a good idea to rename the library then, just to make sure that you
don't get accidential problems. I'd suggest gpgme-no-lfs.

Although I don't really see why you wouldn't want to add the -D for LFS. It
costs you nothing, and is the default for many environments (like GNOME).

Thanks,
Marcus


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel

GnuPG devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.