summaryrefslogtreecommitdiff
path: root/krl.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2014-12-21 22:27:55 +0000
committerDamien Miller <djm@mindrot.org>2014-12-22 09:32:29 +1100
commit56d1c83cdd1ac76f1c6bd41e01e80dad834f3994 (patch)
tree700a872e702c686c1815bb1049eb93e88079b598 /krl.c
parent058f839fe15c51be8b3a844a76ab9a8db550be4f (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 'krl.c')
-rw-r--r--krl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/krl.c b/krl.c
index 5a5cdde02..3439e9c29 100644
--- a/krl.c
+++ b/krl.c
@@ -14,7 +14,7 @@
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */ 15 */
16 16
17/* $OpenBSD: krl.c,v 1.20 2014/12/04 01:49:59 djm Exp $ */ 17/* $OpenBSD: krl.c,v 1.21 2014/12/21 22:27:56 djm Exp $ */
18 18
19#include "includes.h" 19#include "includes.h"
20 20
@@ -36,6 +36,7 @@
36#include "misc.h" 36#include "misc.h"
37#include "log.h" 37#include "log.h"
38#include "ssherr.h" 38#include "ssherr.h"
39#include "digest.h"
39 40
40#include "krl.h" 41#include "krl.h"
41 42
@@ -411,7 +412,8 @@ ssh_krl_revoke_key_sha1(struct ssh_krl *krl, const struct sshkey *key)
411 int r; 412 int r;
412 413
413 debug3("%s: revoke type %s by sha1", __func__, sshkey_type(key)); 414 debug3("%s: revoke type %s by sha1", __func__, sshkey_type(key));
414 if ((r = sshkey_fingerprint_raw(key, SSH_FP_SHA1, &blob, &len)) != 0) 415 if ((r = sshkey_fingerprint_raw(key, SSH_DIGEST_SHA1,
416 &blob, &len)) != 0)
415 return r; 417 return r;
416 return revoke_blob(&krl->revoked_sha1s, blob, len); 418 return revoke_blob(&krl->revoked_sha1s, blob, len);
417} 419}
@@ -1151,7 +1153,7 @@ is_key_revoked(struct ssh_krl *krl, const struct sshkey *key)
1151 1153
1152 /* Check explicitly revoked hashes first */ 1154 /* Check explicitly revoked hashes first */
1153 memset(&rb, 0, sizeof(rb)); 1155 memset(&rb, 0, sizeof(rb));
1154 if ((r = sshkey_fingerprint_raw(key, SSH_FP_SHA1, 1156 if ((r = sshkey_fingerprint_raw(key, SSH_DIGEST_SHA1,
1155 &rb.blob, &rb.len)) != 0) 1157 &rb.blob, &rb.len)) != 0)
1156 return r; 1158 return r;
1157 erb = RB_FIND(revoked_blob_tree, &krl->revoked_sha1s, &rb); 1159 erb = RB_FIND(revoked_blob_tree, &krl->revoked_sha1s, &rb);