version 1.9, 2022/10/28 00:39:29 |
version 1.10, 2022/10/28 00:41:17 |
|
|
return 0; |
return 0; |
} |
} |
|
|
|
static int |
|
ssh_xmss_copy_public(const struct sshkey *from, struct sshkey *to) |
|
{ |
|
int r = SSH_ERR_INTERNAL_ERROR; |
|
u_int32_t left; |
|
size_t pklen; |
|
|
|
if ((r = sshkey_xmss_init(to, from->xmss_name)) != 0) |
|
return r; |
|
if (from->xmss_pk == NULL) |
|
return 0; /* XXX SSH_ERR_INTERNAL_ERROR ? */ |
|
|
|
if ((pklen = sshkey_xmss_pklen(from)) == 0 || |
|
sshkey_xmss_pklen(to) != pklen) |
|
return SSH_ERR_INTERNAL_ERROR; |
|
if ((to->xmss_pk = malloc(pklen)) == NULL) |
|
return SSH_ERR_ALLOC_FAIL; |
|
memcpy(to->xmss_pk, from->xmss_pk, pklen); |
|
/* simulate number of signatures left on pubkey */ |
|
left = sshkey_xmss_signatures_left(from); |
|
if (left) |
|
sshkey_xmss_enable_maxsign(to, left); |
|
return 0; |
|
} |
|
|
int |
int |
ssh_xmss_sign(const struct sshkey *key, u_char **sigp, size_t *lenp, |
ssh_xmss_sign(const struct sshkey *key, u_char **sigp, size_t *lenp, |
const u_char *data, size_t datalen, u_int compat) |
const u_char *data, size_t datalen, u_int compat) |
|
|
/* .equal = */ ssh_xmss_equal, |
/* .equal = */ ssh_xmss_equal, |
/* .ssh_serialize_public = */ ssh_xmss_serialize_public, |
/* .ssh_serialize_public = */ ssh_xmss_serialize_public, |
/* .generate = */ sshkey_xmss_generate_private_key, |
/* .generate = */ sshkey_xmss_generate_private_key, |
|
/* .copy_public = */ ssh_xmss_copy_public, |
}; |
}; |
|
|
const struct sshkey_impl sshkey_xmss_impl = { |
const struct sshkey_impl sshkey_xmss_impl = { |