Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@chromium.org>2015-06-02 02:35:44 +0300
committerAdam Langley <agl@google.com>2015-06-02 04:07:07 +0300
commitaf8731f7a530c07602f9a806604613ddaf79f58a (patch)
tree255a8b39ab8cc7f265eb40b35606ec6d87dfbbe7 /crypto/evp
parentbf3208b84930d572392e16ef875a1383fbe7c4f9 (diff)
Remove HMAC_CTX_set_flags.
It's never called externally and for good reason; the only flag to set is EVP_MD_CTX_FLAG_NO_INIT which is an implementation detail of EVP_PKEY_HMAC (hopefully to be removed eventually). Indeed, only EVP_PKEY_HMAC ever calls this function. Except there's no need to because the HMAC_CTX has already been initialized at that point. (And were it not initialized, that call would not bode well for the poor HMAC_CTX.) The legacy EVP_PKEY_HMAC API has test coverage and still works after this change. Change-Id: I2fb0bede3c24ad1519f9433f957606de15ba86c7 Reviewed-on: https://boringssl-review.googlesource.com/4970 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/evp')
-rw-r--r--crypto/evp/p_hmac.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/crypto/evp/p_hmac.c b/crypto/evp/p_hmac.c
index f4a4193f..71b57d3b 100644
--- a/crypto/evp/p_hmac.c
+++ b/crypto/evp/p_hmac.c
@@ -148,9 +148,8 @@ static void int_update(EVP_MD_CTX *ctx, const void *data, size_t count) {
}
static int hmac_signctx_init(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx) {
- HMAC_PKEY_CTX *hctx = ctx->data;
-
- HMAC_CTX_set_flags(&hctx->ctx, mctx->flags & ~EVP_MD_CTX_FLAG_NO_INIT);
+ /* |mctx| gets repurposed as a hook to call |HMAC_Update|. Suppress the
+ * automatic setting of |mctx->update| and the rest of its initialization. */
EVP_MD_CTX_set_flags(mctx, EVP_MD_CTX_FLAG_NO_INIT);
mctx->update = int_update;
return 1;