Skip to content

Commit

Permalink
sha1 bug fix: avoids modification of const buffer inside SHA1_Transform
Browse files Browse the repository at this point in the history
  • Loading branch information
sebres authored May 3, 2018
1 parent 61a0530 commit a46b1fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sha1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ void SHA1_Transform(uint32_t state[5], const uint8_t buffer[64])
uint8_t c[64];
uint32_t l[16];
} CHAR64LONG16;
CHAR64LONG16* block;
CHAR64LONG16 block[1];

block = (CHAR64LONG16*)buffer;
memcpy(block, buffer, sizeof(buffer));

/* Copy context->state[] to working vars */
a = state[0];
Expand Down

0 comments on commit a46b1fb

Please sign in to comment.