diff options
author | djm@openbsd.org <djm@openbsd.org> | 2014-12-21 22:27:55 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2014-12-22 09:32:29 +1100 |
commit | 56d1c83cdd1ac76f1c6bd41e01e80dad834f3994 (patch) | |
tree | 700a872e702c686c1815bb1049eb93e88079b598 /sshkey.h | |
parent | 058f839fe15c51be8b3a844a76ab9a8db550be4f (diff) |
upstream commit
Add FingerprintHash option to control algorithm used for
key fingerprints. Default changes from MD5 to SHA256 and format from hex to
base64.
Feedback and ok naddy@ markus@
Diffstat (limited to 'sshkey.h')
-rw-r--r-- | sshkey.h | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshkey.h,v 1.1 2014/06/24 01:16:58 djm Exp $ */ | 1 | /* $OpenBSD: sshkey.h,v 1.2 2014/12/21 22:27:55 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. |
@@ -67,16 +67,14 @@ enum sshkey_types { | |||
67 | KEY_UNSPEC | 67 | KEY_UNSPEC |
68 | }; | 68 | }; |
69 | 69 | ||
70 | /* Fingerprint hash algorithms */ | 70 | /* Default fingerprint hash */ |
71 | enum sshkey_fp_type { | 71 | #define SSH_FP_HASH_DEFAULT SSH_DIGEST_SHA256 |
72 | SSH_FP_SHA1, | ||
73 | SSH_FP_MD5, | ||
74 | SSH_FP_SHA256 | ||
75 | }; | ||
76 | 72 | ||
77 | /* Fingerprint representation formats */ | 73 | /* Fingerprint representation formats */ |
78 | enum sshkey_fp_rep { | 74 | enum sshkey_fp_rep { |
75 | SSH_FP_DEFAULT = 0, | ||
79 | SSH_FP_HEX, | 76 | SSH_FP_HEX, |
77 | SSH_FP_BASE64, | ||
80 | SSH_FP_BUBBLEBABBLE, | 78 | SSH_FP_BUBBLEBABBLE, |
81 | SSH_FP_RANDOMART | 79 | SSH_FP_RANDOMART |
82 | }; | 80 | }; |
@@ -124,9 +122,9 @@ int sshkey_equal_public(const struct sshkey *, | |||
124 | const struct sshkey *); | 122 | const struct sshkey *); |
125 | int sshkey_equal(const struct sshkey *, const struct sshkey *); | 123 | int sshkey_equal(const struct sshkey *, const struct sshkey *); |
126 | char *sshkey_fingerprint(const struct sshkey *, | 124 | char *sshkey_fingerprint(const struct sshkey *, |
127 | enum sshkey_fp_type, enum sshkey_fp_rep); | 125 | int, enum sshkey_fp_rep); |
128 | int sshkey_fingerprint_raw(const struct sshkey *k, | 126 | int sshkey_fingerprint_raw(const struct sshkey *k, |
129 | enum sshkey_fp_type dgst_type, u_char **retp, size_t *lenp); | 127 | int, u_char **retp, size_t *lenp); |
130 | const char *sshkey_type(const struct sshkey *); | 128 | const char *sshkey_type(const struct sshkey *); |
131 | const char *sshkey_cert_type(const struct sshkey *); | 129 | const char *sshkey_cert_type(const struct sshkey *); |
132 | int sshkey_write(const struct sshkey *, FILE *); | 130 | int sshkey_write(const struct sshkey *, FILE *); |