diff options
author | David Benjamin <davidben@chromium.org> | 2015-05-27 08:41:01 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-06-02 01:17:10 +0300 |
commit | 2c3679210e77f825782317e6b5d4ffc7eae4b81b (patch) | |
tree | eda6732256f719cefd914c2be6fda74eb76ce605 /crypto/hmac | |
parent | e2375e139ee410538a3a77e8921b49cc8e727bb0 (diff) |
EVP_Digest*Update, EVP_DigestFinal, and HMAC_Update can never fail.
Enough code fails to check their return codes anyway. We ought to make
it official.
Change-Id: Ie646360fd7073ea943036f5e21bed13df7e1b77a
Reviewed-on: https://boringssl-review.googlesource.com/4954
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/hmac')
-rw-r--r-- | crypto/hmac/hmac.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c index b1b26236..eb486203 100644 --- a/crypto/hmac/hmac.c +++ b/crypto/hmac/hmac.c @@ -172,6 +172,8 @@ int HMAC_Final(HMAC_CTX *ctx, uint8_t *out, unsigned int *out_len) { unsigned int i; uint8_t buf[EVP_MAX_MD_SIZE]; + /* TODO(davidben): The only thing that can officially fail here is + * |EVP_MD_CTX_copy_ex|, but even that should be impossible in this case. */ if (!EVP_DigestFinal_ex(&ctx->md_ctx, buf, &i) || !EVP_MD_CTX_copy_ex(&ctx->md_ctx, &ctx->o_ctx) || !EVP_DigestUpdate(&ctx->md_ctx, buf, i) || |