summaryrefslogtreecommitdiff
path: root/auth-rsa.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 /auth-rsa.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 'auth-rsa.c')
-rw-r--r--auth-rsa.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/auth-rsa.c b/auth-rsa.c
index 898e9eb50..b7cbc0fe5 100644
--- a/auth-rsa.c
+++ b/auth-rsa.c
@@ -40,9 +40,7 @@
40#include "servconf.h" 40#include "servconf.h"
41#include "key.h" 41#include "key.h"
42#include "hostfile.h" 42#include "hostfile.h"
43#include "authfile.h"
44#include "auth.h" 43#include "auth.h"
45#include "canohost.h"
46#ifdef GSSAPI 44#ifdef GSSAPI
47#include "ssh-gss.h" 45#include "ssh-gss.h"
48#endif 46#endif
@@ -223,7 +221,6 @@ auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey)
223 char *cp; 221 char *cp;
224 char *key_options; 222 char *key_options;
225 int keybits; 223 int keybits;
226 char *fp;
227 224
228 /* Skip leading whitespace, empty and comment lines. */ 225 /* Skip leading whitespace, empty and comment lines. */
229 for (cp = line; *cp == ' ' || *cp == '\t'; cp++) 226 for (cp = line; *cp == ' ' || *cp == '\t'; cp++)
@@ -268,20 +265,8 @@ auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey)
268 "actual %d vs. announced %d.", 265 "actual %d vs. announced %d.",
269 file, linenum, BN_num_bits(key->rsa->n), bits); 266 file, linenum, BN_num_bits(key->rsa->n), bits);
270 267
271 if (blacklisted_key(key) == 1) { 268 if (reject_blacklisted_key(key, 0) == 1)
272 fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); 269 continue;
273 if (options.permit_blacklisted_keys)
274 logit("Public key %s from %s blacklisted (see "
275 "ssh-vulnkey(1)); continuing anyway",
276 fp, get_remote_ipaddr());
277 else
278 logit("Public key %s from %s blacklisted (see "
279 "ssh-vulnkey(1))",
280 fp, get_remote_ipaddr());
281 xfree(fp);
282 if (!options.permit_blacklisted_keys)
283 continue;
284 }
285 270
286 /* We have found the desired key. */ 271 /* We have found the desired key. */
287 /* 272 /*