Don't mismatch Init and Update/Final hash functions.

Fixes the ASan bot.

Change-Id: I29b9b98680b634c5e486a734afa38f9d4e458518
Reviewed-on: https://boringssl-review.googlesource.com/7792
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
David Benjamin 2016-04-27 14:51:17 -04:00 committed by Adam Langley
parent 9158637142
commit 88e27bcbe0
2 changed files with 4 additions and 4 deletions

View File

@ -102,8 +102,8 @@ uint8_t *SHA224(const uint8_t *data, size_t len, uint8_t *out) {
out = buf; out = buf;
} }
SHA224_Init(&ctx); SHA224_Init(&ctx);
SHA256_Update(&ctx, data, len); SHA224_Update(&ctx, data, len);
SHA256_Final(out, &ctx); SHA224_Final(out, &ctx);
OPENSSL_cleanse(&ctx, sizeof(ctx)); OPENSSL_cleanse(&ctx, sizeof(ctx));
return out; return out;
} }

View File

@ -127,8 +127,8 @@ uint8_t *SHA384(const uint8_t *data, size_t len, uint8_t *out) {
} }
SHA384_Init(&ctx); SHA384_Init(&ctx);
SHA512_Update(&ctx, data, len); SHA384_Update(&ctx, data, len);
SHA512_Final(out, &ctx); SHA384_Final(out, &ctx);
OPENSSL_cleanse(&ctx, sizeof(ctx)); OPENSSL_cleanse(&ctx, sizeof(ctx));
return out; return out;
} }