version 1.17, 2022/10/28 00:43:08 |
version 1.18, 2022/10/28 00:44:17 |
|
|
} |
} |
|
|
static int |
static int |
|
ssh_ed25519_serialize_private(const struct sshkey *key, struct sshbuf *b, |
|
enum sshkey_serialize_rep opts) |
|
{ |
|
int r; |
|
|
|
if ((r = sshbuf_put_string(b, key->ed25519_pk, ED25519_PK_SZ)) != 0 || |
|
(r = sshbuf_put_string(b, key->ed25519_sk, ED25519_SK_SZ)) != 0) |
|
return r; |
|
|
|
return 0; |
|
} |
|
|
|
static int |
ssh_ed25519_generate(struct sshkey *k, int bits) |
ssh_ed25519_generate(struct sshkey *k, int bits) |
{ |
{ |
if ((k->ed25519_pk = malloc(ED25519_PK_SZ)) == NULL || |
if ((k->ed25519_pk = malloc(ED25519_PK_SZ)) == NULL || |
|
|
/* .equal = */ ssh_ed25519_equal, |
/* .equal = */ ssh_ed25519_equal, |
/* .ssh_serialize_public = */ ssh_ed25519_serialize_public, |
/* .ssh_serialize_public = */ ssh_ed25519_serialize_public, |
/* .ssh_deserialize_public = */ ssh_ed25519_deserialize_public, |
/* .ssh_deserialize_public = */ ssh_ed25519_deserialize_public, |
|
/* .ssh_serialize_private = */ ssh_ed25519_serialize_private, |
/* .generate = */ ssh_ed25519_generate, |
/* .generate = */ ssh_ed25519_generate, |
/* .copy_public = */ ssh_ed25519_copy_public, |
/* .copy_public = */ ssh_ed25519_copy_public, |
/* .sign = */ ssh_ed25519_sign, |
/* .sign = */ ssh_ed25519_sign, |