Lines Matching defs:from
119 int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from)
122 * Clean up legacy stuff from this function when legacy support is gone.
129 * If |to| is a legacy key and |from| isn't, we must make a downgraded
130 * copy of |from|. If that fails, this function fails.
132 if (evp_pkey_is_legacy(to) && evp_pkey_is_provided(from)) {
133 if (!evp_pkey_copy_downgraded(&downgraded_from, from))
135 from = downgraded_from;
142 * 1. If |to| is untyped, assign |from|'s key type to it.
143 * 2. If |to| contains a legacy key, compare its |type| to |from|'s.
144 * (|from| was already downgraded above)
151 if (evp_pkey_is_legacy(from)) {
152 if (EVP_PKEY_set_type(to, from->type) == 0)
155 if (EVP_PKEY_set_type_by_keymgmt(to, from->keymgmt) == 0)
159 if (to->type != from->type) {
165 if (EVP_PKEY_missing_parameters(from)) {
171 if (EVP_PKEY_parameters_eq(to, from) == 1)
179 if (to->keymgmt != NULL && from->keymgmt != NULL) {
180 ok = evp_keymgmt_util_copy(to, (EVP_PKEY *)from, SELECT_PARAMETERS);
185 * If |to| is provided, we know that |from| is legacy at this point.
186 * Try exporting |from| to |to|'s keymgmt, then use evp_keymgmt_dup()
194 evp_pkey_export_to_provider((EVP_PKEY *)from, NULL, &to_keymgmt,
211 if (from->ameth != NULL && from->ameth->param_copy != NULL)
212 ok = from->ameth->param_copy(to, from);
1610 * The error messages from pkey_set_type() are uninteresting here,
2126 /* Steal the legacy key reference from the temporary copy */