diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-10-18 11:50:17 +0200 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-10-18 11:50:17 +0200 |
commit | e08ef581af510312dacba40e78a6af7ca36ffbc5 (patch) | |
tree | 6e0c8ea20353b1c1d40f4cfecd08c5d32c16795e | |
parent | 9ff50b869780aba131dc9b542ccd0f1a3959e920 (diff) | |
download | busybox-w32-e08ef581af510312dacba40e78a6af7ca36ffbc5.tar.gz busybox-w32-e08ef581af510312dacba40e78a6af7ca36ffbc5.tar.bz2 busybox-w32-e08ef581af510312dacba40e78a6af7ca36ffbc5.zip |
md5: length should be stored in *little-endian* order! fixing...
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
-rw-r--r-- | libbb/hash_md5.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libbb/hash_md5.c b/libbb/hash_md5.c index 9de27f1d9..d7410fa2c 100644 --- a/libbb/hash_md5.c +++ b/libbb/hash_md5.c | |||
@@ -415,9 +415,9 @@ void FAST_FUNC md5_end(md5_ctx_t *ctx, void *resbuf) | |||
415 | memset(ctx->wbuffer + bufpos, 0, remaining); | 415 | memset(ctx->wbuffer + bufpos, 0, remaining); |
416 | /* Do we have enough space for the length count? */ | 416 | /* Do we have enough space for the length count? */ |
417 | if (remaining >= 8) { | 417 | if (remaining >= 8) { |
418 | /* Store the 64-bit counter of bits in the buffer in BE format */ | 418 | /* Store the 64-bit counter of bits in the buffer in LE format */ |
419 | uint64_t t = ctx->total64 << 3; | 419 | uint64_t t = ctx->total64 << 3; |
420 | t = SWAP_BE64(t); | 420 | t = SWAP_LE64(t); |
421 | /* wbuffer is suitably aligned for this */ | 421 | /* wbuffer is suitably aligned for this */ |
422 | *(uint64_t *) (&ctx->wbuffer[64 - 8]) = t; | 422 | *(uint64_t *) (&ctx->wbuffer[64 - 8]) = t; |
423 | } | 423 | } |