summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/sha2_internal.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-04-20 10:37:04 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2012-04-20 10:37:04 +0200
commit518763f630873e35398d2537ebfabf97b5aea489 (patch)
treed7b36ef50a9301ac8099edc48a0ab9e563125198 /apt-pkg/contrib/sha2_internal.cc
parent8c6d0ba4e25baa7b0dffc4e06e76fc63a71e656f (diff)
parente6a12579e9e5d5735eda450cf2bb3986d828ab65 (diff)
merged from lp:~donkult/apt/sid
Diffstat (limited to 'apt-pkg/contrib/sha2_internal.cc')
-rw-r--r--apt-pkg/contrib/sha2_internal.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/apt-pkg/contrib/sha2_internal.cc b/apt-pkg/contrib/sha2_internal.cc
index 6d27e8f2b..83b5a98d3 100644
--- a/apt-pkg/contrib/sha2_internal.cc
+++ b/apt-pkg/contrib/sha2_internal.cc
@@ -552,7 +552,9 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) {
}
while (len >= SHA256_BLOCK_LENGTH) {
/* Process as many complete blocks as we can */
- SHA256_Transform(context, (sha2_word32*)data);
+ sha2_byte buffer[SHA256_BLOCK_LENGTH];
+ MEMCPY_BCOPY(buffer, data, SHA256_BLOCK_LENGTH);
+ SHA256_Transform(context, (sha2_word32*)buffer);
context->bitcount += SHA256_BLOCK_LENGTH << 3;
len -= SHA256_BLOCK_LENGTH;
data += SHA256_BLOCK_LENGTH;
@@ -879,7 +881,9 @@ void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) {
}
while (len >= SHA512_BLOCK_LENGTH) {
/* Process as many complete blocks as we can */
- SHA512_Transform(context, (sha2_word64*)data);
+ sha2_byte buffer[SHA512_BLOCK_LENGTH];
+ MEMCPY_BCOPY(buffer, data, SHA512_BLOCK_LENGTH);
+ SHA512_Transform(context, (sha2_word64*)buffer);
ADDINC128(context->bitcount, SHA512_BLOCK_LENGTH << 3);
len -= SHA512_BLOCK_LENGTH;
data += SHA512_BLOCK_LENGTH;