Home
last modified time | relevance | path

Searched refs:dctx (Results 1 – 25 of 53) 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.c47 OSSL_DECODER_CTX *dctx; member
186 if (ctx->dctx != NULL) in setup_decoder()
189 ctx->dctx = OSSL_DECODER_CTX_new(); in setup_decoder()
190 if (ctx->dctx == NULL) { in setup_decoder()
195 if (!OSSL_DECODER_CTX_set_input_type(ctx->dctx, "DER")) { in setup_decoder()
225 if (!ossl_decoder_ctx_add_decoder_inst(ctx->dctx, in setup_decoder()
243 if (!OSSL_DECODER_CTX_set_cleanup(ctx->dctx, load_cleanup)) { in setup_decoder()
251 OSSL_DECODER_CTX_free(ctx->dctx); in setup_decoder()
252 ctx->dctx = NULL; in setup_decoder()
271 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
45 dctx = OPENSSL_memdup(ctx, sizeof(*ctx)); in aes_gcm_dupctx()
46 if (dctx != NULL && dctx->base.gcm.key != NULL) in aes_gcm_dupctx()
47 dctx->base.gcm.key = &dctx->ks.ks; in aes_gcm_dupctx()
49 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
76 dctx = OPENSSL_memdup(ctx, sizeof(*ctx)); in aes_wrap_dupctx()
78 if (dctx != NULL && dctx->base.tlsmac != NULL && dctx->base.alloced) { in aes_wrap_dupctx()
79 dctx->base.tlsmac = OPENSSL_memdup(dctx->base.tlsmac, in aes_wrap_dupctx()
80 dctx->base.tlsmacsize); in aes_wrap_dupctx()
81 if (dctx->base.tlsmac == NULL) { in aes_wrap_dupctx()
82 OPENSSL_free(dctx); in aes_wrap_dupctx()
83 dctx = NULL; in aes_wrap_dupctx()
86 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()
H A Dcipher_desx_hw.c44 PROV_TDES_CTX *dctx = (PROV_TDES_CTX *)dst; in cipher_hw_desx_copyctx() local
46 *dctx = *sctx; in cipher_hw_desx_copyctx()
47 dst->ks = &dctx->tks.ks; in cipher_hw_desx_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/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.c492 dctx = EVP_PKEY_CTX_dup(pctx); in EVP_DigestSignFinal()
493 if (dctx != NULL) in EVP_DigestSignFinal()
494 pctx = dctx; in EVP_DigestSignFinal()
502 EVP_PKEY_CTX_free(dctx); in EVP_DigestSignFinal()
525 if (dctx == NULL) in EVP_DigestSignFinal()
527 r = dctx->pmeth->signctx(dctx, sigret, siglen, ctx); in EVP_DigestSignFinal()
528 EVP_PKEY_CTX_free(dctx); in EVP_DigestSignFinal()
635 if (dctx != NULL) in EVP_DigestVerifyFinal()
636 pctx = dctx; in EVP_DigestVerifyFinal()
640 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);
25 int OSSL_FUNC_digest_init(void *dctx, const OSSL_PARAM params[]);
36 const OSSL_PARAM *OSSL_FUNC_digest_gettable_ctx_params(void *dctx,
38 const OSSL_PARAM *OSSL_FUNC_digest_settable_ctx_params(void *dctx,
46 int OSSL_FUNC_digest_get_ctx_params(void *dctx, OSSL_PARAM params[]);
108 the I<dctx> parameter.
112 I<dctx> parameter and return the duplicate copy.
117 provider side digest context in the I<dctx> parameter.
153 provider side digest context I<dctx> to I<params>.
[all …]
H A DEVP_KEYEXCH-DH.pod89 EVP_PKEY_CTX *dctx = EVP_PKEY_CTX_new_from_pkey(NULL, host_key, NULL);
91 EVP_PKEY_derive_init(dctx);
96 EVP_PKEY_CTX_set_params(dctx, params);
98 EVP_PKEY_derive_set_peer(dctx, peer_pub_key);
101 EVP_PKEY_derive(dctx, NULL, &secret_len);
104 EVP_PKEY_derive(dctx, secret, &secret_len);
107 EVP_PKEY_CTX_free(dctx);
/openssl/crypto/hmac/
H A Dhmac.c204 int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx) in HMAC_CTX_copy() argument
206 if (!hmac_ctx_alloc_mds(dctx)) in HMAC_CTX_copy()
208 if (!EVP_MD_CTX_copy_ex(dctx->i_ctx, sctx->i_ctx)) in HMAC_CTX_copy()
210 if (!EVP_MD_CTX_copy_ex(dctx->o_ctx, sctx->o_ctx)) in HMAC_CTX_copy()
212 if (!EVP_MD_CTX_copy_ex(dctx->md_ctx, sctx->md_ctx)) in HMAC_CTX_copy()
214 dctx->md = sctx->md; in HMAC_CTX_copy()
217 hmac_ctx_cleanup(dctx); in HMAC_CTX_copy()
/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 59 milliseconds

123