Discovered when fixing up ecdsa code.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13520)
/* main digest */
EVP_MD *md;
EVP_MD_CTX *mdctx;
- size_t mdsize;
int operation;
} PROV_DSA_CTX;
ctx->propq = NULL;
ctx->mdctx = NULL;
ctx->md = NULL;
- ctx->mdsize = 0;
DSA_free(ctx->dsa);
OPENSSL_free(ctx);
}
dstctx->dsa = NULL;
dstctx->md = NULL;
dstctx->mdctx = NULL;
+ dstctx->propq = NULL;
if (srcctx->dsa != NULL && !DSA_up_ref(srcctx->dsa))
goto err;
|| !EVP_MD_CTX_copy_ex(dstctx->mdctx, srcctx->mdctx))
goto err;
}
+ if (srcctx->propq != NULL) {
+ dstctx->propq = OPENSSL_strdup(srcctx->propq);
+ if (dstctx->propq == NULL)
+ goto err;
+ }
return dstctx;
err:
dstctx->md = NULL;
dstctx->mdctx = NULL;
dstctx->tbuf = NULL;
+ dstctx->propq = NULL;
if (srcctx->rsa != NULL && !RSA_up_ref(srcctx->rsa))
goto err;
goto err;
}
+ if (srcctx->propq != NULL) {
+ dstctx->propq = OPENSSL_strdup(srcctx->propq);
+ if (dstctx->propq == NULL)
+ goto err;
+ }
+
return dstctx;
err:
rsa_freectx(dstctx);