Home
last modified time | relevance | path

Searched refs:dctx (Results 1 – 25 of 55) sorted by relevance

123

/openssl/crypto/dh/
H A Ddh_pmeth.c56 DH_PKEY_CTX *dctx; in pkey_dh_init() local
58 if ((dctx = OPENSSL_zalloc(sizeof(*dctx))) == NULL) in pkey_dh_init()
62 dctx->generator = 2; in pkey_dh_init()
65 ctx->data = dctx; in pkey_dh_init()
76 if (dctx != NULL) { in pkey_dh_cleanup()
91 dctx = dst->data; in pkey_dh_copy()
97 dctx->md = sctx->md; in pkey_dh_copy()
132 dctx->pad = p1; in pkey_dh_ctrl()
421 if (dctx->pad) in pkey_dh_derive()
435 if (!dctx->kdf_outlen || !dctx->kdf_oid) in pkey_dh_derive()
[all …]
/openssl/crypto/ec/
H A Dec_pmeth.c49 EC_PKEY_CTX *dctx; in pkey_ec_init() local
51 if ((dctx = OPENSSL_zalloc(sizeof(*dctx))) == NULL) in pkey_ec_init()
56 ctx->data = dctx; in pkey_ec_init()
66 dctx = dst->data; in pkey_ec_copy()
72 dctx->md = sctx->md; in pkey_ec_copy()
95 if (dctx != NULL) { in pkey_ec_cleanup()
132 type = (dctx->md != NULL) ? EVP_MD_get_type(dctx->md) : NID_sha1; in pkey_ec_sign()
155 if (dctx->md) in pkey_ec_verify()
185 eckey = dctx->co_key ? dctx->co_key in pkey_ec_derive()
236 dctx->kdf_ukm, dctx->kdf_ukmlen, dctx->kdf_md, in pkey_ec_kdf_derive()
[all …]
/openssl/crypto/dsa/
H A Ddsa_pmeth.c40 DSA_PKEY_CTX *dctx = OPENSSL_malloc(sizeof(*dctx)); in pkey_dsa_init() local
42 if (dctx == NULL) in pkey_dsa_init()
44 dctx->nbits = 2048; in pkey_dsa_init()
45 dctx->qbits = 224; in pkey_dsa_init()
46 dctx->pmd = NULL; in pkey_dsa_init()
47 dctx->md = NULL; in pkey_dsa_init()
49 ctx->data = dctx; in pkey_dsa_init()
63 dctx = dst->data; in pkey_dsa_copy()
67 dctx->md = sctx->md; in pkey_dsa_copy()
74 OPENSSL_free(dctx); in pkey_dsa_cleanup()
[all …]
/openssl/providers/implementations/storemgmt/
H A Dwinstore_store.c48 OSSL_DECODER_CTX *dctx; member
187 if (ctx->dctx != NULL) in setup_decoder()
190 ctx->dctx = OSSL_DECODER_CTX_new(); in setup_decoder()
191 if (ctx->dctx == NULL) { in setup_decoder()
196 if (!OSSL_DECODER_CTX_set_input_type(ctx->dctx, "DER")) { in setup_decoder()
226 if (!ossl_decoder_ctx_add_decoder_inst(ctx->dctx, in setup_decoder()
244 if (!OSSL_DECODER_CTX_set_cleanup(ctx->dctx, load_cleanup)) { in setup_decoder()
252 OSSL_DECODER_CTX_free(ctx->dctx); in setup_decoder()
253 ctx->dctx = NULL; in setup_decoder()
272 OSSL_DECODER_CTX_set_construct_data(ctx->dctx, &data); in winstore_load_using()
[all …]
/openssl/providers/implementations/ciphers/
H A Dcipher_sm4_gcm.c35 PROV_SM4_GCM_CTX *dctx = NULL; in sm4_gcm_dupctx() local
40 dctx = OPENSSL_memdup(ctx, sizeof(*ctx)); in sm4_gcm_dupctx()
41 if (dctx != NULL && dctx->base.gcm.key != NULL) in sm4_gcm_dupctx()
42 dctx->base.gcm.key = &dctx->ks.ks; in sm4_gcm_dupctx()
44 return dctx; in sm4_gcm_dupctx()
H A Dcipher_sm4_ccm.c34 PROV_SM4_CCM_CTX *dctx = NULL; in sm4_ccm_dupctx() local
39 dctx = OPENSSL_memdup(ctx, sizeof(*ctx)); in sm4_ccm_dupctx()
40 if (dctx != NULL && dctx->base.ccm_ctx.key != NULL) in sm4_ccm_dupctx()
41 dctx->base.ccm_ctx.key = &dctx->ks.ks; in sm4_ccm_dupctx()
43 return dctx; in sm4_ccm_dupctx()
H A Dcipher_aria_ccm.c34 PROV_ARIA_CCM_CTX *dctx = NULL; in aria_ccm_dupctx() local
39 dctx = OPENSSL_memdup(ctx, sizeof(*ctx)); in aria_ccm_dupctx()
40 if (dctx != NULL && dctx->base.ccm_ctx.key != NULL) in aria_ccm_dupctx()
41 dctx->base.ccm_ctx.key = &dctx->ks.ks; in aria_ccm_dupctx()
43 return dctx; in aria_ccm_dupctx()
H A Dcipher_aria_gcm.c33 PROV_ARIA_GCM_CTX *dctx = NULL; in aria_gcm_dupctx() local
38 dctx = OPENSSL_memdup(ctx, sizeof(*ctx)); in aria_gcm_dupctx()
39 if (dctx != NULL && dctx->base.gcm.key != NULL) in aria_gcm_dupctx()
40 dctx->base.gcm.key = &dctx->ks.ks; in aria_gcm_dupctx()
42 return dctx; in aria_gcm_dupctx()
H A Dcipher_aes_gcm.c40 PROV_AES_GCM_CTX *dctx = NULL; in aes_gcm_dupctx() local
48 dctx = OPENSSL_memdup(ctx, sizeof(*ctx)); in aes_gcm_dupctx()
49 if (dctx != NULL && dctx->base.gcm.key != NULL) in aes_gcm_dupctx()
50 dctx->base.gcm.key = &dctx->ks.ks; in aes_gcm_dupctx()
52 return dctx; in aes_gcm_dupctx()
H A Dcipher_des_hw.c22 PROV_DES_CTX *dctx = (PROV_DES_CTX *)ctx; in cipher_hw_des_initkey() local
24 DES_key_schedule *ks = &dctx->dks.ks; in cipher_hw_des_initkey()
26 dctx->dstream.cbc = NULL; in cipher_hw_des_initkey()
31 dctx->dstream.cbc = ctx->enc ? des_t4_cbc_encrypt : in cipher_hw_des_initkey()
45 PROV_DES_CTX *dctx = (PROV_DES_CTX *)dst; in cipher_hw_des_copyctx() local
47 *dctx = *sctx; in cipher_hw_des_copyctx()
48 dst->ks = &dctx->dks.ks; in cipher_hw_des_copyctx()
68 PROV_DES_CTX *dctx = (PROV_DES_CTX *)ctx; in cipher_hw_des_cbc_cipher() local
69 DES_key_schedule *key = &(dctx->dks.ks); in cipher_hw_des_cbc_cipher()
71 if (dctx->dstream.cbc != NULL) { in cipher_hw_des_cbc_cipher()
[all …]
H A Dcipher_sm4_xts_hw.c78 PROV_SM4_XTS_CTX *dctx = (PROV_SM4_XTS_CTX *)dst; in cipher_hw_sm4_xts_copyctx() local
80 *dctx = *sctx; in cipher_hw_sm4_xts_copyctx()
81 dctx->xts.key1 = &dctx->ks1.ks; in cipher_hw_sm4_xts_copyctx()
82 dctx->xts.key2 = &dctx->ks2.ks; in cipher_hw_sm4_xts_copyctx()
H A Dcipher_aes_wrp.c72 PROV_AES_WRAP_CTX *dctx = wctx; in aes_wrap_dupctx() local
79 dctx = OPENSSL_memdup(ctx, sizeof(*ctx)); in aes_wrap_dupctx()
81 if (dctx != NULL && dctx->base.tlsmac != NULL && dctx->base.alloced) { in aes_wrap_dupctx()
82 dctx->base.tlsmac = OPENSSL_memdup(dctx->base.tlsmac, in aes_wrap_dupctx()
83 dctx->base.tlsmacsize); in aes_wrap_dupctx()
84 if (dctx->base.tlsmac == NULL) { in aes_wrap_dupctx()
85 OPENSSL_free(dctx); in aes_wrap_dupctx()
86 dctx = NULL; in aes_wrap_dupctx()
89 return dctx; in aes_wrap_dupctx()
H A Dcipher_chacha20_poly1305.c65 PROV_CHACHA20_POLY1305_CTX *dctx = NULL; in chacha20_poly1305_dupctx() local
69 dctx = OPENSSL_memdup(ctx, sizeof(*ctx)); in chacha20_poly1305_dupctx()
70 if (dctx != NULL && dctx->base.tlsmac != NULL && dctx->base.alloced) { in chacha20_poly1305_dupctx()
71 dctx->base.tlsmac = OPENSSL_memdup(dctx->base.tlsmac, in chacha20_poly1305_dupctx()
72 dctx->base.tlsmacsize); in chacha20_poly1305_dupctx()
73 if (dctx->base.tlsmac == NULL) { in chacha20_poly1305_dupctx()
74 OPENSSL_free(dctx); in chacha20_poly1305_dupctx()
75 dctx = NULL; in chacha20_poly1305_dupctx()
78 return dctx; in chacha20_poly1305_dupctx()
H A Dcipher_aes_xts_hw.c93 PROV_AES_XTS_CTX *dctx = (PROV_AES_XTS_CTX *)dst; in cipher_hw_aes_xts_copyctx() local
95 *dctx = *sctx; in cipher_hw_aes_xts_copyctx()
96 dctx->xts.key1 = &dctx->ks1.ks; in cipher_hw_aes_xts_copyctx()
97 dctx->xts.key2 = &dctx->ks2.ks; in cipher_hw_aes_xts_copyctx()
/openssl/doc/man3/
H A DOSSL_DECODER_from_bio.pod52 OSSL_DECODER_CTX *dctx;
59 dctx = OSSL_DECODER_CTX_new_for_pkey(&pkey, format, structure,
63 if (dctx == NULL) {
67 OSSL_DECODER_CTX_set_passphrase(dctx, pass, strlen(pass));
68 if (OSSL_DECODER_from_bio(dctx, bio)) {
73 OSSL_DECODER_CTX_free(dctx);
77 OSSL_DECODER_CTX *dctx;
86 dctx = OSSL_DECODER_CTX_new_for_pkey(&pkey, format, structure,
91 if (dctx == NULL) {
96 if (OSSL_DECODER_from_data(dctx, &data, &datalen)) {
[all …]
/openssl/demos/encode/
H A Dec_encode.c33 OSSL_DECODER_CTX *dctx = NULL; in load_key() local
46 dctx = OSSL_DECODER_CTX_new_for_pkey(&pkey, "PEM", NULL, "EC", in load_key()
49 if (dctx == NULL) { in load_key()
64 if (OSSL_DECODER_CTX_set_passphrase(dctx, in load_key()
73 if (OSSL_DECODER_from_fp(dctx, f) == 0) { in load_key()
80 OSSL_DECODER_CTX_free(dctx); in load_key()
H A Drsa_encode.c33 OSSL_DECODER_CTX *dctx = NULL; in load_key() local
46 dctx = OSSL_DECODER_CTX_new_for_pkey(&pkey, "PEM", NULL, "RSA", in load_key()
49 if (dctx == NULL) { in load_key()
64 if (OSSL_DECODER_CTX_set_passphrase(dctx, in load_key()
73 if (OSSL_DECODER_from_fp(dctx, f) == 0) { in load_key()
80 OSSL_DECODER_CTX_free(dctx); in load_key()
/openssl/crypto/hmac/
H A Dhmac_s390x.c286 int s390x_HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx) in s390x_HMAC_CTX_copy() argument
288 dctx->plat.s390x.fc = sctx->plat.s390x.fc; in s390x_HMAC_CTX_copy()
289 dctx->plat.s390x.blk_size = sctx->plat.s390x.blk_size; in s390x_HMAC_CTX_copy()
290 dctx->plat.s390x.ikp = sctx->plat.s390x.ikp; in s390x_HMAC_CTX_copy()
291 dctx->plat.s390x.iimp = sctx->plat.s390x.iimp; in s390x_HMAC_CTX_copy()
294 sizeof(dctx->plat.s390x.param)); in s390x_HMAC_CTX_copy()
296 OPENSSL_clear_free(dctx->plat.s390x.buf, dctx->plat.s390x.size); in s390x_HMAC_CTX_copy()
297 dctx->plat.s390x.buf = NULL; in s390x_HMAC_CTX_copy()
301 if (dctx->plat.s390x.buf == NULL) in s390x_HMAC_CTX_copy()
305 dctx->plat.s390x.size = sctx->plat.s390x.size; in s390x_HMAC_CTX_copy()
[all …]
H A Dhmac.c225 int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx) in HMAC_CTX_copy() argument
227 if (!hmac_ctx_alloc_mds(dctx)) in HMAC_CTX_copy()
229 if (!EVP_MD_CTX_copy_ex(dctx->i_ctx, sctx->i_ctx)) in HMAC_CTX_copy()
231 if (!EVP_MD_CTX_copy_ex(dctx->o_ctx, sctx->o_ctx)) in HMAC_CTX_copy()
233 if (!EVP_MD_CTX_copy_ex(dctx->md_ctx, sctx->md_ctx)) in HMAC_CTX_copy()
235 dctx->md = sctx->md; in HMAC_CTX_copy()
238 if (s390x_HMAC_CTX_copy(dctx, sctx) == 0) in HMAC_CTX_copy()
244 hmac_ctx_cleanup(dctx); in HMAC_CTX_copy()
/openssl/crypto/evp/
H A Devp_pkey.c76 OSSL_DECODER_CTX *dctx = NULL; in EVP_PKCS82PKEY_ex() local
92 dctx = OSSL_DECODER_CTX_new_for_pkey(&pkey, "DER", "PrivateKeyInfo", in EVP_PKCS82PKEY_ex()
95 if (dctx != NULL && OSSL_DECODER_CTX_get_num_decoders(dctx) == 0) { in EVP_PKCS82PKEY_ex()
96 OSSL_DECODER_CTX_free(dctx); in EVP_PKCS82PKEY_ex()
103 dctx = OSSL_DECODER_CTX_new_for_pkey(&pkey, "DER", "PrivateKeyInfo", in EVP_PKCS82PKEY_ex()
107 if (dctx == NULL in EVP_PKCS82PKEY_ex()
108 || !OSSL_DECODER_from_data(dctx, &p8_data, &len)) in EVP_PKCS82PKEY_ex()
113 OSSL_DECODER_CTX_free(dctx); in EVP_PKCS82PKEY_ex()
H A Dm_sigver.c486 dctx = EVP_PKEY_CTX_dup(pctx); in EVP_DigestSignFinal()
487 if (dctx != NULL) in EVP_DigestSignFinal()
488 pctx = dctx; in EVP_DigestSignFinal()
496 EVP_PKEY_CTX_free(dctx); in EVP_DigestSignFinal()
519 if (dctx == NULL) in EVP_DigestSignFinal()
521 r = dctx->pmeth->signctx(dctx, sigret, siglen, ctx); in EVP_DigestSignFinal()
522 EVP_PKEY_CTX_free(dctx); in EVP_DigestSignFinal()
629 if (dctx != NULL) in EVP_DigestVerifyFinal()
630 pctx = dctx; in EVP_DigestVerifyFinal()
634 if (dctx == NULL) in EVP_DigestVerifyFinal()
[all …]
/openssl/fuzz/
H A Ddecoder.c43 OSSL_DECODER_CTX *dctx; in FuzzerTestOneInput() local
49 dctx = OSSL_DECODER_CTX_new_for_pkey(&pkey, NULL, NULL, NULL, 0, NULL, in FuzzerTestOneInput()
51 if (dctx == NULL) { in FuzzerTestOneInput()
54 if (OSSL_DECODER_from_data(dctx, &buf, &len)) { in FuzzerTestOneInput()
85 OSSL_DECODER_CTX_free(dctx); in FuzzerTestOneInput()
/openssl/doc/man7/
H A Dprovider-digest.pod21 void OSSL_FUNC_digest_freectx(void *dctx);
22 void *OSSL_FUNC_digest_dupctx(void *dctx);
26 int OSSL_FUNC_digest_init(void *dctx, const OSSL_PARAM params[]);
37 const OSSL_PARAM *OSSL_FUNC_digest_gettable_ctx_params(void *dctx,
39 const OSSL_PARAM *OSSL_FUNC_digest_settable_ctx_params(void *dctx,
47 int OSSL_FUNC_digest_get_ctx_params(void *dctx, OSSL_PARAM params[]);
110 the I<dctx> parameter.
114 I<dctx> parameter and return the duplicate copy.
127 provider side digest context in the I<dctx> parameter.
163 provider side digest context I<dctx> to I<params>.
[all …]
H A DEVP_KEYEXCH-DH.pod92 EVP_PKEY_CTX *dctx = EVP_PKEY_CTX_new_from_pkey(NULL, host_key, NULL);
94 EVP_PKEY_derive_init(dctx);
99 EVP_PKEY_CTX_set_params(dctx, params);
101 EVP_PKEY_derive_set_peer(dctx, peer_pub_key);
104 EVP_PKEY_derive(dctx, NULL, &secret_len);
107 EVP_PKEY_derive(dctx, secret, &secret_len);
110 EVP_PKEY_CTX_free(dctx);
/openssl/test/
H A Dendecoder_legacy_test.c311 OSSL_DECODER_CTX *dctx = NULL; in test_protected_PEM() local
335 || !TEST_ptr(dctx = in test_protected_PEM()
340 || !TEST_true(OSSL_DECODER_from_bio(dctx, membio_provided)) in test_protected_PEM()
360 OSSL_DECODER_CTX_free(dctx); in test_protected_PEM()
379 OSSL_DECODER_CTX *dctx = NULL; in test_unprotected_PEM() local
402 || !TEST_ptr(dctx = in test_unprotected_PEM()
407 || !TEST_true(OSSL_DECODER_from_bio(dctx, membio_provided)) in test_unprotected_PEM()
427 OSSL_DECODER_CTX_free(dctx); in test_unprotected_PEM()
449 OSSL_DECODER_CTX *dctx = NULL; in test_DER() local
469 || !TEST_ptr(dctx = in test_DER()
[all …]

Completed in 123 milliseconds

123