Browse Source

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>
kris/onging/CECPQ3_patch15
David Benjamin 8 years ago
committed by Adam Langley
parent
commit
88e27bcbe0
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      crypto/sha/sha256.c
  2. +2
    -2
      crypto/sha/sha512.c

+ 2
- 2
crypto/sha/sha256.c View File

@@ -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;
}


+ 2
- 2
crypto/sha/sha512.c View File

@@ -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…
Cancel
Save