summaryrefslogtreecommitdiff
path: root/usr.bin/ssh
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2010-12-03 23:55:28 +0000
committerDamien Miller <djm@cvs.openbsd.org>2010-12-03 23:55:28 +0000
commit054dc1c0cd58a51d35229b6bd5bd8cf4f60c342d (patch)
tree6236c4a79e954c40e8e0be9daf673950b2b27f83 /usr.bin/ssh
parent78ec72790eb553451566cbb3651f2c97848227b0 (diff)
move check for revoked keys to run earlier (in auth_rsa_key_allowed)
bz#1829; patch from ldv AT altlinux.org; ok markus@
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r--usr.bin/ssh/auth-rsa.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/ssh/auth-rsa.c b/usr.bin/ssh/auth-rsa.c
index 7d5261a768b..bc382037000 100644
--- a/usr.bin/ssh/auth-rsa.c
+++ b/usr.bin/ssh/auth-rsa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth-rsa.c,v 1.78 2010/07/13 23:13:16 djm Exp $ */
+/* $OpenBSD: auth-rsa.c,v 1.79 2010/12/03 23:55:27 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -91,9 +91,6 @@ auth_rsa_verify_response(Key *key, BIGNUM *challenge, u_char response[16])
MD5_CTX md;
int len;
- if (auth_key_is_revoked(key))
- return 0;
-
/* don't allow short keys */
if (BN_num_bits(key->rsa->n) < SSH_RSA_MINIMUM_MODULUS_SIZE) {
error("auth_rsa_verify_response: RSA modulus too small: %d < minimum %d bits",
@@ -246,6 +243,10 @@ auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey)
"actual %d vs. announced %d.",
file, linenum, BN_num_bits(key->rsa->n), bits);
+ /* Never accept a revoked key */
+ if (auth_key_is_revoked(key))
+ break;
+
/* We have found the desired key. */
/*
* If our options do not allow this key to be used,