version 1.20, 2022/10/28 00:39:29 |
version 1.21, 2022/10/28 00:41:17 |
|
|
return 0; |
return 0; |
} |
} |
|
|
|
static int |
|
ssh_ecdsa_copy_public(const struct sshkey *from, struct sshkey *to) |
|
{ |
|
to->ecdsa_nid = from->ecdsa_nid; |
|
if ((to->ecdsa = EC_KEY_new_by_curve_name(from->ecdsa_nid)) == NULL) |
|
return SSH_ERR_ALLOC_FAIL; |
|
if (EC_KEY_set_public_key(to->ecdsa, |
|
EC_KEY_get0_public_key(from->ecdsa)) != 1) |
|
return SSH_ERR_LIBCRYPTO_ERROR; /* caller will free k->ecdsa */ |
|
return 0; |
|
} |
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
int |
int |
ssh_ecdsa_sign(const struct sshkey *key, u_char **sigp, size_t *lenp, |
ssh_ecdsa_sign(const struct sshkey *key, u_char **sigp, size_t *lenp, |
|
|
/* .equal = */ ssh_ecdsa_equal, |
/* .equal = */ ssh_ecdsa_equal, |
/* .ssh_serialize_public = */ ssh_ecdsa_serialize_public, |
/* .ssh_serialize_public = */ ssh_ecdsa_serialize_public, |
/* .generate = */ ssh_ecdsa_generate, |
/* .generate = */ ssh_ecdsa_generate, |
|
/* .copy_public = */ ssh_ecdsa_copy_public, |
}; |
}; |
|
|
const struct sshkey_impl sshkey_ecdsa_nistp256_impl = { |
const struct sshkey_impl sshkey_ecdsa_nistp256_impl = { |