SM2 KAP (Key Agreement Protocol), not tested

This commit is contained in:
Zhi Guan
2016-04-07 22:15:41 +02:00
parent ef74cbd1e5
commit 5cc6cfdf22
55 changed files with 3803 additions and 1028 deletions

View File

@@ -87,6 +87,8 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
}
}
fprintf(stderr, "%s %d\n", __FILE__, __LINE__);
if (ver) {
if (ctx->pctx->pmeth->verifyctx_init) {
if (ctx->pctx->pmeth->verifyctx_init(ctx->pctx, ctx) <= 0)
@@ -102,12 +104,16 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
} else if (EVP_PKEY_sign_init(ctx->pctx) <= 0)
return 0;
}
fprintf(stderr, "%s %d\n", __FILE__, __LINE__);
if (EVP_PKEY_CTX_set_signature_md(ctx->pctx, type) <= 0)
return 0;
fprintf(stderr, "%s %d\n", __FILE__, __LINE__);
if (pctx)
*pctx = ctx->pctx;
fprintf(stderr, "%s %d\n", __FILE__, __LINE__);
if (ctx->pctx->pmeth->flags & EVP_PKEY_FLAG_SIGCTX_CUSTOM)
return 1;
fprintf(stderr, "%s %d\n", __FILE__, __LINE__);
if (!EVP_DigestInit_ex(ctx, type, e))
return 0;
return 1;