EVP_KEYMGMT_free(keymgmt);
return NULL;
}
-
+ if (propquery != NULL) {
+ ret->propquery = OPENSSL_strdup(propquery);
+ if (ret->propquery == NULL) {
+ EVP_KEYMGMT_free(keymgmt);
+ return NULL;
+ }
+ }
ret->libctx = libctx;
- ret->propquery = propquery;
ret->keytype = keytype;
ret->keymgmt = keymgmt;
ret->legacy_keytype = id; /* TODO: Remove when #legacy key are gone */
#endif
EVP_KEYMGMT_free(ctx->keymgmt);
+ OPENSSL_free(ctx->propquery);
EVP_PKEY_free(ctx->pkey);
EVP_PKEY_free(ctx->peerkey);
#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
rctx->operation = pctx->operation;
rctx->libctx = pctx->libctx;
rctx->keytype = pctx->keytype;
- rctx->propquery = pctx->propquery;
+ rctx->propquery = NULL;
+ if (pctx->propquery != NULL) {
+ rctx->propquery = OPENSSL_strdup(pctx->propquery);
+ if (rctx->propquery == NULL) {
+ OPENSSL_free(rctx);
+ return NULL;
+ }
+ }
if (EVP_PKEY_CTX_IS_DERIVE_OP(pctx)) {
if (pctx->op.kex.exchange != NULL) {