GPGME Cannot allocate memory on gpgme_op_decrypt_start

Werner Koch wk at gnupg.org
Fri Jun 25 16:52:20 CEST 2021


On Fri, 25 Jun 2021 15:26, Marco said:

> Failed to set input file with error: 117440567 --> Invalid value

Sorry.  I missed that we did not implement that (because it is actually
a legacy compatibility function).  Thus I can't offer you any function
which takes a file name.  You need to open the file yourself and use one
of these functions:

  gpgme_error_t gpgme_data_new_from_cbs (gpgme_data_t *dh,
  				         gpgme_data_cbs_t cbs,
  				         void *handle);

That is the most flexible one.  But there are some convenience functions
which relieves you from implementing the callbacks:

  gpgme_error_t gpgme_data_new_from_fd (gpgme_data_t *dh, int fd);

This takes a file descriptior; i.e. open(3).

  gpgme_error_t gpgme_data_new_from_stream (gpgme_data_t *dh, FILE *stream);

This takes an stdio stream; i.e. fopen(3).

  gpgme_error_t gpgme_data_new_from_estream (gpgme_data_t *r_dh,
                                             gpgrt_stream_t stream);

This takes a estream_t, i.e. gpgrt_fopen (aka es_fopen).

For an example how to use the see gpgme/tests/run-decrypt.c


Shalom-Salam,

   Werner


-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20210625/2940a0e4/attachment-0001.sig>


More information about the Gnupg-users mailing list