summaryrefslogtreecommitdiff
path: root/auth2-pubkey.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2015-05-01 03:23:51 +0000
committerDamien Miller <djm@mindrot.org>2015-05-10 11:54:10 +1000
commit179be0f5e62f1f492462571944e45a3da660d82b (patch)
tree354cf8effdfb0db2f3f1573bc01544a54eb8cec0 /auth2-pubkey.c
parenta42d67be65b719a430b7fcaba2a4e4118382723a (diff)
upstream commit
prevent authorized_keys options picked up on public key tests without a corresponding private key authentication being applied to other authentication methods. Reported by halex@, ok markus@
Diffstat (limited to 'auth2-pubkey.c')
-rw-r--r--auth2-pubkey.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/auth2-pubkey.c b/auth2-pubkey.c
index e103b70af..f96e843c2 100644
--- a/auth2-pubkey.c
+++ b/auth2-pubkey.c
@@ -169,7 +169,7 @@ userauth_pubkey(Authctxt *authctxt)
169 169
170 /* test for correct signature */ 170 /* test for correct signature */
171 authenticated = 0; 171 authenticated = 0;
172 if (PRIVSEP(user_key_allowed(authctxt->pw, key)) && 172 if (PRIVSEP(user_key_allowed(authctxt->pw, key, 1)) &&
173 PRIVSEP(key_verify(key, sig, slen, buffer_ptr(&b), 173 PRIVSEP(key_verify(key, sig, slen, buffer_ptr(&b),
174 buffer_len(&b))) == 1) { 174 buffer_len(&b))) == 1) {
175 authenticated = 1; 175 authenticated = 1;
@@ -191,7 +191,7 @@ userauth_pubkey(Authctxt *authctxt)
191 * if a user is not allowed to login. is this an 191 * if a user is not allowed to login. is this an
192 * issue? -markus 192 * issue? -markus
193 */ 193 */
194 if (PRIVSEP(user_key_allowed(authctxt->pw, key))) { 194 if (PRIVSEP(user_key_allowed(authctxt->pw, key, 0))) {
195 packet_start(SSH2_MSG_USERAUTH_PK_OK); 195 packet_start(SSH2_MSG_USERAUTH_PK_OK);
196 packet_put_string(pkalg, alen); 196 packet_put_string(pkalg, alen);
197 packet_put_string(pkblob, blen); 197 packet_put_string(pkblob, blen);
@@ -671,7 +671,7 @@ user_key_command_allowed2(struct passwd *user_pw, Key *key)
671 * Check whether key authenticates and authorises the user. 671 * Check whether key authenticates and authorises the user.
672 */ 672 */
673int 673int
674user_key_allowed(struct passwd *pw, Key *key) 674user_key_allowed(struct passwd *pw, Key *key, int auth_attempt)
675{ 675{
676 u_int success, i; 676 u_int success, i;
677 char *file; 677 char *file;