Lines Matching refs:rctx

474     EVP_PKEY_CTX *rctx;  in EVP_PKEY_CTX_dup()  local
483 rctx = OPENSSL_zalloc(sizeof(*rctx)); in EVP_PKEY_CTX_dup()
484 if (rctx == NULL) { in EVP_PKEY_CTX_dup()
491 rctx->pkey = pctx->pkey; in EVP_PKEY_CTX_dup()
492 rctx->operation = pctx->operation; in EVP_PKEY_CTX_dup()
493 rctx->libctx = pctx->libctx; in EVP_PKEY_CTX_dup()
494 rctx->keytype = pctx->keytype; in EVP_PKEY_CTX_dup()
495 rctx->propquery = NULL; in EVP_PKEY_CTX_dup()
497 rctx->propquery = OPENSSL_strdup(pctx->propquery); in EVP_PKEY_CTX_dup()
498 if (rctx->propquery == NULL) in EVP_PKEY_CTX_dup()
501 rctx->legacy_keytype = pctx->legacy_keytype; in EVP_PKEY_CTX_dup()
505 rctx->op.kex.exchange = pctx->op.kex.exchange; in EVP_PKEY_CTX_dup()
506 if (!EVP_KEYEXCH_up_ref(rctx->op.kex.exchange)) in EVP_PKEY_CTX_dup()
512 rctx->op.kex.algctx in EVP_PKEY_CTX_dup()
514 if (rctx->op.kex.algctx == NULL) { in EVP_PKEY_CTX_dup()
515 EVP_KEYEXCH_free(rctx->op.kex.exchange); in EVP_PKEY_CTX_dup()
516 rctx->op.kex.exchange = NULL; in EVP_PKEY_CTX_dup()
519 return rctx; in EVP_PKEY_CTX_dup()
523 rctx->op.sig.signature = pctx->op.sig.signature; in EVP_PKEY_CTX_dup()
524 if (!EVP_SIGNATURE_up_ref(rctx->op.sig.signature)) in EVP_PKEY_CTX_dup()
530 rctx->op.sig.algctx in EVP_PKEY_CTX_dup()
532 if (rctx->op.sig.algctx == NULL) { in EVP_PKEY_CTX_dup()
533 EVP_SIGNATURE_free(rctx->op.sig.signature); in EVP_PKEY_CTX_dup()
534 rctx->op.sig.signature = NULL; in EVP_PKEY_CTX_dup()
537 return rctx; in EVP_PKEY_CTX_dup()
541 rctx->op.ciph.cipher = pctx->op.ciph.cipher; in EVP_PKEY_CTX_dup()
542 if (!EVP_ASYM_CIPHER_up_ref(rctx->op.ciph.cipher)) in EVP_PKEY_CTX_dup()
548 rctx->op.ciph.algctx in EVP_PKEY_CTX_dup()
550 if (rctx->op.ciph.algctx == NULL) { in EVP_PKEY_CTX_dup()
551 EVP_ASYM_CIPHER_free(rctx->op.ciph.cipher); in EVP_PKEY_CTX_dup()
552 rctx->op.ciph.cipher = NULL; in EVP_PKEY_CTX_dup()
555 return rctx; in EVP_PKEY_CTX_dup()
559 rctx->op.encap.kem = pctx->op.encap.kem; in EVP_PKEY_CTX_dup()
560 if (!EVP_KEM_up_ref(rctx->op.encap.kem)) in EVP_PKEY_CTX_dup()
566 rctx->op.encap.algctx in EVP_PKEY_CTX_dup()
568 if (rctx->op.encap.algctx == NULL) { in EVP_PKEY_CTX_dup()
569 EVP_KEM_free(rctx->op.encap.kem); in EVP_PKEY_CTX_dup()
570 rctx->op.encap.kem = NULL; in EVP_PKEY_CTX_dup()
573 return rctx; in EVP_PKEY_CTX_dup()
580 rctx->pmeth = pctx->pmeth; in EVP_PKEY_CTX_dup()
582 rctx->engine = pctx->engine; in EVP_PKEY_CTX_dup()
587 rctx->peerkey = pctx->peerkey; in EVP_PKEY_CTX_dup()
590 if (rctx->operation == EVP_PKEY_OP_UNDEFINED) { in EVP_PKEY_CTX_dup()
600 EVP_KEYMGMT_free(rctx->keymgmt); in EVP_PKEY_CTX_dup()
601 rctx->keymgmt = tmp_keymgmt; in EVP_PKEY_CTX_dup()
602 return rctx; in EVP_PKEY_CTX_dup()
604 } else if (pctx->pmeth->copy(rctx, pctx) > 0) { in EVP_PKEY_CTX_dup()
605 return rctx; in EVP_PKEY_CTX_dup()
608 rctx->pmeth = NULL; in EVP_PKEY_CTX_dup()
609 EVP_PKEY_CTX_free(rctx); in EVP_PKEY_CTX_dup()