diff options
author | delphij <delphij@FreeBSD.org> | 2015-08-25 20:48:44 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2015-08-25 20:48:44 +0000 |
commit | 67ce47d47b9defa5af5da7ba5ec561055100555c (patch) | |
tree | 8d73dd7cc30689a7d93566cf13cbe5f620ed4b9a /crypto/openssh | |
parent | 83154d3b5d0708d0a357c8164f40618335fcf6bc (diff) | |
download | FreeBSD-src-67ce47d47b9defa5af5da7ba5ec561055100555c.zip FreeBSD-src-67ce47d47b9defa5af5da7ba5ec561055100555c.tar.gz |
MFC: Fix OpenSSH multiple vulnerabilities.
Security: FreeBSD-SA-15:22.openssh
Diffstat (limited to 'crypto/openssh')
-rw-r--r-- | crypto/openssh/monitor.c | 6 | ||||
-rw-r--r-- | crypto/openssh/monitor_wrap.c | 1 | ||||
-rw-r--r-- | crypto/openssh/mux.c | 6 |
3 files changed, 7 insertions, 6 deletions
diff --git a/crypto/openssh/monitor.c b/crypto/openssh/monitor.c index 531c4f9..af63490 100644 --- a/crypto/openssh/monitor.c +++ b/crypto/openssh/monitor.c @@ -1027,9 +1027,7 @@ extern KbdintDevice sshpam_device; int mm_answer_pam_init_ctx(int sock, Buffer *m) { - debug3("%s", __func__); - authctxt->user = buffer_get_string(m, NULL); sshpam_ctxt = (sshpam_device.init_ctx)(authctxt); sshpam_authok = NULL; buffer_clear(m); @@ -1111,14 +1109,16 @@ mm_answer_pam_respond(int sock, Buffer *m) int mm_answer_pam_free_ctx(int sock, Buffer *m) { + int r = sshpam_authok != NULL && sshpam_authok == sshpam_ctxt; debug3("%s", __func__); (sshpam_device.free_ctx)(sshpam_ctxt); + sshpam_ctxt = sshpam_authok = NULL; buffer_clear(m); mm_request_send(sock, MONITOR_ANS_PAM_FREE_CTX, m); auth_method = "keyboard-interactive"; auth_submethod = "pam"; - return (sshpam_authok == sshpam_ctxt); + return r; } #endif diff --git a/crypto/openssh/monitor_wrap.c b/crypto/openssh/monitor_wrap.c index 1a47e41..b2bc8dd 100644 --- a/crypto/openssh/monitor_wrap.c +++ b/crypto/openssh/monitor_wrap.c @@ -820,7 +820,6 @@ mm_sshpam_init_ctx(Authctxt *authctxt) debug3("%s", __func__); buffer_init(&m); - buffer_put_cstring(&m, authctxt->user); mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PAM_INIT_CTX, &m); debug3("%s: waiting for MONITOR_ANS_PAM_INIT_CTX", __func__); mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PAM_INIT_CTX, &m); diff --git a/crypto/openssh/mux.c b/crypto/openssh/mux.c index f4edf55..e8700e1 100644 --- a/crypto/openssh/mux.c +++ b/crypto/openssh/mux.c @@ -633,7 +633,8 @@ process_mux_open_fwd(u_int rid, Channel *c, Buffer *m, Buffer *r) u_int lport, cport; int i, ret = 0, freefwd = 1; - fwd.listen_host = fwd.connect_host = NULL; + memset(&fwd, 0, sizeof(fwd)); + if (buffer_get_int_ret(&ftype, m) != 0 || (fwd.listen_host = buffer_get_string_ret(m, NULL)) == NULL || buffer_get_int_ret(&lport, m) != 0 || @@ -783,7 +784,8 @@ process_mux_close_fwd(u_int rid, Channel *c, Buffer *m, Buffer *r) int i, listen_port, ret = 0; u_int lport, cport; - fwd.listen_host = fwd.connect_host = NULL; + memset(&fwd, 0, sizeof(fwd)); + if (buffer_get_int_ret(&ftype, m) != 0 || (fwd.listen_host = buffer_get_string_ret(m, NULL)) == NULL || buffer_get_int_ret(&lport, m) != 0 || |