From a5f08cf2fb4b3b6c217277e33fe05c547d11afde Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Wed, 12 Oct 2005 00:23:38 +0000 Subject: [PATCH] * 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. --- lib/ChangeLog | 11 +++++++++++ lib/gc-gnulib.c | 2 +- lib/gc-libgcrypt.c | 6 +++--- lib/gc.h | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index 0697478daf..413e3c179f 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,14 @@ +2005-10-12 Simon Josefsson + + * 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. + 2005-10-11 Bruno Haible * c-strcasestr.h: New file, from GNU gettext. diff --git a/lib/gc-gnulib.c b/lib/gc-gnulib.c index abb1bb466a..eac9039085 100644 --- a/lib/gc-gnulib.c +++ b/lib/gc-gnulib.c @@ -138,7 +138,7 @@ gc_set_allocators (gc_malloc_t func_malloc, /* 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) { switch (hash) { diff --git a/lib/gc-libgcrypt.c b/lib/gc-libgcrypt.c index 65cc1b0571..d821c1d49e 100644 --- a/lib/gc-libgcrypt.c +++ b/lib/gc-libgcrypt.c @@ -97,7 +97,7 @@ gc_set_allocators (gc_malloc_t func_malloc, /* 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 @@ gc_md5 (const void *in, size_t inlen, void *resbuf) 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 @@ gc_md5 (const void *in, size_t inlen, void *resbuf) p = gcry_md_read (hd, GCRY_MD_MD5); if (p == NULL) { - gcry_md_close (mdh); + gcry_md_close (hd); return GC_INVALID_HASH; } diff --git a/lib/gc.h b/lib/gc.h index acfd3b9cc3..c966a99b29 100644 --- a/lib/gc.h +++ b/lib/gc.h @@ -71,7 +71,7 @@ extern void gc_set_allocators (gc_malloc_t func_malloc, must be 16 bytes. The return value is 0 (GC_OK) on success, or another Gc_rc error code. */ extern int -gc_hash_buffer (int hash, const void *in, size_t inlen, char *out); +gc_hash_buffer (Gc_hash hash, const void *in, size_t inlen, char *out); /* One-call interface. */ extern int gc_md5 (const void *in, size_t inlen, void *resbuf); -- 2.30.2