The nightly gpgme newbie question: en- and decrypt problems

Nico Schottelius nico-gnupg-dev-0 at schottelius.org
Thu Jun 26 23:00:27 CEST 2008


Hello!

I just continued the work on the example referenced yesterday
and tried to decrypt a cipher that I just encrypted:

--------------------------------------------------------------------------------
   gerr = gpgme_op_encrypt(g_context, g_recipient, 0, g_plain, g_encrypt);
   if(gerr != GPG_ERR_NO_ERROR) {
      printf("gerr=%d\n",gerr);
      return 18;
   }

   gerr = gpgme_op_decrypt(g_context, g_encrypt, g_plain_recv);
   if(gerr != GPG_ERR_NO_ERROR) {
      printf("gerr=%d\n",gerr);
      return 19;
   }
--------------------------------------------------------------------------------

Now my program returns 19, which makes we wonder, because the encrypt did not
return an error:

--------------------------------------------------------------------------------
[23:55] denkbrett:ceofhack% make
./ceof_server
Version: OpenPGP
gpgme_set_engine_info: ok
file=/usr/bin/gpg, home=/home/user/nico/.ceof/gnupg
gerr=117440570
make: *** [all] Fehler 19
[23:55] denkbrett:ceofhack% gpg-error 117440570
117440570 = (7, 58) = (GPG_ERR_SOURCE_GPGME, GPG_ERR_NO_DATA) = (GPGME, Keine Daten)
--------------------------------------------------------------------------------

Regarding the info page, this means:

`GPG_ERR_NO_DATA' if CIPHER does not contain any data to decrypt,

But shouldn't it contain data, if gpgme_op_encrypt() before was successful?

Sincerly

Nico

-- 
Think about Free and Open Source Software (FOSS).
http://nico.schottelius.org/documentations/foss/the-term-foss/

PGP: BFE4 C736 ABE5 406F 8F42  F7CF B8BE F92A 9885 188C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: </pipermail/attachments/20080626/de8890a1/attachment.pgp>


More information about the Gnupg-devel mailing list