base/SOURCES/libgcrypt-1.5.3-whirlpool-b...

29 lines
844 B
Diff
Raw Permalink Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

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