summaryrefslogtreecommitdiff
path: root/monitor.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 /monitor.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 'monitor.c')
-rw-r--r--monitor.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/monitor.c b/monitor.c
index d0ee4f7a6..f520c978f 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1185,7 +1185,7 @@ mm_answer_keyallowed(int sock, Buffer *m)
1185 Key *key; 1185 Key *key;
1186 char *cuser, *chost; 1186 char *cuser, *chost;
1187 u_char *blob; 1187 u_char *blob;
1188 u_int bloblen; 1188 u_int bloblen, pubkey_auth_attempt;
1189 enum mm_keytype type = 0; 1189 enum mm_keytype type = 0;
1190 int allowed = 0; 1190 int allowed = 0;
1191 1191
@@ -1195,6 +1195,7 @@ mm_answer_keyallowed(int sock, Buffer *m)
1195 cuser = buffer_get_string(m, NULL); 1195 cuser = buffer_get_string(m, NULL);
1196 chost = buffer_get_string(m, NULL); 1196 chost = buffer_get_string(m, NULL);
1197 blob = buffer_get_string(m, &bloblen); 1197 blob = buffer_get_string(m, &bloblen);
1198 pubkey_auth_attempt = buffer_get_int(m);
1198 1199
1199 key = key_from_blob(blob, bloblen); 1200 key = key_from_blob(blob, bloblen);
1200 1201
@@ -1220,7 +1221,8 @@ mm_answer_keyallowed(int sock, Buffer *m)
1220 pubkey_auth_attempt); 1221 pubkey_auth_attempt);
1221 pubkey_auth_info(authctxt, key, NULL); 1222 pubkey_auth_info(authctxt, key, NULL);
1222 auth_method = "publickey"; 1223 auth_method = "publickey";
1223 if (options.pubkey_authentication && allowed != 1) 1224 if (options.pubkey_authentication &&
1225 (!pubkey_auth_attempt || allowed != 1))
1224 auth_clear_options(); 1226 auth_clear_options();
1225 break; 1227 break;
1226 case MM_HOSTKEY: 1228 case MM_HOSTKEY: