Lines Matching refs:rctx

451     EVP_PKEY_CTX *rctx;  in EVP_PKEY_CTX_dup()  local
460 rctx = OPENSSL_zalloc(sizeof(*rctx)); in EVP_PKEY_CTX_dup()
461 if (rctx == NULL) in EVP_PKEY_CTX_dup()
466 rctx->pkey = pctx->pkey; in EVP_PKEY_CTX_dup()
467 rctx->operation = pctx->operation; in EVP_PKEY_CTX_dup()
468 rctx->libctx = pctx->libctx; in EVP_PKEY_CTX_dup()
469 rctx->keytype = pctx->keytype; in EVP_PKEY_CTX_dup()
470 rctx->propquery = NULL; in EVP_PKEY_CTX_dup()
472 rctx->propquery = OPENSSL_strdup(pctx->propquery); in EVP_PKEY_CTX_dup()
473 if (rctx->propquery == NULL) in EVP_PKEY_CTX_dup()
476 rctx->legacy_keytype = pctx->legacy_keytype; in EVP_PKEY_CTX_dup()
480 rctx->op.kex.exchange = pctx->op.kex.exchange; in EVP_PKEY_CTX_dup()
481 if (!EVP_KEYEXCH_up_ref(rctx->op.kex.exchange)) in EVP_PKEY_CTX_dup()
489 rctx->op.kex.algctx in EVP_PKEY_CTX_dup()
492 if (rctx->op.kex.algctx == NULL) { in EVP_PKEY_CTX_dup()
493 EVP_KEYEXCH_free(rctx->op.kex.exchange); in EVP_PKEY_CTX_dup()
494 rctx->op.kex.exchange = NULL; in EVP_PKEY_CTX_dup()
497 return rctx; in EVP_PKEY_CTX_dup()
501 rctx->op.sig.signature = pctx->op.sig.signature; in EVP_PKEY_CTX_dup()
502 if (!EVP_SIGNATURE_up_ref(rctx->op.sig.signature)) in EVP_PKEY_CTX_dup()
510 rctx->op.sig.algctx in EVP_PKEY_CTX_dup()
513 if (rctx->op.sig.algctx == NULL) { in EVP_PKEY_CTX_dup()
514 EVP_SIGNATURE_free(rctx->op.sig.signature); in EVP_PKEY_CTX_dup()
515 rctx->op.sig.signature = NULL; in EVP_PKEY_CTX_dup()
518 return rctx; in EVP_PKEY_CTX_dup()
522 rctx->op.ciph.cipher = pctx->op.ciph.cipher; in EVP_PKEY_CTX_dup()
523 if (!EVP_ASYM_CIPHER_up_ref(rctx->op.ciph.cipher)) in EVP_PKEY_CTX_dup()
531 rctx->op.ciph.algctx in EVP_PKEY_CTX_dup()
534 if (rctx->op.ciph.algctx == NULL) { in EVP_PKEY_CTX_dup()
535 EVP_ASYM_CIPHER_free(rctx->op.ciph.cipher); in EVP_PKEY_CTX_dup()
536 rctx->op.ciph.cipher = NULL; in EVP_PKEY_CTX_dup()
539 return rctx; in EVP_PKEY_CTX_dup()
543 rctx->op.encap.kem = pctx->op.encap.kem; in EVP_PKEY_CTX_dup()
544 if (!EVP_KEM_up_ref(rctx->op.encap.kem)) in EVP_PKEY_CTX_dup()
552 rctx->op.encap.algctx in EVP_PKEY_CTX_dup()
555 if (rctx->op.encap.algctx == NULL) { in EVP_PKEY_CTX_dup()
556 EVP_KEM_free(rctx->op.encap.kem); in EVP_PKEY_CTX_dup()
557 rctx->op.encap.kem = NULL; in EVP_PKEY_CTX_dup()
560 return rctx; in EVP_PKEY_CTX_dup()
567 rctx->pmeth = pctx->pmeth; in EVP_PKEY_CTX_dup()
569 rctx->engine = pctx->engine; in EVP_PKEY_CTX_dup()
574 rctx->peerkey = pctx->peerkey; in EVP_PKEY_CTX_dup()
577 if (rctx->operation == EVP_PKEY_OP_UNDEFINED) { in EVP_PKEY_CTX_dup()
587 EVP_KEYMGMT_free(rctx->keymgmt); in EVP_PKEY_CTX_dup()
588 rctx->keymgmt = tmp_keymgmt; in EVP_PKEY_CTX_dup()
589 return rctx; in EVP_PKEY_CTX_dup()
591 } else if (pctx->pmeth->copy(rctx, pctx) > 0) { in EVP_PKEY_CTX_dup()
592 return rctx; in EVP_PKEY_CTX_dup()
595 rctx->pmeth = NULL; in EVP_PKEY_CTX_dup()
596 EVP_PKEY_CTX_free(rctx); in EVP_PKEY_CTX_dup()