On 2020-12-30 Daiki Ueno <[email protected]> wrote:
> Ludovic Courtès <[email protected]> writes:
[...]
> >   • In Guile-GnuTLS, arrange so that GnuTLS allocations are made through
> >     libgc.  Unfortunately, ‘gnutls_global_set_mem_functions’ was
> >     deprecated in GnuTLS 3.3.0 so this doesn’t look like an option.

> GnuTLS doesn't call mp_set_memory_functions, so even if it is possible,
> I doubt that it would affect the current behavior.  On the other hand,
> if GnuTLS (or Nettle) internally allocates an mpz_t, it should be done
> using the libgc-backed allocator set by Guile and the pointers should be
> reachable until it is no longer, if I understand correctly.  Therefore,
> I suspect that there might be some code that confuses libgc to track the
> pointers; one thing that comes to my mind is a manual copy of mpz_t
> values:
> https://gitlab.com/gnutls/gnutls/-/blob/master/lib/nettle/pk.c#L141

> If you replace memcpy with mpz_init_set, does it work?

Stupid question: That suggestion is about using mpz_init_set instead of
memcpy for all of these initializations, not just for the specific one
in the specific function?

cu Andreas
-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'

_______________________________________________
Gnutls-help mailing list
[email protected]
http://lists.gnupg.org/mailman/listinfo/gnutls-help

Reply via email to