X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fgc-libgcrypt.c;h=2affba09a3caea17617f3159f5ebd041c4d35fd6;hb=35dda7458879acb367f2cba0aaf7856cd98f5b63;hp=a147d44656b604b2bc6cc854df5e4574678b31d6;hpb=2d6501c921265a1536ca044f45773e761b639706;p=gnulib.git diff --git a/lib/gc-libgcrypt.c b/lib/gc-libgcrypt.c index a147d4465..2affba09a 100644 --- a/lib/gc-libgcrypt.c +++ b/lib/gc-libgcrypt.c @@ -1,5 +1,5 @@ /* gc-libgcrypt.c --- Crypto wrappers around Libgcrypt for GC. - * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Simon Josefsson + * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Simon Josefsson * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published @@ -46,6 +46,9 @@ gc_init (void) err = gcry_control (GCRYCTL_ANY_INITIALIZATION_P); if (err == GPG_ERR_NO_ERROR) { + if (gcry_control (GCRYCTL_DISABLE_SECMEM, NULL, 0)) + return GC_INIT_ERROR; + if (gcry_check_version (GCRYPT_VERSION) == NULL) return GC_INIT_ERROR; @@ -291,6 +294,10 @@ gc_hash_open (Gc_hash hash, Gc_hash_mode mode, gc_hash_handle * outhandle) gcryalg = GCRY_MD_SHA512; break; + case GC_SHA224: + gcryalg = GCRY_MD_SHA224; + break; + case GC_RMD160: gcryalg = GCRY_MD_RMD160; break; @@ -390,6 +397,10 @@ gc_hash_digest_length (Gc_hash hash) len = GC_SHA512_DIGEST_SIZE; break; + case GC_SHA224: + len = GC_SHA224_DIGEST_SIZE; + break; + default: return 0; } @@ -505,6 +516,12 @@ gc_hash_buffer (Gc_hash hash, const void *in, size_t inlen, char *resbuf) break; #endif +#ifdef GNULIB_GC_SHA224 + case GC_SHA224: + gcryalg = GCRY_MD_SHA224; + break; +#endif + #ifdef GNULIB_GC_RMD160 case GC_RMD160: gcryalg = GCRY_MD_RMD160;