Home
last modified time | relevance | path

Searched refs:dstctx (Results 1 – 15 of 15) sorted by relevance

/freebsd/crypto/openssl/providers/implementations/exchange/
H A Decx_exch.c154 PROV_ECX_CTX *dstctx; in ecx_dupctx() local
159 dstctx = OPENSSL_zalloc(sizeof(*srcctx)); in ecx_dupctx()
160 if (dstctx == NULL) in ecx_dupctx()
163 *dstctx = *srcctx; in ecx_dupctx()
164 if (dstctx->key != NULL && !ossl_ecx_key_up_ref(dstctx->key)) { in ecx_dupctx()
166 OPENSSL_free(dstctx); in ecx_dupctx()
170 if (dstctx->peerkey != NULL && !ossl_ecx_key_up_ref(dstctx->peerkey)) { in ecx_dupctx()
172 ossl_ecx_key_free(dstctx->key); in ecx_dupctx()
173 OPENSSL_free(dstctx); in ecx_dupctx()
177 return dstctx; in ecx_dupctx()
H A Dkdf_exch.c144 PROV_KDF_CTX *dstctx; in kdf_dupctx() local
149 dstctx = OPENSSL_zalloc(sizeof(*srcctx)); in kdf_dupctx()
150 if (dstctx == NULL) in kdf_dupctx()
153 *dstctx = *srcctx; in kdf_dupctx()
155 dstctx->kdfctx = EVP_KDF_CTX_dup(srcctx->kdfctx); in kdf_dupctx()
156 if (dstctx->kdfctx == NULL) { in kdf_dupctx()
157 OPENSSL_free(dstctx); in kdf_dupctx()
160 if (!ossl_kdf_data_up_ref(dstctx->kdfdata)) { in kdf_dupctx()
161 EVP_KDF_CTX_free(dstctx->kdfctx); in kdf_dupctx()
162 OPENSSL_free(dstctx); in kdf_dupctx()
[all …]
H A Ddh_exch.c292 PROV_DH_CTX *dstctx; in dh_dupctx() local
297 dstctx = OPENSSL_zalloc(sizeof(*srcctx)); in dh_dupctx()
298 if (dstctx == NULL) in dh_dupctx()
301 *dstctx = *srcctx; in dh_dupctx()
302 dstctx->dh = NULL; in dh_dupctx()
303 dstctx->dhpeer = NULL; in dh_dupctx()
304 dstctx->kdf_md = NULL; in dh_dupctx()
305 dstctx->kdf_ukm = NULL; in dh_dupctx()
306 dstctx->kdf_cekalg = NULL; in dh_dupctx()
311 dstctx->dh = srcctx->dh; in dh_dupctx()
[all …]
H A Decdh_exch.c190 PROV_ECDH_CTX *dstctx; in ecdh_dupctx() local
195 dstctx = OPENSSL_zalloc(sizeof(*srcctx)); in ecdh_dupctx()
196 if (dstctx == NULL) in ecdh_dupctx()
199 *dstctx = *srcctx; in ecdh_dupctx()
203 dstctx->k = NULL; in ecdh_dupctx()
204 dstctx->peerk = NULL; in ecdh_dupctx()
205 dstctx->kdf_md = NULL; in ecdh_dupctx()
206 dstctx->kdf_ukm = NULL; in ecdh_dupctx()
213 dstctx->k = srcctx->k; in ecdh_dupctx()
218 dstctx->peerk = srcctx->peerk; in ecdh_dupctx()
[all …]
/freebsd/crypto/openssl/providers/implementations/asymciphers/
H A Dsm2_enc.c135 PROV_SM2_CTX *dstctx; in sm2_dupctx() local
137 dstctx = OPENSSL_zalloc(sizeof(*srcctx)); in sm2_dupctx()
138 if (dstctx == NULL) in sm2_dupctx()
141 *dstctx = *srcctx; in sm2_dupctx()
142 memset(&dstctx->md, 0, sizeof(dstctx->md)); in sm2_dupctx()
144 if (dstctx->key != NULL && !EC_KEY_up_ref(dstctx->key)) { in sm2_dupctx()
145 OPENSSL_free(dstctx); in sm2_dupctx()
149 if (!ossl_prov_digest_copy(&dstctx->md, &srcctx->md)) { in sm2_dupctx()
150 sm2_freectx(dstctx); in sm2_dupctx()
154 return dstctx; in sm2_dupctx()
H A Drsa_enc.c334 PROV_RSA_CTX *dstctx; in rsa_dupctx() local
339 dstctx = OPENSSL_zalloc(sizeof(*srcctx)); in rsa_dupctx()
340 if (dstctx == NULL) in rsa_dupctx()
343 *dstctx = *srcctx; in rsa_dupctx()
344 if (dstctx->rsa != NULL && !RSA_up_ref(dstctx->rsa)) { in rsa_dupctx()
345 OPENSSL_free(dstctx); in rsa_dupctx()
349 if (dstctx->oaep_md != NULL && !EVP_MD_up_ref(dstctx->oaep_md)) { in rsa_dupctx()
350 RSA_free(dstctx->rsa); in rsa_dupctx()
351 OPENSSL_free(dstctx); in rsa_dupctx()
355 if (dstctx->mgf1_md != NULL && !EVP_MD_up_ref(dstctx->mgf1_md)) { in rsa_dupctx()
[all …]
/freebsd/crypto/openssl/providers/implementations/signature/
H A Dsm2_sig.c354 PROV_SM2_CTX *dstctx; in sm2sig_dupctx() local
356 dstctx = OPENSSL_zalloc(sizeof(*srcctx)); in sm2sig_dupctx()
357 if (dstctx == NULL) in sm2sig_dupctx()
360 *dstctx = *srcctx; in sm2sig_dupctx()
361 dstctx->ec = NULL; in sm2sig_dupctx()
362 dstctx->propq = NULL; in sm2sig_dupctx()
363 dstctx->md = NULL; in sm2sig_dupctx()
364 dstctx->mdctx = NULL; in sm2sig_dupctx()
365 dstctx->id = NULL; in sm2sig_dupctx()
369 dstctx->ec = srcctx->ec; in sm2sig_dupctx()
[all …]
H A Dmac_legacy_sig.c175 PROV_MAC_CTX *dstctx; in mac_dupctx() local
180 dstctx = OPENSSL_zalloc(sizeof(*srcctx)); in mac_dupctx()
181 if (dstctx == NULL) in mac_dupctx()
184 *dstctx = *srcctx; in mac_dupctx()
185 dstctx->propq = NULL; in mac_dupctx()
186 dstctx->key = NULL; in mac_dupctx()
187 dstctx->macctx = NULL; in mac_dupctx()
189 if (srcctx->propq != NULL && (dstctx->propq = OPENSSL_strdup(srcctx->propq)) == NULL) in mac_dupctx()
194 dstctx->key = srcctx->key; in mac_dupctx()
197 dstctx->macctx = EVP_MAC_CTX_dup(srcctx->macctx); in mac_dupctx()
[all …]
H A Ddsa_sig.c632 PROV_DSA_CTX *dstctx; in dsa_dupctx() local
637 if ((dstctx = OPENSSL_memdup(srcctx, sizeof(*srcctx))) == NULL) in dsa_dupctx()
640 dstctx->dsa = NULL; in dsa_dupctx()
641 dstctx->propq = NULL; in dsa_dupctx()
642 dstctx->md = NULL; in dsa_dupctx()
643 dstctx->mdctx = NULL; in dsa_dupctx()
644 dstctx->sig = NULL; in dsa_dupctx()
648 dstctx->dsa = srcctx->dsa; in dsa_dupctx()
652 dstctx->md = srcctx->md; in dsa_dupctx()
655 && (dstctx->mdctx = EVP_MD_CTX_dup(srcctx->mdctx)) == NULL) in dsa_dupctx()
[all …]
H A Decdsa_sig.c631 PROV_ECDSA_CTX *dstctx; local
637 || (dstctx = OPENSSL_memdup(srcctx, sizeof(*srcctx))) == NULL)
640 dstctx->ec = NULL;
641 dstctx->propq = NULL;
642 dstctx->md = NULL;
643 dstctx->mdctx = NULL;
644 dstctx->sig = NULL;
648 dstctx->ec = srcctx->ec;
652 dstctx->md = srcctx->md;
655 && ((dstctx->mdctx = EVP_MD_CTX_new()) == NULL
[all …]
H A Drsa_sig.c1355 PROV_RSA_CTX *dstctx; in rsa_dupctx() local
1360 dstctx = OPENSSL_zalloc(sizeof(*srcctx)); in rsa_dupctx()
1361 if (dstctx == NULL) in rsa_dupctx()
1364 *dstctx = *srcctx; in rsa_dupctx()
1365 dstctx->rsa = NULL; in rsa_dupctx()
1366 dstctx->md = NULL; in rsa_dupctx()
1367 dstctx->mgf1_md = NULL; in rsa_dupctx()
1368 dstctx->mdctx = NULL; in rsa_dupctx()
1369 dstctx->tbuf = NULL; in rsa_dupctx()
1370 dstctx->propq = NULL; in rsa_dupctx()
[all …]
H A Deddsa_sig.c756 PROV_EDDSA_CTX *dstctx; in eddsa_dupctx() local
761 dstctx = OPENSSL_zalloc(sizeof(*srcctx)); in eddsa_dupctx()
762 if (dstctx == NULL) in eddsa_dupctx()
765 *dstctx = *srcctx; in eddsa_dupctx()
766 dstctx->key = NULL; in eddsa_dupctx()
772 dstctx->key = srcctx->key; in eddsa_dupctx()
774 return dstctx; in eddsa_dupctx()
776 eddsa_freectx(dstctx); in eddsa_dupctx()
/freebsd/crypto/openssl/providers/implementations/kem/
H A Drsa_kem.c112 PROV_RSA_CTX *dstctx; in rsakem_dupctx() local
117 dstctx = OPENSSL_zalloc(sizeof(*srcctx)); in rsakem_dupctx()
118 if (dstctx == NULL) in rsakem_dupctx()
121 *dstctx = *srcctx; in rsakem_dupctx()
122 if (dstctx->rsa != NULL && !RSA_up_ref(dstctx->rsa)) { in rsakem_dupctx()
123 OPENSSL_free(dstctx); in rsakem_dupctx()
126 return dstctx; in rsakem_dupctx()
/freebsd/crypto/openssl/test/
H A Dtls-provider.c525 PROV_XORKEMKEX_CTX *dstctx; in xor_dupctx() local
527 dstctx = OPENSSL_zalloc(sizeof(*srcctx)); in xor_dupctx()
528 if (dstctx == NULL) in xor_dupctx()
531 *dstctx = *srcctx; in xor_dupctx()
533 return dstctx; in xor_dupctx()
2915 PROV_XORSIG_CTX *dstctx; in xor_sig_dupctx() local
2917 dstctx = OPENSSL_zalloc(sizeof(*srcctx)); in xor_sig_dupctx()
2918 if (dstctx == NULL) in xor_sig_dupctx()
2921 *dstctx = *srcctx; in xor_sig_dupctx()
2922 dstctx->sig = NULL; in xor_sig_dupctx()
[all …]
/freebsd/crypto/krb5/src/lib/krb5/krb/
H A Dpac.c1246 struct mspac_context *dstctx = (struct mspac_context *)dst_request_context; in mspac_copy() local
1249 assert(dstctx != NULL); in mspac_copy()
1250 assert(dstctx->pac == NULL); in mspac_copy()
1253 ret = copy_pac(context, srcctx->pac, &dstctx->pac); in mspac_copy()