summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--auth-options.c9
-rw-r--r--auth-rhosts.c10
-rw-r--r--monitor.c17
-rw-r--r--monitor_wrap.c19
-rw-r--r--session.c4
-rw-r--r--sshd.c3
7 files changed, 16 insertions, 52 deletions
diff --git a/ChangeLog b/ChangeLog
index f80d79aa3..9afd093eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,12 @@
7 by permanently_set_uid. 7 by permanently_set_uid.
8 - (dtucker) [session.c] Also initialize creds to NULL for handing to 8 - (dtucker) [session.c] Also initialize creds to NULL for handing to
9 setpcred. 9 setpcred.
10 - (dtucker) OpenBSD CVS Sync
11 - dtucker@cvs.openbsd.org 2010/03/07 11:57:13
12 [auth-rhosts.c monitor.c monitor_wrap.c session.c auth-options.c sshd.c]
13 Hold authentication debug messages until after successful authentication.
14 Fixes an info leak of environment variables specified in authorized_keys,
15 reported by Jacob Appelbaum. ok djm@
10 16
1120100305 1720100305
12 - OpenBSD CVS Sync 18 - OpenBSD CVS Sync
diff --git a/auth-options.c b/auth-options.c
index bcf5589d7..129301765 100644
--- a/auth-options.c
+++ b/auth-options.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth-options.c,v 1.47 2010/03/04 23:27:25 djm Exp $ */ 1/* $OpenBSD: auth-options.c,v 1.48 2010/03/07 11:57:13 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -78,7 +78,6 @@ auth_clear_options(void)
78 } 78 }
79 forced_tun_device = -1; 79 forced_tun_device = -1;
80 channel_clear_permitted_opens(); 80 channel_clear_permitted_opens();
81 auth_debug_reset();
82} 81}
83 82
84/* 83/*
@@ -364,9 +363,6 @@ next_option:
364 /* Process the next option. */ 363 /* Process the next option. */
365 } 364 }
366 365
367 if (!use_privsep)
368 auth_debug_send();
369
370 /* grant access */ 366 /* grant access */
371 return 1; 367 return 1;
372 368
@@ -376,9 +372,6 @@ bad_option:
376 auth_debug_add("Bad options in %.100s file, line %lu: %.50s", 372 auth_debug_add("Bad options in %.100s file, line %lu: %.50s",
377 file, linenum, opts); 373 file, linenum, opts);
378 374
379 if (!use_privsep)
380 auth_debug_send();
381
382 /* deny access */ 375 /* deny access */
383 return 0; 376 return 0;
384} 377}
diff --git a/auth-rhosts.c b/auth-rhosts.c
index 5c1296701..06ae7f0b9 100644
--- a/auth-rhosts.c
+++ b/auth-rhosts.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth-rhosts.c,v 1.43 2008/06/13 14:18:51 dtucker Exp $ */ 1/* $OpenBSD: auth-rhosts.c,v 1.44 2010/03/07 11:57:13 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -317,11 +317,5 @@ int
317auth_rhosts2(struct passwd *pw, const char *client_user, const char *hostname, 317auth_rhosts2(struct passwd *pw, const char *client_user, const char *hostname,
318 const char *ipaddr) 318 const char *ipaddr)
319{ 319{
320 int ret; 320 return auth_rhosts2_raw(pw, client_user, hostname, ipaddr);
321
322 auth_debug_reset();
323 ret = auth_rhosts2_raw(pw, client_user, hostname, ipaddr);
324 if (!use_privsep)
325 auth_debug_send();
326 return ret;
327} 321}
diff --git a/monitor.c b/monitor.c
index f67cb7670..334aedde5 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor.c,v 1.105 2010/02/26 20:29:54 djm Exp $ */ 1/* $OpenBSD: monitor.c,v 1.106 2010/03/07 11:57:13 dtucker 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>
@@ -997,17 +997,6 @@ mm_answer_pam_free_ctx(int sock, Buffer *m)
997} 997}
998#endif 998#endif
999 999
1000static void
1001mm_append_debug(Buffer *m)
1002{
1003 if (auth_debug_init && buffer_len(&auth_debug)) {
1004 debug3("%s: Appending debug messages for child", __func__);
1005 buffer_append(m, buffer_ptr(&auth_debug),
1006 buffer_len(&auth_debug));
1007 buffer_clear(&auth_debug);
1008 }
1009}
1010
1011int 1000int
1012mm_answer_keyallowed(int sock, Buffer *m) 1001mm_answer_keyallowed(int sock, Buffer *m)
1013{ 1002{
@@ -1090,8 +1079,6 @@ mm_answer_keyallowed(int sock, Buffer *m)
1090 buffer_put_int(m, allowed); 1079 buffer_put_int(m, allowed);
1091 buffer_put_int(m, forced_command != NULL); 1080 buffer_put_int(m, forced_command != NULL);
1092 1081
1093 mm_append_debug(m);
1094
1095 mm_request_send(sock, MONITOR_ANS_KEYALLOWED, m); 1082 mm_request_send(sock, MONITOR_ANS_KEYALLOWED, m);
1096 1083
1097 if (type == MM_RSAHOSTKEY) 1084 if (type == MM_RSAHOSTKEY)
@@ -1475,8 +1462,6 @@ mm_answer_rsa_keyallowed(int sock, Buffer *m)
1475 if (key != NULL) 1462 if (key != NULL)
1476 key_free(key); 1463 key_free(key);
1477 1464
1478 mm_append_debug(m);
1479
1480 mm_request_send(sock, MONITOR_ANS_RSAKEYALLOWED, m); 1465 mm_request_send(sock, MONITOR_ANS_RSAKEYALLOWED, m);
1481 1466
1482 monitor_permit(mon_dispatch, MONITOR_REQ_RSACHALLENGE, allowed); 1467 monitor_permit(mon_dispatch, MONITOR_REQ_RSACHALLENGE, allowed);
diff --git a/monitor_wrap.c b/monitor_wrap.c
index b8e8710f7..faeb02cfa 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor_wrap.c,v 1.68 2009/06/22 05:39:28 dtucker Exp $ */ 1/* $OpenBSD: monitor_wrap.c,v 1.69 2010/03/07 11:57:13 dtucker 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>
@@ -347,19 +347,6 @@ mm_auth_rhosts_rsa_key_allowed(struct passwd *pw, char *user,
347 return (ret); 347 return (ret);
348} 348}
349 349
350static void
351mm_send_debug(Buffer *m)
352{
353 char *msg;
354
355 while (buffer_len(m)) {
356 msg = buffer_get_string(m, NULL);
357 debug3("%s: Sending debug: %s", __func__, msg);
358 packet_send_debug("%s", msg);
359 xfree(msg);
360 }
361}
362
363int 350int
364mm_key_allowed(enum mm_keytype type, char *user, char *host, Key *key) 351mm_key_allowed(enum mm_keytype type, char *user, char *host, Key *key)
365{ 352{
@@ -393,9 +380,6 @@ mm_key_allowed(enum mm_keytype type, char *user, char *host, Key *key)
393 have_forced = buffer_get_int(&m); 380 have_forced = buffer_get_int(&m);
394 forced_command = have_forced ? xstrdup("true") : NULL; 381 forced_command = have_forced ? xstrdup("true") : NULL;
395 382
396 /* Send potential debug messages */
397 mm_send_debug(&m);
398
399 buffer_free(&m); 383 buffer_free(&m);
400 384
401 return (allowed); 385 return (allowed);
@@ -1085,7 +1069,6 @@ mm_auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey)
1085 *rkey = key; 1069 *rkey = key;
1086 xfree(blob); 1070 xfree(blob);
1087 } 1071 }
1088 mm_send_debug(&m);
1089 buffer_free(&m); 1072 buffer_free(&m);
1090 1073
1091 return (allowed); 1074 return (allowed);
diff --git a/session.c b/session.c
index b384b7d86..639405fec 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: session.c,v 1.251 2010/01/12 08:33:17 dtucker Exp $ */ 1/* $OpenBSD: session.c,v 1.252 2010/03/07 11:57:13 dtucker Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved 4 * All rights reserved
@@ -271,6 +271,8 @@ do_authenticated(Authctxt *authctxt)
271 if (!no_port_forwarding_flag && options.allow_tcp_forwarding) 271 if (!no_port_forwarding_flag && options.allow_tcp_forwarding)
272 channel_permit_all_opens(); 272 channel_permit_all_opens();
273 273
274 auth_debug_send();
275
274 if (compat20) 276 if (compat20)
275 do_authenticated2(authctxt); 277 do_authenticated2(authctxt);
276 else 278 else
diff --git a/sshd.c b/sshd.c
index 0c3c04e4e..bc0d2753f 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshd.c,v 1.373 2010/02/26 20:29:54 djm Exp $ */ 1/* $OpenBSD: sshd.c,v 1.374 2010/03/07 11:57:13 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1939,6 +1939,7 @@ main(int ac, char **av)
1939 1939
1940 /* prepare buffer to collect messages to display to user after login */ 1940 /* prepare buffer to collect messages to display to user after login */
1941 buffer_init(&loginmsg); 1941 buffer_init(&loginmsg);
1942 auth_debug_reset();
1942 1943
1943 if (use_privsep) 1944 if (use_privsep)
1944 if (privsep_preauth(authctxt) == 1) 1945 if (privsep_preauth(authctxt) == 1)