version 1.23, 2017/12/18 02:25:15 |
version 1.24, 2018/02/23 15:58:38 |
|
|
KEY_DSA_CERT, |
KEY_DSA_CERT, |
KEY_ECDSA_CERT, |
KEY_ECDSA_CERT, |
KEY_ED25519_CERT, |
KEY_ED25519_CERT, |
|
KEY_XMSS, |
|
KEY_XMSS_CERT, |
KEY_UNSPEC |
KEY_UNSPEC |
}; |
}; |
|
|
|
|
SSH_FP_RANDOMART |
SSH_FP_RANDOMART |
}; |
}; |
|
|
|
/* Private key serialisation formats, used on the wire */ |
|
enum sshkey_serialize_rep { |
|
SSHKEY_SERIALIZE_DEFAULT = 0, |
|
SSHKEY_SERIALIZE_STATE = 1, |
|
SSHKEY_SERIALIZE_FULL = 2, |
|
SSHKEY_SERIALIZE_INFO = 254, |
|
}; |
|
|
/* key is stored in external hardware */ |
/* key is stored in external hardware */ |
#define SSHKEY_FLAG_EXT 0x0001 |
#define SSHKEY_FLAG_EXT 0x0001 |
|
|
|
|
EC_KEY *ecdsa; |
EC_KEY *ecdsa; |
u_char *ed25519_sk; |
u_char *ed25519_sk; |
u_char *ed25519_pk; |
u_char *ed25519_pk; |
|
char *xmss_name; |
|
char *xmss_filename; /* for state file updates */ |
|
void *xmss_state; /* depends on xmss_name, opaque */ |
|
u_char *xmss_sk; |
|
u_char *xmss_pk; |
struct sshkey_cert *cert; |
struct sshkey_cert *cert; |
}; |
}; |
|
|
|
|
int sshkey_to_base64(const struct sshkey *, char **); |
int sshkey_to_base64(const struct sshkey *, char **); |
int sshkey_putb(const struct sshkey *, struct sshbuf *); |
int sshkey_putb(const struct sshkey *, struct sshbuf *); |
int sshkey_puts(const struct sshkey *, struct sshbuf *); |
int sshkey_puts(const struct sshkey *, struct sshbuf *); |
|
int sshkey_puts_opts(const struct sshkey *, struct sshbuf *, |
|
enum sshkey_serialize_rep); |
int sshkey_plain_to_blob(const struct sshkey *, u_char **, size_t *); |
int sshkey_plain_to_blob(const struct sshkey *, u_char **, size_t *); |
int sshkey_putb_plain(const struct sshkey *, struct sshbuf *); |
int sshkey_putb_plain(const struct sshkey *, struct sshbuf *); |
|
|
|
|
|
|
/* private key parsing and serialisation */ |
/* private key parsing and serialisation */ |
int sshkey_private_serialize(const struct sshkey *key, struct sshbuf *buf); |
int sshkey_private_serialize(const struct sshkey *key, struct sshbuf *buf); |
|
int sshkey_private_serialize_opt(const struct sshkey *key, struct sshbuf *buf, |
|
enum sshkey_serialize_rep); |
int sshkey_private_deserialize(struct sshbuf *buf, struct sshkey **keyp); |
int sshkey_private_deserialize(struct sshbuf *buf, struct sshkey **keyp); |
|
|
/* private key file format parsing and serialisation */ |
/* private key file format parsing and serialisation */ |
|
|
/* XXX should be internal, but used by ssh-keygen */ |
/* XXX should be internal, but used by ssh-keygen */ |
int ssh_rsa_generate_additional_parameters(struct sshkey *); |
int ssh_rsa_generate_additional_parameters(struct sshkey *); |
|
|
|
/* stateful keys (e.g. XMSS) */ |
|
typedef void sshkey_printfn(const char *, ...) __attribute__((format(printf, 1, 2))); |
|
int sshkey_set_filename(struct sshkey *, const char *); |
|
int sshkey_enable_maxsign(struct sshkey *, u_int32_t); |
|
u_int32_t sshkey_signatures_left(const struct sshkey *); |
|
int sshkey_forward_state(const struct sshkey *, u_int32_t, sshkey_printfn *); |
|
int sshkey_private_serialize_maxsign(const struct sshkey *key, struct sshbuf *buf, |
|
u_int32_t maxsign, sshkey_printfn *pr); |
|
|
#ifdef SSHKEY_INTERNAL |
#ifdef SSHKEY_INTERNAL |
int ssh_rsa_sign(const struct sshkey *key, |
int ssh_rsa_sign(const struct sshkey *key, |
u_char **sigp, size_t *lenp, const u_char *data, size_t datalen, |
u_char **sigp, size_t *lenp, const u_char *data, size_t datalen, |
|
|
int ssh_ed25519_sign(const struct sshkey *key, u_char **sigp, size_t *lenp, |
int ssh_ed25519_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); |
int ssh_ed25519_verify(const struct sshkey *key, |
int ssh_ed25519_verify(const struct sshkey *key, |
|
const u_char *signature, size_t signaturelen, |
|
const u_char *data, size_t datalen, u_int compat); |
|
int ssh_xmss_sign(const struct sshkey *key, u_char **sigp, size_t *lenp, |
|
const u_char *data, size_t datalen, u_int compat); |
|
int ssh_xmss_verify(const struct sshkey *key, |
const u_char *signature, size_t signaturelen, |
const u_char *signature, size_t signaturelen, |
const u_char *data, size_t datalen, u_int compat); |
const u_char *data, size_t datalen, u_int compat); |
#endif |
#endif |