summaryrefslogtreecommitdiff
path: root/sshkey.h
diff options
context:
space:
mode:
Diffstat (limited to 'sshkey.h')
-rw-r--r--sshkey.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/sshkey.h b/sshkey.h
index f91e4a081..b5d020cbf 100644
--- a/sshkey.h
+++ b/sshkey.h
@@ -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
52struct sshbuf; 52struct sshbuf;
53 53
54/* Key types */ 54/* Key types */
55enum sshkey_types { 55enum 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);
127const char *sshkey_type(const struct sshkey *); 126const char *sshkey_type(const struct sshkey *);
128const char *sshkey_cert_type(const struct sshkey *); 127const char *sshkey_cert_type(const struct sshkey *);
128int sshkey_format_text(const struct sshkey *, struct sshbuf *);
129int sshkey_write(const struct sshkey *, FILE *); 129int sshkey_write(const struct sshkey *, FILE *);
130int sshkey_read(struct sshkey *, char **); 130int sshkey_read(struct sshkey *, char **);
131u_int sshkey_size(const struct sshkey *); 131u_int sshkey_size(const struct sshkey *);
@@ -138,13 +138,19 @@ int sshkey_type_is_cert(int);
138int sshkey_type_plain(int); 138int sshkey_type_plain(int);
139int sshkey_to_certified(struct sshkey *); 139int sshkey_to_certified(struct sshkey *);
140int sshkey_drop_cert(struct sshkey *); 140int sshkey_drop_cert(struct sshkey *);
141int sshkey_certify(struct sshkey *, struct sshkey *, const char *);
142int sshkey_cert_copy(const struct sshkey *, struct sshkey *); 141int sshkey_cert_copy(const struct sshkey *, struct sshkey *);
143int sshkey_cert_check_authority(const struct sshkey *, int, int, 142int sshkey_cert_check_authority(const struct sshkey *, int, int,
144 const char *, const char **); 143 const char *, const char **);
145size_t sshkey_format_cert_validity(const struct sshkey_cert *, 144size_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
147int sshkey_certify(struct sshkey *, struct sshkey *, const char *);
148/* Variant allowing use of a custom signature function (e.g. for ssh-agent) */
149typedef int sshkey_certify_signer(const struct sshkey *, u_char **, size_t *,
150 const u_char *, size_t, const char *, u_int, void *);
151int sshkey_certify_custom(struct sshkey *, struct sshkey *, const char *,
152 sshkey_certify_signer *, void *);
153
148int sshkey_ecdsa_nid_from_name(const char *); 154int sshkey_ecdsa_nid_from_name(const char *);
149int sshkey_curve_name_to_nid(const char *); 155int sshkey_curve_name_to_nid(const char *);
150const char * sshkey_curve_nid_to_name(int); 156const char * sshkey_curve_nid_to_name(int);
@@ -186,13 +192,14 @@ int sshkey_private_deserialize(struct sshbuf *buf, struct sshkey **keyp);
186int sshkey_private_to_fileblob(struct sshkey *key, struct sshbuf *blob, 192int 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);
189int sshkey_parse_public_rsa1_fileblob(struct sshbuf *blob,
190 struct sshkey **keyp, char **commentp);
191int sshkey_parse_private_fileblob(struct sshbuf *buffer, 195int 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);
193int sshkey_parse_private_fileblob_type(struct sshbuf *blob, int type, 197int 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 */
201int ssh_rsa_generate_additional_parameters(struct sshkey *);
202
196#ifdef SSHKEY_INTERNAL 203#ifdef SSHKEY_INTERNAL
197int ssh_rsa_sign(const struct sshkey *key, 204int 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,