Lines Matching refs:dest
106 EC_KEY *EC_KEY_copy(EC_KEY *dest, const EC_KEY *src) in EC_KEY_copy() argument
108 if (dest == NULL || src == NULL) { in EC_KEY_copy()
112 if (src->meth != dest->meth) { in EC_KEY_copy()
113 if (dest->meth->finish != NULL) in EC_KEY_copy()
114 dest->meth->finish(dest); in EC_KEY_copy()
115 if (dest->group && dest->group->meth->keyfinish) in EC_KEY_copy()
116 dest->group->meth->keyfinish(dest); in EC_KEY_copy()
118 if (ENGINE_finish(dest->engine) == 0) in EC_KEY_copy()
120 dest->engine = NULL; in EC_KEY_copy()
123 dest->libctx = src->libctx; in EC_KEY_copy()
127 EC_GROUP_free(dest->group); in EC_KEY_copy()
128 dest->group = ossl_ec_group_new_ex(src->libctx, src->propq, in EC_KEY_copy()
130 if (dest->group == NULL) in EC_KEY_copy()
132 if (!EC_GROUP_copy(dest->group, src->group)) in EC_KEY_copy()
137 EC_POINT_free(dest->pub_key); in EC_KEY_copy()
138 dest->pub_key = EC_POINT_new(src->group); in EC_KEY_copy()
139 if (dest->pub_key == NULL) in EC_KEY_copy()
141 if (!EC_POINT_copy(dest->pub_key, src->pub_key)) in EC_KEY_copy()
146 if (dest->priv_key == NULL) { in EC_KEY_copy()
147 dest->priv_key = BN_new(); in EC_KEY_copy()
148 if (dest->priv_key == NULL) in EC_KEY_copy()
151 if (!BN_copy(dest->priv_key, src->priv_key)) in EC_KEY_copy()
154 && src->group->meth->keycopy(dest, src) == 0) in EC_KEY_copy()
161 dest->enc_flag = src->enc_flag; in EC_KEY_copy()
162 dest->conv_form = src->conv_form; in EC_KEY_copy()
163 dest->version = src->version; in EC_KEY_copy()
164 dest->flags = src->flags; in EC_KEY_copy()
167 &dest->ex_data, &src->ex_data)) in EC_KEY_copy()
171 if (src->meth != dest->meth) { in EC_KEY_copy()
175 dest->engine = src->engine; in EC_KEY_copy()
177 dest->meth = src->meth; in EC_KEY_copy()
180 if (src->meth->copy != NULL && src->meth->copy(dest, src) == 0) in EC_KEY_copy()
183 dest->dirty_cnt++; in EC_KEY_copy()
185 return dest; in EC_KEY_copy()