summaryrefslogtreecommitdiff
path: root/deps/openssl/openssl/crypto/evp/digest.c
diff options
context:
space:
mode:
authorShigeki Ohtsu <ohtsu@ohtsu.org>2016-09-22 20:53:25 +0900
committerShigeki Ohtsu <ohtsu@ohtsu.org>2016-09-22 23:05:52 +0900
commitd1039709a4dce1c841a8972988245a88f2266fe1 (patch)
treee057f824a5325759d64fda189cb54652039022ff /deps/openssl/openssl/crypto/evp/digest.c
parent91b40944a41f8ab1e499ed5bebeed520a215b9a5 (diff)
downloadandroid-node-v8-d1039709a4dce1c841a8972988245a88f2266fe1.tar.gz
android-node-v8-d1039709a4dce1c841a8972988245a88f2266fe1.tar.bz2
android-node-v8-d1039709a4dce1c841a8972988245a88f2266fe1.zip
deps: upgrade openssl sources to 1.0.2i
This replaces all sources of openssl-1.0.2i.tar.gz into deps/openssl/openssl PR-URL: https://github.com/nodejs/node/pull/8714 Reviewed-By: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'deps/openssl/openssl/crypto/evp/digest.c')
-rw-r--r--deps/openssl/openssl/crypto/evp/digest.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/deps/openssl/openssl/crypto/evp/digest.c b/deps/openssl/openssl/crypto/evp/digest.c
index 5b642b23fc..4db179629d 100644
--- a/deps/openssl/openssl/crypto/evp/digest.c
+++ b/deps/openssl/openssl/crypto/evp/digest.c
@@ -253,10 +253,10 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl)
int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count)
{
#ifdef OPENSSL_FIPS
- return FIPS_digestupdate(ctx, data, count);
-#else
- return ctx->update(ctx, data, count);
+ if (FIPS_mode())
+ return FIPS_digestupdate(ctx, data, count);
#endif
+ return ctx->update(ctx, data, count);
}
/* The caller can assume that this removes any secret data from the context */
@@ -271,10 +271,11 @@ int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size)
/* The caller can assume that this removes any secret data from the context */
int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size)
{
-#ifdef OPENSSL_FIPS
- return FIPS_digestfinal(ctx, md, size);
-#else
int ret;
+#ifdef OPENSSL_FIPS
+ if (FIPS_mode())
+ return FIPS_digestfinal(ctx, md, size);
+#endif
OPENSSL_assert(ctx->digest->md_size <= EVP_MAX_MD_SIZE);
ret = ctx->digest->final(ctx, md);
@@ -284,9 +285,8 @@ int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size)
ctx->digest->cleanup(ctx);
EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
}
- memset(ctx->md_data, 0, ctx->digest->ctx_size);
+ OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size);
return ret;
-#endif
}
int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in)