diff options
Diffstat (limited to 'sshkey.h')
-rw-r--r-- | sshkey.h | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshkey.h,v 1.15 2017/03/10 04:07:20 djm Exp $ */ | 1 | /* $OpenBSD: sshkey.h,v 1.21 2017/07/01 13:50:45 djm Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. | 4 | * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. |
@@ -46,14 +46,13 @@ | |||
46 | # define EC_POINT void | 46 | # define EC_POINT void |
47 | #endif /* WITH_OPENSSL */ | 47 | #endif /* WITH_OPENSSL */ |
48 | 48 | ||
49 | #define SSH_RSA_MINIMUM_MODULUS_SIZE 768 | 49 | #define SSH_RSA_MINIMUM_MODULUS_SIZE 1024 |
50 | #define SSH_KEY_MAX_SIGN_DATA_SIZE (1 << 20) | 50 | #define SSH_KEY_MAX_SIGN_DATA_SIZE (1 << 20) |
51 | 51 | ||
52 | struct sshbuf; | 52 | struct sshbuf; |
53 | 53 | ||
54 | /* Key types */ | 54 | /* Key types */ |
55 | enum sshkey_types { | 55 | enum sshkey_types { |
56 | KEY_RSA1, | ||
57 | KEY_RSA, | 56 | KEY_RSA, |
58 | KEY_DSA, | 57 | KEY_DSA, |
59 | KEY_ECDSA, | 58 | KEY_ECDSA, |
@@ -126,6 +125,7 @@ int sshkey_fingerprint_raw(const struct sshkey *k, | |||
126 | int, u_char **retp, size_t *lenp); | 125 | int, u_char **retp, size_t *lenp); |
127 | const char *sshkey_type(const struct sshkey *); | 126 | const char *sshkey_type(const struct sshkey *); |
128 | const char *sshkey_cert_type(const struct sshkey *); | 127 | const char *sshkey_cert_type(const struct sshkey *); |
128 | int sshkey_format_text(const struct sshkey *, struct sshbuf *); | ||
129 | int sshkey_write(const struct sshkey *, FILE *); | 129 | int sshkey_write(const struct sshkey *, FILE *); |
130 | int sshkey_read(struct sshkey *, char **); | 130 | int sshkey_read(struct sshkey *, char **); |
131 | u_int sshkey_size(const struct sshkey *); | 131 | u_int sshkey_size(const struct sshkey *); |
@@ -138,13 +138,19 @@ int sshkey_type_is_cert(int); | |||
138 | int sshkey_type_plain(int); | 138 | int sshkey_type_plain(int); |
139 | int sshkey_to_certified(struct sshkey *); | 139 | int sshkey_to_certified(struct sshkey *); |
140 | int sshkey_drop_cert(struct sshkey *); | 140 | int sshkey_drop_cert(struct sshkey *); |
141 | int sshkey_certify(struct sshkey *, struct sshkey *, const char *); | ||
142 | int sshkey_cert_copy(const struct sshkey *, struct sshkey *); | 141 | int sshkey_cert_copy(const struct sshkey *, struct sshkey *); |
143 | int sshkey_cert_check_authority(const struct sshkey *, int, int, | 142 | int sshkey_cert_check_authority(const struct sshkey *, int, int, |
144 | const char *, const char **); | 143 | const char *, const char **); |
145 | size_t sshkey_format_cert_validity(const struct sshkey_cert *, | 144 | size_t sshkey_format_cert_validity(const struct sshkey_cert *, |
146 | char *, size_t) __attribute__((__bounded__(__string__, 2, 3))); | 145 | char *, size_t) __attribute__((__bounded__(__string__, 2, 3))); |
147 | 146 | ||
147 | int sshkey_certify(struct sshkey *, struct sshkey *, const char *); | ||
148 | /* Variant allowing use of a custom signature function (e.g. for ssh-agent) */ | ||
149 | typedef int sshkey_certify_signer(const struct sshkey *, u_char **, size_t *, | ||
150 | const u_char *, size_t, const char *, u_int, void *); | ||
151 | int sshkey_certify_custom(struct sshkey *, struct sshkey *, const char *, | ||
152 | sshkey_certify_signer *, void *); | ||
153 | |||
148 | int sshkey_ecdsa_nid_from_name(const char *); | 154 | int sshkey_ecdsa_nid_from_name(const char *); |
149 | int sshkey_curve_name_to_nid(const char *); | 155 | int sshkey_curve_name_to_nid(const char *); |
150 | const char * sshkey_curve_nid_to_name(int); | 156 | const char * sshkey_curve_nid_to_name(int); |
@@ -186,13 +192,14 @@ int sshkey_private_deserialize(struct sshbuf *buf, struct sshkey **keyp); | |||
186 | int sshkey_private_to_fileblob(struct sshkey *key, struct sshbuf *blob, | 192 | int sshkey_private_to_fileblob(struct sshkey *key, struct sshbuf *blob, |
187 | const char *passphrase, const char *comment, | 193 | const char *passphrase, const char *comment, |
188 | int force_new_format, const char *new_format_cipher, int new_format_rounds); | 194 | int force_new_format, const char *new_format_cipher, int new_format_rounds); |
189 | int sshkey_parse_public_rsa1_fileblob(struct sshbuf *blob, | ||
190 | struct sshkey **keyp, char **commentp); | ||
191 | int sshkey_parse_private_fileblob(struct sshbuf *buffer, | 195 | int sshkey_parse_private_fileblob(struct sshbuf *buffer, |
192 | const char *passphrase, struct sshkey **keyp, char **commentp); | 196 | const char *passphrase, struct sshkey **keyp, char **commentp); |
193 | int sshkey_parse_private_fileblob_type(struct sshbuf *blob, int type, | 197 | int sshkey_parse_private_fileblob_type(struct sshbuf *blob, int type, |
194 | const char *passphrase, struct sshkey **keyp, char **commentp); | 198 | const char *passphrase, struct sshkey **keyp, char **commentp); |
195 | 199 | ||
200 | /* XXX should be internal, but used by ssh-keygen */ | ||
201 | int ssh_rsa_generate_additional_parameters(struct sshkey *); | ||
202 | |||
196 | #ifdef SSHKEY_INTERNAL | 203 | #ifdef SSHKEY_INTERNAL |
197 | int ssh_rsa_sign(const struct sshkey *key, | 204 | int ssh_rsa_sign(const struct sshkey *key, |
198 | u_char **sigp, size_t *lenp, const u_char *data, size_t datalen, | 205 | u_char **sigp, size_t *lenp, const u_char *data, size_t datalen, |