GPGME Cannot allocate memory on gpgme_op_decrypt_start (Werner Koch)

Marco bna.marco at gmail.com
Fri Jun 25 17:12:57 CEST 2021


Il giorno ven 25 giu 2021 alle ore 16:55 <gnupg-users-request at gnupg.org> ha
scritto:

> Send Gnupg-users mailing list submissions to
>         gnupg-users at gnupg.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.gnupg.org/mailman/listinfo/gnupg-users
> or, via email, send a message with subject or body 'help' to
>         gnupg-users-request at gnupg.org
>
> You can reach the person managing the list at
>         gnupg-users-owner at gnupg.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Gnupg-users digest..."
> Today's Topics:
>
>    1. Re: GPGME Cannot allocate memory on gpgme_op_decrypt_start
>       (Werner Koch)
>    2. Re: gpg: keyserver receive failed: No name - for gpg
>       --keyserver hkp://pool.sks-keyservers.net (Malte Gell)
>    3. Re: GPGME Cannot allocate memory on gpgme_op_decrypt_start (Marco)
>    4. Re: GPGME Cannot allocate memory on gpgme_op_decrypt_start (Marco)
>    5. Re: GPGME Cannot allocate memory on gpgme_op_decrypt_start (Marco)
>    6. Re: GPGME Cannot allocate memory on gpgme_op_decrypt_start
>       (Werner Koch)
>
>
>
> ---------- Forwarded message ----------
> From: Werner Koch <wk at gnupg.org>
> To: Marco via Gnupg-users <gnupg-users at gnupg.org>
> Cc: Marco <bna.marco at gmail.com>
> Bcc:
> Date: Fri, 25 Jun 2021 15:04:20 +0200
> Subject: Re: GPGME Cannot allocate memory on gpgme_op_decrypt_start
> On Fri, 25 Jun 2021 09:39, Marco said:
>
> >   err = gpgme_data_new_from_file(&in, input.string().c_str(), 1);
>
> The 1 means copy the data to an internal buffer.  Use 0 here to stream
> the data.
>
>
> Salam-Shalom,
>
>    Werner
>
> --
> Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.
>
>
>
> ---------- Forwarded message ----------
> From: Malte Gell <malte.gell at posteo.de>
> To: gnupg-users at gnupg.org
> Cc:
> Bcc:
> Date: Thu, 24 Jun 2021 22:33:49 +0000
> Subject: Re: gpg: keyserver receive failed: No name - for gpg --keyserver
> hkp://pool.sks-keyservers.net
> Am 25.06.21 um 00:14 schrieb Brandon Anderson via Gnupg-users:
> >
> >> The keyserver situation seems a bit difficult currently, maybe
> >> https://keys.openpgp.org/ is the best (easiest) workaround for now.
> >>
> >> But WKD is really worth looking at!
> >>
> >
> > My understanding is the Ubuntu Key-server is staying up, I could be
> > wrong, but https://keyserver.ubuntu.com/ seems to be functioning. It is
> > worth noting that the keys.openpgp.org keyserver is not web of trust but
> > explicitly trusting that keyserver to validate a person's identity.
>
> I think it´s good to distribute a key thru several channels,
> keys.openpgp.org is a good way to establish some trust in a key when
> fetching it for the first time. Afterwards you can still get the same
> key from a different source with WoT signatures added.
>
> If you have no fountain at all for a key to establish a chain(web) of
> trust, keys.openpgp.org is the only way to have some trust in a key. The
> WoT works only if you have some fountain for the trust.
>
>
>
>
>
> ---------- Forwarded message ----------
> From: Marco <bna.marco at gmail.com>
> To: Marco via Gnupg-users <gnupg-users at gnupg.org>
> Cc:
> Bcc:
> Date: Fri, 25 Jun 2021 15:15:04 +0200
> Subject: Re: GPGME Cannot allocate memory on gpgme_op_decrypt_start
> After reading the documentation I supposed it was not correct because
> says to be not implemented.
>
> I'll give a try immediately and I'll let you know (but I expect it will
> work!)
>
> Thank you!!!
>
> Il giorno ven 25 giu 2021 alle ore 15:05 Werner Koch <wk at gnupg.org> ha
> scritto:
>
>> On Fri, 25 Jun 2021 09:39, Marco said:
>>
>> >   err = gpgme_data_new_from_file(&in, input.string().c_str(), 1);
>>
>> The 1 means copy the data to an internal buffer.  Use 0 here to stream
>> the data.
>>
>>
>> Salam-Shalom,
>>
>>    Werner
>>
>> --
>> Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.
>>
>
>
>
> ---------- Forwarded message ----------
> From: Marco <bna.marco at gmail.com>
> To: Marco via Gnupg-users <gnupg-users at gnupg.org>
> Cc:
> Bcc:
> Date: Fri, 25 Jun 2021 15:26:24 +0200
> Subject: Re: GPGME Cannot allocate memory on gpgme_op_decrypt_start
> I've switched 1 to 0 for
>
> >   err = gpgme_data_new_from_file(&in, input.string().c_str(), 1);
>
> as suggested.
> The error is:
> Failed to set input file with error: 117440567 --> Invalid value
>
>
>
>
> Il giorno ven 25 giu 2021 alle ore 15:15 Marco <bna.marco at gmail.com> ha
> scritto:
>
>> After reading the documentation I supposed it was not correct because
>> says to be not implemented.
>>
>> I'll give a try immediately and I'll let you know (but I expect it will
>> work!)
>>
>> Thank you!!!
>>
>> Il giorno ven 25 giu 2021 alle ore 15:05 Werner Koch <wk at gnupg.org> ha
>> scritto:
>>
>>> On Fri, 25 Jun 2021 09:39, Marco said:
>>>
>>> >   err = gpgme_data_new_from_file(&in, input.string().c_str(), 1);
>>>
>>> The 1 means copy the data to an internal buffer.  Use 0 here to stream
>>> the data.
>>>
>>>
>>> Salam-Shalom,
>>>
>>>    Werner
>>>
>>> --
>>> Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.
>>>
>>
>
>
> ---------- Forwarded message ----------
> From: Marco <bna.marco at gmail.com>
> To: Marco via Gnupg-users <gnupg-users at gnupg.org>
> Cc:
> Bcc:
> Date: Fri, 25 Jun 2021 16:21:42 +0200
> Subject: Re: GPGME Cannot allocate memory on gpgme_op_decrypt_start
> I've found a  workaround using gpgme_data_cbs implementing my own read and
> write functions.
>
> If any other way is available or you have any suggestions please let me
> know!
>
> Thanks,
> Marco
>
> Il giorno ven 25 giu 2021 alle ore 15:26 Marco <bna.marco at gmail.com> ha
> scritto:
>
>> I've switched 1 to 0 for
>>
>> >   err = gpgme_data_new_from_file(&in, input.string().c_str(), 1);
>>
>> as suggested.
>> The error is:
>> Failed to set input file with error: 117440567 --> Invalid value
>>
>>
>>
>>
>> Il giorno ven 25 giu 2021 alle ore 15:15 Marco <bna.marco at gmail.com> ha
>> scritto:
>>
>>> After reading the documentation I supposed it was not correct because
>>> says to be not implemented.
>>>
>>> I'll give a try immediately and I'll let you know (but I expect it will
>>> work!)
>>>
>>> Thank you!!!
>>>
>>> Il giorno ven 25 giu 2021 alle ore 15:05 Werner Koch <wk at gnupg.org> ha
>>> scritto:
>>>
>>>> On Fri, 25 Jun 2021 09:39, Marco said:
>>>>
>>>> >   err = gpgme_data_new_from_file(&in, input.string().c_str(), 1);
>>>>
>>>> The 1 means copy the data to an internal buffer.  Use 0 here to stream
>>>> the data.
>>>>
>>>>
>>>> Salam-Shalom,
>>>>
>>>>    Werner
>>>>
>>>> --
>>>> Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.
>>>>
>>>
>
>
> ---------- Forwarded message ----------
> From: Werner Koch <wk at gnupg.org>
> To: Marco via Gnupg-users <gnupg-users at gnupg.org>
> Cc: Marco <bna.marco at gmail.com>
> Bcc:
> Date: Fri, 25 Jun 2021 16:52:20 +0200
> Subject: Re: GPGME Cannot allocate memory on gpgme_op_decrypt_start
> 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.
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-users



I'll try the stream version also!
Mine implementation with cbs was successful but I had some "warning",
let say,logging activity.

Thank you very much!

Best regards,
Marco Bna'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20210625/7ff2f01c/attachment.html>


More information about the Gnupg-users mailing list