Richard Marian Thomaiyar | 14fddef | 2018-07-13 23:55:56 +0530 | [diff] [blame] | 1 | samhain: fix sha256 for big-endian machines |
| 2 | |
| 3 | After computing the digest, big-endian machines would |
| 4 | memset() the digest to the first byte of state instead |
| 5 | of using memcpy() to transfer it. |
| 6 | |
| 7 | Upstream-Status: Pending |
| 8 | |
| 9 | Signed-off-by: Joe Slater <jslater@windriver.com> |
| 10 | |
| 11 | |
| 12 | --- a/src/sh_checksum.c |
| 13 | +++ b/src/sh_checksum.c |
| 14 | @@ -468,7 +468,7 @@ void SHA256_Final(sha2_byte digest[], SH |
| 15 | } |
| 16 | } |
| 17 | #else |
| 18 | - memset(d, context->state, SHA256_DIGEST_LENGTH); |
| 19 | + memcpy(d, context->state, SHA256_DIGEST_LENGTH); |
| 20 | /* bcopy(context->state, d, SHA256_DIGEST_LENGTH); */ |
| 21 | #endif |
| 22 | } |