gcry_control(GCRYCTL_INIT_SECMEM,...)

Werner Koch wk@gnupg.org
Fri, 24 Jan 2003 15:01:51 +0100


On Fri, 24 Jan 2003 14:10:40 +0200, Nikos Mavroyanopoulos said:

> the only code that a library has to call is
> if (gcry_control( GCRYCTL_ANY_INITIALIZATION_P) == 0)
>    gcry_control(GCRYCTL_INITIALIZATION_FINISHED, NULL,0)

That is basically what you do in GNUTLS and it is what I consider a
good fallback action.

> Other libraries should handle it similary, and there will be
> no race conditions.

Right.

> Ok, but I think that these severe errors should be followed by an
> abort() call or something like that. Other errors should only be
> printed by the callback mechanism (which is available).

It is not a really hard error but may indicate other problems.  This
is a problem of the caller and not necessary of libgcrypt, so I don't
call BUG () as in other places.  Consider you have widely deployed an
application and suddenly (e.g. due to a date problem) it aborts all
the time due to such an abort - you won't have a chance for a good
workaround even if is only a minor problem or no real problem at all.

Ask the Ariane engineers about such stuff ;-)


Shalom-Salam,

   Werner