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 /key.c | |
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 'key.c')
-rw-r--r-- | key.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: key.c,v 1.123 2014/12/04 20:47:36 djm Exp $ */ | 1 | /* $OpenBSD: key.c,v 1.124 2014/12/21 22:27:56 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * placed in the public domain | 3 | * placed in the public domain |
4 | */ | 4 | */ |
@@ -40,8 +40,7 @@ key_new_private(int type) | |||
40 | } | 40 | } |
41 | 41 | ||
42 | u_char* | 42 | u_char* |
43 | key_fingerprint_raw(const Key *k, enum fp_type dgst_type, | 43 | key_fingerprint_raw(const Key *k, int dgst_alg, u_int *dgst_raw_length) |
44 | u_int *dgst_raw_length) | ||
45 | { | 44 | { |
46 | u_char *ret = NULL; | 45 | u_char *ret = NULL; |
47 | size_t dlen; | 46 | size_t dlen; |
@@ -49,7 +48,7 @@ key_fingerprint_raw(const Key *k, enum fp_type dgst_type, | |||
49 | 48 | ||
50 | if (dgst_raw_length != NULL) | 49 | if (dgst_raw_length != NULL) |
51 | *dgst_raw_length = 0; | 50 | *dgst_raw_length = 0; |
52 | if ((r = sshkey_fingerprint_raw(k, dgst_type, &ret, &dlen)) != 0) | 51 | if ((r = sshkey_fingerprint_raw(k, dgst_alg, &ret, &dlen)) != 0) |
53 | fatal("%s: %s", __func__, ssh_err(r)); | 52 | fatal("%s: %s", __func__, ssh_err(r)); |
54 | if (dlen > INT_MAX) | 53 | if (dlen > INT_MAX) |
55 | fatal("%s: giant len %zu", __func__, dlen); | 54 | fatal("%s: giant len %zu", __func__, dlen); |