[PATCH 1/2] Fix number of blocks passed used in _gcry_rmd160_mixblock

Dmitry Eremin-Solenikov dbaryshkov at gmail.com
Fri Jan 24 12:02:14 CET 2014


* cipher/rmd160.c (_gcry_rmd160_mixblock): pass 1 to transform

--
Currently _gcry_rmd160_mixblock() passes 64 as nblocks to transform()
function, while passing only one block of data. This causes acess after
the allocated data and tons of errors on each valgrind invokation.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
---
 cipher/rmd160.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cipher/rmd160.c b/cipher/rmd160.c
index 1a58ba6..2aba0fe 100644
--- a/cipher/rmd160.c
+++ b/cipher/rmd160.c
@@ -421,7 +421,7 @@ _gcry_rmd160_mixblock ( RMD160_CONTEXT *hd, void *blockof64byte )
 {
   char *p = blockof64byte;
 
-  transform ( hd, blockof64byte, 64 );
+  transform ( hd, blockof64byte, 1 );
 #define X(a) do { *(u32*)p = hd->h##a ; p += 4; } while(0)
   X(0);
   X(1);
-- 
1.8.5.2




More information about the Gcrypt-devel mailing list