summaryrefslogtreecommitdiff
path: root/auth.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2013-01-18 11:44:04 +1100
committerDamien Miller <djm@mindrot.org>2013-01-18 11:44:04 +1100
commitf3747bf4014a450c9aaf1d88b010f6e579d10072 (patch)
tree0b1e1b497da13eb815e16a0f43be09e873e6a243 /auth.c
parentb26699bbadaffa1b1de2f6b0e175b77aba337de5 (diff)
- djm@cvs.openbsd.org 2013/01/17 23:00:01
[auth.c key.c key.h ssh-keygen.1 ssh-keygen.c sshd_config.5] [krl.c krl.h PROTOCOL.krl] add support for Key Revocation Lists (KRLs). These are a compact way to represent lists of revoked keys and certificates, taking as little as a single bit of incremental cost to revoke a certificate by serial number. KRLs are loaded via the existing RevokedKeys sshd_config option. feedback and ok markus@
Diffstat (limited to 'auth.c')
-rw-r--r--auth.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/auth.c b/auth.c
index f5e2d3d2e..d978f0271 100644
--- a/auth.c
+++ b/auth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth.c,v 1.99 2012/12/14 05:26:43 dtucker Exp $ */ 1/* $OpenBSD: auth.c,v 1.100 2013/01/17 23:00:01 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -71,6 +71,7 @@
71#endif 71#endif
72#include "authfile.h" 72#include "authfile.h"
73#include "monitor_wrap.h" 73#include "monitor_wrap.h"
74#include "krl.h"
74 75
75/* import */ 76/* import */
76extern ServerOptions options; 77extern ServerOptions options;
@@ -640,7 +641,16 @@ auth_key_is_revoked(Key *key)
640 641
641 if (options.revoked_keys_file == NULL) 642 if (options.revoked_keys_file == NULL)
642 return 0; 643 return 0;
643 644 switch (ssh_krl_file_contains_key(options.revoked_keys_file, key)) {
645 case 0:
646 return 0; /* Not revoked */
647 case -2:
648 break; /* Not a KRL */
649 default:
650 goto revoked;
651 }
652 debug3("%s: treating %s as a key list", __func__,
653 options.revoked_keys_file);
644 switch (key_in_file(key, options.revoked_keys_file, 0)) { 654 switch (key_in_file(key, options.revoked_keys_file, 0)) {
645 case 0: 655 case 0:
646 /* key not revoked */ 656 /* key not revoked */
@@ -651,6 +661,7 @@ auth_key_is_revoked(Key *key)
651 "authentication"); 661 "authentication");
652 return 1; 662 return 1;
653 case 1: 663 case 1:
664 revoked:
654 /* Key revoked */ 665 /* Key revoked */
655 key_fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); 666 key_fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX);
656 error("WARNING: authentication attempt with a revoked " 667 error("WARNING: authentication attempt with a revoked "