diff lib/gc-libgcrypt.c @ 6362:2bcfc491052b

* gc-libgcrypt.c (gc_md5): Fix assert call. (gc_md5): Fix typo. * gc.h (gc_hash_buffer): Use gc_hash in prototype. * gc-libgcrypt.c (gc_hash_buffer): Ditto. * gc-gnulib.c (gc_hash_buffer): Ditto.
author Simon Josefsson <simon@josefsson.org>
date Wed, 12 Oct 2005 00:23:38 +0000
parents c195d0c75e25
children bae11f33bf3c
line wrap: on
line diff
--- a/lib/gc-libgcrypt.c
+++ b/lib/gc-libgcrypt.c
@@ -97,7 +97,7 @@
 /* Hashes. */
 
 int
-gc_hash_buffer (int hash, const void *in, size_t inlen, char *resbuf)
+gc_hash_buffer (Gc_hash hash, const void *in, size_t inlen, char *resbuf)
 {
   int gcryalg;
 
@@ -126,7 +126,7 @@
   gpg_error_t err;
   unsigned char *p;
 
-  assert (outlen == 16);
+  assert (outlen == GC_MD5_DIGEST_SIZE);
 
   err = gcry_md_open (&hd, GCRY_MD_MD5, 0);
   if (err != GPG_ERR_NO_ERROR)
@@ -137,7 +137,7 @@
   p = gcry_md_read (hd, GCRY_MD_MD5);
   if (p == NULL)
     {
-      gcry_md_close (mdh);
+      gcry_md_close (hd);
       return GC_INVALID_HASH;
     }