Matthijs Mohlmann wrote:
Hi,

I'm still busy with the gaim plugin.

Still thanks for pointing me to the tests in the gpgme source directory,
stupid that i didn't checked that one.

Well i try to understand the: tests/gpg/t-encrypt.c test program.

There are 2 calls:
err = gpgme_get_key (ctx, "A0FF4590BB6122EDEF6E3C542D727CC768697734",
         &key[0], 0);
err = gpgme_get_key (ctx, "D695676BDCEDCC2CDD6152BCFE180B1DA9E3B0B2",
         &key[1], 0);

Here we get the public keys. But then suddenly there is an encrypt
operation. Where o where do I need to set the secret key. When having
multiple secret keys, I have to select the key. What i can get from the
seahorse source is that it's added to the end of the key array. Should
it be there and where can i find more documentation about that ?

And then do the encrypt...
err = gpgme_op_encrypt (ctx, key, GPGME_ENCRYPT_ALWAYS_TRUST, in, out);

After doing this and do the following:
result = gpgme_op_encrypt_result(ctx);
if (result->invalid_recipients) {
  printf("Hmm invalid recipients!!\n");
}
Nothing printed, that's ok.

After that:
#define BUF_SIZE 512
char buf[BUF_SIZE + 1];
int ret;
ret = gpgme_data_seek(out, 0, SEEK_SET);
printf("Print data: (gpgme_data_seek) %i\n", ret);

Now i get a -1 while i expect a value >= 0

When i return the error value, i get:
printf("Hmm what error: %s\n",
gpgme_strerror(gpgme_error_from_errno(errno)));

Hmm what error: Invalid argument

Finally found the problem.

Compiling with: -D_FILE_OFFSET_BITS=64 did the trick.

Thanks.

Where did i make the fault ?

Regards,

Matthijs Mohlmann

PS: Now i am subscribed to the list.

_______________________________________________ Gnupg-users mailing list [email protected] http://lists.gnupg.org/mailman/listinfo/gnupg-users


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Gnupg-users mailing list
[email protected]
http://lists.gnupg.org/mailman/listinfo/gnupg-users

Reply via email to