Commit e571e13f authored by Youness Alaoui's avatar Youness Alaoui

Fix SHA1 algorithm when strict aliasing is used : http://bugs.archlinux.org/task/15189

parent 52f33087
...@@ -143,11 +143,11 @@ static void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]) ...@@ -143,11 +143,11 @@ static void SHA1Transform(uint32_t state[5], const unsigned char buffer[64])
{ {
uint32_t a, b, c, d, e; uint32_t a, b, c, d, e;
typedef union { typedef union {
unsigned char c[64]; uint8_t c[64];
uint32_t l[16]; uint32_t l[16];
} CHAR64LONG16; } CHAR64LONG16;
CHAR64LONG16* block; CHAR64LONG16* block;
uint32_t workspace[16]; uint8_t workspace[64];
block = (CHAR64LONG16 *) workspace; block = (CHAR64LONG16 *) workspace;
memcpy(block, buffer, 64); memcpy(block, buffer, 64);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment