This commit is contained in:
Zhi Guan
2017-04-14 15:31:35 +08:00
parent 7fa961cd6f
commit eb21e9d572
76 changed files with 3249 additions and 2961 deletions

View File

@@ -145,7 +145,16 @@ 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)
{
return ctx->update(ctx, data, count);
#ifndef OPENSSL_NO_SM2
if (!ctx->is_updated && ctx->pctx && ctx->pctx->pre_update) {
if (!ctx->update(ctx, ctx->pctx->pre_update,
ctx->pctx->pre_update_len)) {
return 0;
}
}
ctx->is_updated = 1;
#endif
return ctx->update(ctx, data, count);
}
/* The caller can assume that this removes any secret data from the context */