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:
parent
9158637142
commit
88e27bcbe0
@ -102,8 +102,8 @@ uint8_t *SHA224(const uint8_t *data, size_t len, uint8_t *out) {
|
||||
out = buf;
|
||||
}
|
||||
SHA224_Init(&ctx);
|
||||
SHA256_Update(&ctx, data, len);
|
||||
SHA256_Final(out, &ctx);
|
||||
SHA224_Update(&ctx, data, len);
|
||||
SHA224_Final(out, &ctx);
|
||||
OPENSSL_cleanse(&ctx, sizeof(ctx));
|
||||
return out;
|
||||
}
|
||||
|
@ -127,8 +127,8 @@ uint8_t *SHA384(const uint8_t *data, size_t len, uint8_t *out) {
|
||||
}
|
||||
|
||||
SHA384_Init(&ctx);
|
||||
SHA512_Update(&ctx, data, len);
|
||||
SHA512_Final(out, &ctx);
|
||||
SHA384_Update(&ctx, data, len);
|
||||
SHA384_Final(out, &ctx);
|
||||
OPENSSL_cleanse(&ctx, sizeof(ctx));
|
||||
return out;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user