[PATCH] Message digest test suite and incomplete MD4 support

Simon Josefsson jas@extundo.com
Fri, 22 Nov 2002 01:28:15 +0100

Werner Koch <wk@gnupg.org> writes:

>> int main()
>> {
>>   GCRY_MD_HD md5h;
>     gcry_control (GCRYCTL_DISABLE_SECMEM);
>>   md5h = gcry_md_open (GCRY_MD_MD5, GCRY_MD_FLAG_HMAC);
> The default is to use the "secure" memory - in this case we use a key
> and we assume that a MAC key is somewhat sensitive.

Ok.  This usage is a bit problematic if libgcrypt is used in a third
party library, as the application might use libgcrypt too, and might
want secure memory.  Maybe the third party library has to document
that the application must initialize or disable secure memory in
libgcrypt, but OTOH this is weird if the application is not using
libgcrypt, and even more so if libgcrypt is not always used by the
third party library (i.e. it is an optional compile time feature in
the third party library).  (Right now my third party library
initializes secure memory, which causes libgcrypt warnings because it
is invoked multiple times. It also overrides the application's
preference whether to use secure memory or not, if the application
happens to use libgcrypt.)

Global states are always a pain...