Feature req for GPGME

Werner Koch wk at gnupg.org
Fri Sep 27 11:23:01 CEST 2002

On 26 Sep 2002 14:54:07 -0500, Robert J Hansen said:

> Not necessarily.  You can leave void*s and const-char*s unused in the
> structure and mark them "for future expansion", which ameliorates the
> extensibility problem by reducing the need to change the structure. 
> Doesn't remove the problem, no, just ameliorates it.

The Windows way :-)

Without accessor fucntions we won't have the ability to generate the
data on demand, instead we have to populate the struct with all
possible data, most of them not needed by allpications.

> GpgmeErr
> gpgme_key_get_struct(const char *filter, GpgmeKeyStruct *ks, int *num)

> Doing things this way means we could isolate the GpgmeCtx and GpgmeKeys
> involved all within the gpgme_key_get_struct function.  That, IMO, is a

GpgmeCtx and GpgmeKey are independent.  I fail to see how you approach
is better - you also have to make sure that KS is released.

> Otherwise, if everybody rolls their own, I imagine a lot of people will
> wind up holding onto GpgmeKeys and GpgmeCtxes long after they should. 

So it might be better for them to use garbage collecting language.
Handling dynamically allocated memory needs some caution but a C
programmer should be used to this.

> I'm not sure whether or not those floating Ctxes and Keys could be used
> to attack the system, but I know we're safer if we remove the chance for

No, you can't.



More information about the Gnupg-devel mailing list