X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fec%2Fec_pmeth.c;h=31d44d944966ba530448bc8b795599d366bb7355;hp=760200892ec45ff12346969b3f0edf2d1a6686e5;hb=b7683e3a5d93aa5319263b7bbfd0fee18f25955e;hpb=eaff5a1412011574860a74ff9076838ea1e59dd0 diff --git a/crypto/ec/ec_pmeth.c b/crypto/ec/ec_pmeth.c index 760200892e..31d44d9449 100644 --- a/crypto/ec/ec_pmeth.c +++ b/crypto/ec/ec_pmeth.c @@ -88,6 +88,23 @@ static int pkey_ec_init(EVP_PKEY_CTX *ctx) return 1; } +static int pkey_ec_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src) + { + EC_PKEY_CTX *dctx, *sctx; + if (!pkey_ec_init(dst)) + return 0; + sctx = src->data; + dctx = dst->data; + if (sctx->gen_group) + { + dctx->gen_group = EC_GROUP_dup(sctx->gen_group); + if (!dctx->gen_group) + return 0; + } + dctx->md = sctx->md; + return 1; + } + static void pkey_ec_cleanup(EVP_PKEY_CTX *ctx) { EC_PKEY_CTX *dctx = ctx->data; @@ -213,6 +230,7 @@ static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) case EVP_PKEY_CTRL_PEER_KEY: /* Default behaviour is OK */ + case EVP_PKEY_CTRL_PKCS7_SIGN: return 1; default: @@ -284,6 +302,7 @@ const EVP_PKEY_METHOD ec_pkey_meth = EVP_PKEY_EC, 0, pkey_ec_init, + pkey_ec_copy, pkey_ec_cleanup, 0,