diff options
author | Damien Miller <djm@mindrot.org> | 2004-01-21 11:02:50 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2004-01-21 11:02:50 +1100 |
commit | fb1310eded0788f106dc7e1f113cc75e1206cb60 (patch) | |
tree | cca2dacd20182354f8b704f62ab03a16a27a9e8f | |
parent | a04ad496f65ba1c0b6c71c13943ede2711464bc3 (diff) |
- markus@cvs.openbsd.org 2004/01/19 21:25:15
[auth2-hostbased.c auth2-pubkey.c serverloop.c ssh-keysign.c sshconnect2.c]
fix mem leaks; some fixes from Pete Flugstad; tested dtucker@
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | auth2-hostbased.c | 4 | ||||
-rw-r--r-- | auth2-pubkey.c | 6 | ||||
-rw-r--r-- | serverloop.c | 14 | ||||
-rw-r--r-- | ssh-keysign.c | 3 | ||||
-rw-r--r-- | sshconnect2.c | 8 |
6 files changed, 22 insertions, 18 deletions
@@ -20,6 +20,9 @@ | |||
20 | fake consumption for half closed channels since the peer is waiting for | 20 | fake consumption for half closed channels since the peer is waiting for |
21 | window adjust messages; bugzilla #790 Matthew Dillon; test + ok dtucker@ | 21 | window adjust messages; bugzilla #790 Matthew Dillon; test + ok dtucker@ |
22 | reproduce with sh -c 'ulimit -f 10; ssh host -n od /bsd | cat > foo' | 22 | reproduce with sh -c 'ulimit -f 10; ssh host -n od /bsd | cat > foo' |
23 | - markus@cvs.openbsd.org 2004/01/19 21:25:15 | ||
24 | [auth2-hostbased.c auth2-pubkey.c serverloop.c ssh-keysign.c sshconnect2.c] | ||
25 | fix mem leaks; some fixes from Pete Flugstad; tested dtucker@ | ||
23 | 26 | ||
24 | 20040114 | 27 | 20040114 |
25 | - (dtucker) [auth-pam.c] Have monitor die if PAM authentication thread exits | 28 | - (dtucker) [auth-pam.c] Have monitor die if PAM authentication thread exits |
@@ -1689,4 +1692,4 @@ | |||
1689 | - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. | 1692 | - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. |
1690 | Report from murple@murple.net, diagnosis from dtucker@zip.com.au | 1693 | Report from murple@murple.net, diagnosis from dtucker@zip.com.au |
1691 | 1694 | ||
1692 | $Id: ChangeLog,v 1.3174 2004/01/21 00:02:09 djm Exp $ | 1695 | $Id: ChangeLog,v 1.3175 2004/01/21 00:02:50 djm Exp $ |
diff --git a/auth2-hostbased.c b/auth2-hostbased.c index 505d3eff4..1111ed67a 100644 --- a/auth2-hostbased.c +++ b/auth2-hostbased.c | |||
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: auth2-hostbased.c,v 1.5 2003/06/24 08:23:46 markus Exp $"); | 26 | RCSID("$OpenBSD: auth2-hostbased.c,v 1.6 2004/01/19 21:25:15 markus Exp $"); |
27 | 27 | ||
28 | #include "ssh2.h" | 28 | #include "ssh2.h" |
29 | #include "xmalloc.h" | 29 | #include "xmalloc.h" |
@@ -114,7 +114,7 @@ userauth_hostbased(Authctxt *authctxt) | |||
114 | buffer_len(&b))) == 1) | 114 | buffer_len(&b))) == 1) |
115 | authenticated = 1; | 115 | authenticated = 1; |
116 | 116 | ||
117 | buffer_clear(&b); | 117 | buffer_free(&b); |
118 | done: | 118 | done: |
119 | debug2("userauth_hostbased: authenticated %d", authenticated); | 119 | debug2("userauth_hostbased: authenticated %d", authenticated); |
120 | if (key != NULL) | 120 | if (key != NULL) |
diff --git a/auth2-pubkey.c b/auth2-pubkey.c index c28571ab6..3063eecc3 100644 --- a/auth2-pubkey.c +++ b/auth2-pubkey.c | |||
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: auth2-pubkey.c,v 1.5 2003/11/04 08:54:09 djm Exp $"); | 26 | RCSID("$OpenBSD: auth2-pubkey.c,v 1.6 2004/01/19 21:25:15 markus Exp $"); |
27 | 27 | ||
28 | #include "ssh2.h" | 28 | #include "ssh2.h" |
29 | #include "xmalloc.h" | 29 | #include "xmalloc.h" |
@@ -123,9 +123,9 @@ userauth_pubkey(Authctxt *authctxt) | |||
123 | authenticated = 0; | 123 | authenticated = 0; |
124 | if (PRIVSEP(user_key_allowed(authctxt->pw, key)) && | 124 | if (PRIVSEP(user_key_allowed(authctxt->pw, key)) && |
125 | PRIVSEP(key_verify(key, sig, slen, buffer_ptr(&b), | 125 | PRIVSEP(key_verify(key, sig, slen, buffer_ptr(&b), |
126 | buffer_len(&b))) == 1) | 126 | buffer_len(&b))) == 1) |
127 | authenticated = 1; | 127 | authenticated = 1; |
128 | buffer_clear(&b); | 128 | buffer_free(&b); |
129 | xfree(sig); | 129 | xfree(sig); |
130 | } else { | 130 | } else { |
131 | debug("test whether pkalg/pkblob are acceptable"); | 131 | debug("test whether pkalg/pkblob are acceptable"); |
diff --git a/serverloop.c b/serverloop.c index bc7cd656a..a777a048d 100644 --- a/serverloop.c +++ b/serverloop.c | |||
@@ -35,7 +35,7 @@ | |||
35 | */ | 35 | */ |
36 | 36 | ||
37 | #include "includes.h" | 37 | #include "includes.h" |
38 | RCSID("$OpenBSD: serverloop.c,v 1.114 2003/12/09 15:28:43 markus Exp $"); | 38 | RCSID("$OpenBSD: serverloop.c,v 1.115 2004/01/19 21:25:15 markus Exp $"); |
39 | 39 | ||
40 | #include "xmalloc.h" | 40 | #include "xmalloc.h" |
41 | #include "packet.h" | 41 | #include "packet.h" |
@@ -850,7 +850,7 @@ server_input_window_size(int type, u_int32_t seq, void *ctxt) | |||
850 | } | 850 | } |
851 | 851 | ||
852 | static Channel * | 852 | static Channel * |
853 | server_request_direct_tcpip(char *ctype) | 853 | server_request_direct_tcpip(void) |
854 | { | 854 | { |
855 | Channel *c; | 855 | Channel *c; |
856 | int sock; | 856 | int sock; |
@@ -872,14 +872,14 @@ server_request_direct_tcpip(char *ctype) | |||
872 | xfree(originator); | 872 | xfree(originator); |
873 | if (sock < 0) | 873 | if (sock < 0) |
874 | return NULL; | 874 | return NULL; |
875 | c = channel_new(ctype, SSH_CHANNEL_CONNECTING, | 875 | c = channel_new("direct-tcpip", SSH_CHANNEL_CONNECTING, |
876 | sock, sock, -1, CHAN_TCP_WINDOW_DEFAULT, | 876 | sock, sock, -1, CHAN_TCP_WINDOW_DEFAULT, |
877 | CHAN_TCP_PACKET_DEFAULT, 0, "direct-tcpip", 1); | 877 | CHAN_TCP_PACKET_DEFAULT, 0, "direct-tcpip", 1); |
878 | return c; | 878 | return c; |
879 | } | 879 | } |
880 | 880 | ||
881 | static Channel * | 881 | static Channel * |
882 | server_request_session(char *ctype) | 882 | server_request_session(void) |
883 | { | 883 | { |
884 | Channel *c; | 884 | Channel *c; |
885 | 885 | ||
@@ -891,7 +891,7 @@ server_request_session(char *ctype) | |||
891 | * SSH_CHANNEL_LARVAL. Additionally, a callback for handling all | 891 | * SSH_CHANNEL_LARVAL. Additionally, a callback for handling all |
892 | * CHANNEL_REQUEST messages is registered. | 892 | * CHANNEL_REQUEST messages is registered. |
893 | */ | 893 | */ |
894 | c = channel_new(ctype, SSH_CHANNEL_LARVAL, | 894 | c = channel_new("session", SSH_CHANNEL_LARVAL, |
895 | -1, -1, -1, /*window size*/0, CHAN_SES_PACKET_DEFAULT, | 895 | -1, -1, -1, /*window size*/0, CHAN_SES_PACKET_DEFAULT, |
896 | 0, "server-session", 1); | 896 | 0, "server-session", 1); |
897 | if (session_open(the_authctxt, c->self) != 1) { | 897 | if (session_open(the_authctxt, c->self) != 1) { |
@@ -920,9 +920,9 @@ server_input_channel_open(int type, u_int32_t seq, void *ctxt) | |||
920 | ctype, rchan, rwindow, rmaxpack); | 920 | ctype, rchan, rwindow, rmaxpack); |
921 | 921 | ||
922 | if (strcmp(ctype, "session") == 0) { | 922 | if (strcmp(ctype, "session") == 0) { |
923 | c = server_request_session(ctype); | 923 | c = server_request_session(); |
924 | } else if (strcmp(ctype, "direct-tcpip") == 0) { | 924 | } else if (strcmp(ctype, "direct-tcpip") == 0) { |
925 | c = server_request_direct_tcpip(ctype); | 925 | c = server_request_direct_tcpip(); |
926 | } | 926 | } |
927 | if (c != NULL) { | 927 | if (c != NULL) { |
928 | debug("server_input_channel_open: confirm %s", ctype); | 928 | debug("server_input_channel_open: confirm %s", ctype); |
diff --git a/ssh-keysign.c b/ssh-keysign.c index b3db628c6..9e9ebe2f1 100644 --- a/ssh-keysign.c +++ b/ssh-keysign.c | |||
@@ -22,7 +22,7 @@ | |||
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
23 | */ | 23 | */ |
24 | #include "includes.h" | 24 | #include "includes.h" |
25 | RCSID("$OpenBSD: ssh-keysign.c,v 1.14 2003/11/17 09:45:39 djm Exp $"); | 25 | RCSID("$OpenBSD: ssh-keysign.c,v 1.15 2004/01/19 21:25:15 markus Exp $"); |
26 | 26 | ||
27 | #include <openssl/evp.h> | 27 | #include <openssl/evp.h> |
28 | #include <openssl/rand.h> | 28 | #include <openssl/rand.h> |
@@ -126,6 +126,7 @@ valid_request(struct passwd *pw, char *host, Key **ret, u_char *data, | |||
126 | /* end of message */ | 126 | /* end of message */ |
127 | if (buffer_len(&b) != 0) | 127 | if (buffer_len(&b) != 0) |
128 | fail++; | 128 | fail++; |
129 | buffer_free(&b); | ||
129 | 130 | ||
130 | debug3("valid_request: fail %d", fail); | 131 | debug3("valid_request: fail %d", fail); |
131 | 132 | ||
diff --git a/sshconnect2.c b/sshconnect2.c index 281fecdc9..3a218113c 100644 --- a/sshconnect2.c +++ b/sshconnect2.c | |||
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: sshconnect2.c,v 1.133 2003/11/21 11:57:03 djm Exp $"); | 26 | RCSID("$OpenBSD: sshconnect2.c,v 1.134 2004/01/19 21:25:15 markus Exp $"); |
27 | 27 | ||
28 | #include "openbsd-compat/sys-queue.h" | 28 | #include "openbsd-compat/sys-queue.h" |
29 | 29 | ||
@@ -1267,7 +1267,7 @@ ssh_keysign(Key *key, u_char **sigp, u_int *lenp, | |||
1267 | 1267 | ||
1268 | if (ssh_msg_recv(from[0], &b) < 0) { | 1268 | if (ssh_msg_recv(from[0], &b) < 0) { |
1269 | error("ssh_keysign: no reply"); | 1269 | error("ssh_keysign: no reply"); |
1270 | buffer_clear(&b); | 1270 | buffer_free(&b); |
1271 | return -1; | 1271 | return -1; |
1272 | } | 1272 | } |
1273 | close(from[0]); | 1273 | close(from[0]); |
@@ -1279,11 +1279,11 @@ ssh_keysign(Key *key, u_char **sigp, u_int *lenp, | |||
1279 | 1279 | ||
1280 | if (buffer_get_char(&b) != version) { | 1280 | if (buffer_get_char(&b) != version) { |
1281 | error("ssh_keysign: bad version"); | 1281 | error("ssh_keysign: bad version"); |
1282 | buffer_clear(&b); | 1282 | buffer_free(&b); |
1283 | return -1; | 1283 | return -1; |
1284 | } | 1284 | } |
1285 | *sigp = buffer_get_string(&b, lenp); | 1285 | *sigp = buffer_get_string(&b, lenp); |
1286 | buffer_clear(&b); | 1286 | buffer_free(&b); |
1287 | 1287 | ||
1288 | return 0; | 1288 | return 0; |
1289 | } | 1289 | } |