summaryrefslogtreecommitdiff
path: root/monitor_wrap.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2015-08-19 17:00:17 +0100
committerColin Watson <cjwatson@debian.org>2015-08-19 17:00:17 +0100
commit544df7a04ae5b5c1fc30be7c445ad685d7a02dc9 (patch)
tree33d2a87dd50fe5894ac6ec4579c83401b7ab00a4 /monitor_wrap.c
parentbaccdb349b31c47cd76fb63211f754ed33a9707e (diff)
parent7de4b03a6e4071d454b72927ffaf52949fa34545 (diff)
Import openssh_6.9p1.orig.tar.gz
Diffstat (limited to 'monitor_wrap.c')
-rw-r--r--monitor_wrap.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/monitor_wrap.c b/monitor_wrap.c
index b379f0555..e6217b3d4 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor_wrap.c,v 1.84 2015/02/16 22:13:32 djm Exp $ */ 1/* $OpenBSD: monitor_wrap.c,v 1.85 2015/05/01 03:23:51 djm Exp $ */
2/* 2/*
3 * Copyright 2002 Niels Provos <provos@citi.umich.edu> 3 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
4 * Copyright 2002 Markus Friedl <markus@openbsd.org> 4 * Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -153,10 +153,8 @@ mm_request_receive(int sock, Buffer *m)
153 debug3("%s entering", __func__); 153 debug3("%s entering", __func__);
154 154
155 if (atomicio(read, sock, buf, sizeof(buf)) != sizeof(buf)) { 155 if (atomicio(read, sock, buf, sizeof(buf)) != sizeof(buf)) {
156 if (errno == EPIPE) { 156 if (errno == EPIPE)
157 error("%s: socket closed", __func__);
158 cleanup_exit(255); 157 cleanup_exit(255);
159 }
160 fatal("%s: read: %s", __func__, strerror(errno)); 158 fatal("%s: read: %s", __func__, strerror(errno));
161 } 159 }
162 msg_len = get_u32(buf); 160 msg_len = get_u32(buf);
@@ -373,16 +371,17 @@ mm_auth_password(Authctxt *authctxt, char *password)
373} 371}
374 372
375int 373int
376mm_user_key_allowed(struct passwd *pw, Key *key) 374mm_user_key_allowed(struct passwd *pw, Key *key, int pubkey_auth_attempt)
377{ 375{
378 return (mm_key_allowed(MM_USERKEY, NULL, NULL, key)); 376 return (mm_key_allowed(MM_USERKEY, NULL, NULL, key,
377 pubkey_auth_attempt));
379} 378}
380 379
381int 380int
382mm_hostbased_key_allowed(struct passwd *pw, char *user, char *host, 381mm_hostbased_key_allowed(struct passwd *pw, char *user, char *host,
383 Key *key) 382 Key *key)
384{ 383{
385 return (mm_key_allowed(MM_HOSTKEY, user, host, key)); 384 return (mm_key_allowed(MM_HOSTKEY, user, host, key, 0));
386} 385}
387 386
388int 387int
@@ -392,13 +391,14 @@ mm_auth_rhosts_rsa_key_allowed(struct passwd *pw, char *user,
392 int ret; 391 int ret;
393 392
394 key->type = KEY_RSA; /* XXX hack for key_to_blob */ 393 key->type = KEY_RSA; /* XXX hack for key_to_blob */
395 ret = mm_key_allowed(MM_RSAHOSTKEY, user, host, key); 394 ret = mm_key_allowed(MM_RSAHOSTKEY, user, host, key, 0);
396 key->type = KEY_RSA1; 395 key->type = KEY_RSA1;
397 return (ret); 396 return (ret);
398} 397}
399 398
400int 399int
401mm_key_allowed(enum mm_keytype type, char *user, char *host, Key *key) 400mm_key_allowed(enum mm_keytype type, char *user, char *host, Key *key,
401 int pubkey_auth_attempt)
402{ 402{
403 Buffer m; 403 Buffer m;
404 u_char *blob; 404 u_char *blob;
@@ -416,6 +416,7 @@ mm_key_allowed(enum mm_keytype type, char *user, char *host, Key *key)
416 buffer_put_cstring(&m, user ? user : ""); 416 buffer_put_cstring(&m, user ? user : "");
417 buffer_put_cstring(&m, host ? host : ""); 417 buffer_put_cstring(&m, host ? host : "");
418 buffer_put_string(&m, blob, len); 418 buffer_put_string(&m, blob, len);
419 buffer_put_int(&m, pubkey_auth_attempt);
419 free(blob); 420 free(blob);
420 421
421 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYALLOWED, &m); 422 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYALLOWED, &m);