Package: gnupg / 1.4.18-7+deb8u5

0046-cipher-Improve-readability-by-using-a-macro.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From e23eec8c9a602eee0a09851a54db0f5d611f125c Mon Sep 17 00:00:00 2001
From: Werner Koch <wk@gnupg.org>
Date: Wed, 17 Aug 2016 11:03:07 +0200
Subject: [PATCH 1/2] cipher: Improve readability by using a macro.

* cipher/random.c (mix_pool): Use DIGESTLEN instead of 20.

Signed-off-by: Werner Koch <wk@gnupg.org>
---
 cipher/random.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cipher/random.c b/cipher/random.c
index 7549517..be2f51a 100644
--- a/cipher/random.c
+++ b/cipher/random.c
@@ -365,7 +365,7 @@ mix_pool(byte *pool)
     memcpy(hashbuf, pend - DIGESTLEN, DIGESTLEN );
     memcpy(hashbuf+DIGESTLEN, pool, BLOCKLEN-DIGESTLEN);
     rmd160_mixblock( &md, hashbuf);
-    memcpy(pool, hashbuf, 20 );
+    memcpy(pool, hashbuf, DIGESTLEN);
 
     p = pool;
     for( n=1; n < POOLBLOCKS; n++ ) {
@@ -384,7 +384,7 @@ mix_pool(byte *pool)
 	}
 
 	rmd160_mixblock( &md, hashbuf);
-	memcpy(p, hashbuf, 20 );
+	memcpy(p, hashbuf, DIGESTLEN);
     }
     burn_stack (384); /* for the rmd160_mixblock() */
 }
-- 
2.1.4