Blame SOURCES/libgcrypt-1.5.3-whirlpool-bug.patch

241384
diff -up libgcrypt-1.5.3/cipher/whirlpool.c.whirlpool-bug libgcrypt-1.5.3/cipher/whirlpool.c
241384
--- libgcrypt-1.5.3/cipher/whirlpool.c.whirlpool-bug	2013-05-22 18:02:54.000000000 +0200
241384
+++ libgcrypt-1.5.3/cipher/whirlpool.c	2014-01-21 15:45:51.308919415 +0100
241384
@@ -56,6 +56,7 @@ typedef struct {
241384
   unsigned char buffer[BLOCK_SIZE];
241384
   size_t count;
241384
   unsigned char length[32];
241384
+  int bug;
241384
 } whirlpool_context_t;
241384
 
241384
 
241384
@@ -1185,6 +1186,7 @@ whirlpool_init (void *ctx)
241384
   whirlpool_context_t *context = ctx;
241384
 
241384
   memset (context, 0, sizeof (*context));
241384
+  context->bug = secure_getenv("GCRYPT_WHIRLPOOL_BUG") != NULL;
241384
 }
241384
 
241384
 
241384
@@ -1316,7 +1318,7 @@ whirlpool_add (whirlpool_context_t *cont
241384
 	  buffer_n--;
241384
 	}
241384
       whirlpool_add (context, NULL, 0);
241384
-      if (!buffer_n)
241384
+      if (context->bug && !buffer_n)
241384
 	/* Done.  */
241384
         return;
241384
     }