Lines Matching refs:pctx
20 static int dh_cms_set_peerkey(EVP_PKEY_CTX *pctx, in dh_cms_set_peerkey() argument
41 pk = EVP_PKEY_CTX_get0_pkey(pctx); in dh_cms_set_peerkey()
71 if (EVP_PKEY_derive_set_peer(pctx, pkpeer) > 0) in dh_cms_set_peerkey()
81 static int dh_cms_set_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri) in dh_cms_set_shared_info() argument
106 if (EVP_PKEY_CTX_set_dh_kdf_type(pctx, EVP_PKEY_DH_KDF_X9_42) <= 0 in dh_cms_set_shared_info()
107 || EVP_PKEY_CTX_set_dh_kdf_md(pctx, EVP_sha1()) <= 0) in dh_cms_set_shared_info()
125 kekcipher = EVP_CIPHER_fetch(pctx->libctx, name, pctx->propquery); in dh_cms_set_shared_info()
135 if (EVP_PKEY_CTX_set_dh_kdf_outlen(pctx, keylen) <= 0) in dh_cms_set_shared_info()
138 if (EVP_PKEY_CTX_set0_dh_kdf_oid(pctx, in dh_cms_set_shared_info()
150 if (EVP_PKEY_CTX_set0_dh_kdf_ukm(pctx, dukm, dukmlen) <= 0) in dh_cms_set_shared_info()
164 EVP_PKEY_CTX *pctx = CMS_RecipientInfo_get0_pkey_ctx(ri); in dh_cms_decrypt() local
166 if (pctx == NULL) in dh_cms_decrypt()
169 if (!EVP_PKEY_CTX_get0_peerkey(pctx)) { in dh_cms_decrypt()
178 if (!dh_cms_set_peerkey(pctx, alg, pubkey)) { in dh_cms_decrypt()
184 if (!dh_cms_set_shared_info(pctx, ri)) { in dh_cms_decrypt()
193 EVP_PKEY_CTX *pctx; in dh_cms_encrypt() local
209 pctx = CMS_RecipientInfo_get0_pkey_ctx(ri); in dh_cms_encrypt()
210 if (pctx == NULL) in dh_cms_encrypt()
213 pkey = EVP_PKEY_CTX_get0_pkey(pctx); in dh_cms_encrypt()
246 kdf_type = EVP_PKEY_CTX_get_dh_kdf_type(pctx); in dh_cms_encrypt()
247 if (kdf_type <= 0 || EVP_PKEY_CTX_get_dh_kdf_md(pctx, &kdf_md) <= 0) in dh_cms_encrypt()
252 if (EVP_PKEY_CTX_set_dh_kdf_type(pctx, kdf_type) <= 0) in dh_cms_encrypt()
260 if (EVP_PKEY_CTX_set_dh_kdf_md(pctx, kdf_md) <= 0) in dh_cms_encrypt()
272 if (EVP_PKEY_CTX_set0_dh_kdf_oid(pctx, OBJ_nid2obj(wrap_nid)) <= 0) in dh_cms_encrypt()
292 if (EVP_PKEY_CTX_set_dh_kdf_outlen(pctx, keylen) <= 0) in dh_cms_encrypt()
302 if (EVP_PKEY_CTX_set0_dh_kdf_ukm(pctx, dukm, dukmlen) <= 0) in dh_cms_encrypt()