Lines Matching defs:pctx

472 EVP_PKEY_CTX *EVP_PKEY_CTX_dup(const EVP_PKEY_CTX *pctx)
478 if (pctx->engine && !ENGINE_init(pctx->engine)) {
489 if (pctx->pkey != NULL)
490 EVP_PKEY_up_ref(pctx->pkey);
491 rctx->pkey = pctx->pkey;
492 rctx->operation = pctx->operation;
493 rctx->libctx = pctx->libctx;
494 rctx->keytype = pctx->keytype;
496 if (pctx->propquery != NULL) {
497 rctx->propquery = OPENSSL_strdup(pctx->propquery);
501 rctx->legacy_keytype = pctx->legacy_keytype;
503 if (EVP_PKEY_CTX_IS_DERIVE_OP(pctx)) {
504 if (pctx->op.kex.exchange != NULL) {
505 rctx->op.kex.exchange = pctx->op.kex.exchange;
509 if (pctx->op.kex.algctx != NULL) {
510 if (!ossl_assert(pctx->op.kex.exchange != NULL))
513 if (pctx->op.kex.exchange->dupctx != NULL)
515 = pctx->op.kex.exchange->dupctx(pctx->op.kex.algctx);
524 } else if (EVP_PKEY_CTX_IS_SIGNATURE_OP(pctx)) {
525 if (pctx->op.sig.signature != NULL) {
526 rctx->op.sig.signature = pctx->op.sig.signature;
530 if (pctx->op.sig.algctx != NULL) {
531 if (!ossl_assert(pctx->op.sig.signature != NULL))
534 if (pctx->op.sig.signature->dupctx != NULL)
536 = pctx->op.sig.signature->dupctx(pctx->op.sig.algctx);
545 } else if (EVP_PKEY_CTX_IS_ASYM_CIPHER_OP(pctx)) {
546 if (pctx->op.ciph.cipher != NULL) {
547 rctx->op.ciph.cipher = pctx->op.ciph.cipher;
551 if (pctx->op.ciph.algctx != NULL) {
552 if (!ossl_assert(pctx->op.ciph.cipher != NULL))
555 if (pctx->op.ciph.cipher->dupctx != NULL)
557 = pctx->op.ciph.cipher->dupctx(pctx->op.ciph.algctx);
566 } else if (EVP_PKEY_CTX_IS_KEM_OP(pctx)) {
567 if (pctx->op.encap.kem != NULL) {
568 rctx->op.encap.kem = pctx->op.encap.kem;
572 if (pctx->op.encap.algctx != NULL) {
573 if (!ossl_assert(pctx->op.encap.kem != NULL))
576 if (pctx->op.encap.kem->dupctx != NULL)
578 = pctx->op.encap.kem->dupctx(pctx->op.encap.algctx);
587 } else if (EVP_PKEY_CTX_IS_GEN_OP(pctx)) {
592 rctx->pmeth = pctx->pmeth;
594 rctx->engine = pctx->engine;
597 if (pctx->peerkey != NULL)
598 EVP_PKEY_up_ref(pctx->peerkey);
599 rctx->peerkey = pctx->peerkey;
601 if (pctx->pmeth == NULL) {
603 EVP_KEYMGMT *tmp_keymgmt = pctx->keymgmt;
606 provkey = evp_pkey_export_to_provider(pctx->pkey, pctx->libctx,
607 &tmp_keymgmt, pctx->propquery);
616 } else if (pctx->pmeth->copy(rctx, pctx) > 0) {