summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2008-05-26 22:16:40 +0000
committerColin Watson <cjwatson@debian.org>2008-05-26 22:16:40 +0000
commit93e9c23240b154d074dc33f26ccb23f8874f8c3a (patch)
tree2348f401a2148e4ea2e23e09c6ab1be5cf525003 /sshd.c
parent85825a2f1ca42576b0f9cd2b170314c107b9af26 (diff)
Refactor rejection of blacklisted user keys into a single
reject_blacklisted_key function in auth.c (thanks, Dmitry V. Levin).
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/sshd.c b/sshd.c
index df025906f..80cfd56d8 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1496,20 +1496,9 @@ main(int ac, char **av)
1496 1496
1497 for (i = 0; i < options.num_host_key_files; i++) { 1497 for (i = 0; i < options.num_host_key_files; i++) {
1498 key = key_load_private(options.host_key_files[i], "", NULL); 1498 key = key_load_private(options.host_key_files[i], "", NULL);
1499 if (key && blacklisted_key(key) == 1) { 1499 if (key && reject_blacklisted_key(key, 1) == 1) {
1500 char *fp; 1500 sensitive_data.host_keys[i] = NULL;
1501 fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); 1501 continue;
1502 if (options.permit_blacklisted_keys)
1503 error("Host key %s blacklisted (see "
1504 "ssh-vulnkey(1)); continuing anyway", fp);
1505 else
1506 error("Host key %s blacklisted (see "
1507 "ssh-vulnkey(1))", fp);
1508 xfree(fp);
1509 if (!options.permit_blacklisted_keys) {
1510 sensitive_data.host_keys[i] = NULL;
1511 continue;
1512 }
1513 } 1502 }
1514 sensitive_data.host_keys[i] = key; 1503 sensitive_data.host_keys[i] = key;
1515 if (key == NULL) { 1504 if (key == NULL) {