diff options
Diffstat (limited to 'monitor_wrap.c')
-rw-r--r-- | monitor_wrap.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/monitor_wrap.c b/monitor_wrap.c index ee2dc2027..d9cbd9e32 100644 --- a/monitor_wrap.c +++ b/monitor_wrap.c | |||
@@ -25,7 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "includes.h" | 27 | #include "includes.h" |
28 | RCSID("$OpenBSD: monitor_wrap.c,v 1.35 2003/11/17 11:06:07 markus Exp $"); | 28 | RCSID("$OpenBSD: monitor_wrap.c,v 1.36 2004/06/21 17:36:31 avsm Exp $"); |
29 | 29 | ||
30 | #include <openssl/bn.h> | 30 | #include <openssl/bn.h> |
31 | #include <openssl/dh.h> | 31 | #include <openssl/dh.h> |
@@ -83,7 +83,7 @@ mm_is_monitor(void) | |||
83 | } | 83 | } |
84 | 84 | ||
85 | void | 85 | void |
86 | mm_request_send(int socket, enum monitor_reqtype type, Buffer *m) | 86 | mm_request_send(int sock, enum monitor_reqtype type, Buffer *m) |
87 | { | 87 | { |
88 | u_int mlen = buffer_len(m); | 88 | u_int mlen = buffer_len(m); |
89 | u_char buf[5]; | 89 | u_char buf[5]; |
@@ -92,14 +92,14 @@ mm_request_send(int socket, enum monitor_reqtype type, Buffer *m) | |||
92 | 92 | ||
93 | PUT_32BIT(buf, mlen + 1); | 93 | PUT_32BIT(buf, mlen + 1); |
94 | buf[4] = (u_char) type; /* 1st byte of payload is mesg-type */ | 94 | buf[4] = (u_char) type; /* 1st byte of payload is mesg-type */ |
95 | if (atomicio(vwrite, socket, buf, sizeof(buf)) != sizeof(buf)) | 95 | if (atomicio(vwrite, sock, buf, sizeof(buf)) != sizeof(buf)) |
96 | fatal("%s: write", __func__); | 96 | fatal("%s: write", __func__); |
97 | if (atomicio(vwrite, socket, buffer_ptr(m), mlen) != mlen) | 97 | if (atomicio(vwrite, sock, buffer_ptr(m), mlen) != mlen) |
98 | fatal("%s: write", __func__); | 98 | fatal("%s: write", __func__); |
99 | } | 99 | } |
100 | 100 | ||
101 | void | 101 | void |
102 | mm_request_receive(int socket, Buffer *m) | 102 | mm_request_receive(int sock, Buffer *m) |
103 | { | 103 | { |
104 | u_char buf[4]; | 104 | u_char buf[4]; |
105 | u_int msg_len; | 105 | u_int msg_len; |
@@ -107,7 +107,7 @@ mm_request_receive(int socket, Buffer *m) | |||
107 | 107 | ||
108 | debug3("%s entering", __func__); | 108 | debug3("%s entering", __func__); |
109 | 109 | ||
110 | res = atomicio(read, socket, buf, sizeof(buf)); | 110 | res = atomicio(read, sock, buf, sizeof(buf)); |
111 | if (res != sizeof(buf)) { | 111 | if (res != sizeof(buf)) { |
112 | if (res == 0) | 112 | if (res == 0) |
113 | cleanup_exit(255); | 113 | cleanup_exit(255); |
@@ -118,19 +118,19 @@ mm_request_receive(int socket, Buffer *m) | |||
118 | fatal("%s: read: bad msg_len %d", __func__, msg_len); | 118 | fatal("%s: read: bad msg_len %d", __func__, msg_len); |
119 | buffer_clear(m); | 119 | buffer_clear(m); |
120 | buffer_append_space(m, msg_len); | 120 | buffer_append_space(m, msg_len); |
121 | res = atomicio(read, socket, buffer_ptr(m), msg_len); | 121 | res = atomicio(read, sock, buffer_ptr(m), msg_len); |
122 | if (res != msg_len) | 122 | if (res != msg_len) |
123 | fatal("%s: read: %ld != msg_len", __func__, (long)res); | 123 | fatal("%s: read: %ld != msg_len", __func__, (long)res); |
124 | } | 124 | } |
125 | 125 | ||
126 | void | 126 | void |
127 | mm_request_receive_expect(int socket, enum monitor_reqtype type, Buffer *m) | 127 | mm_request_receive_expect(int sock, enum monitor_reqtype type, Buffer *m) |
128 | { | 128 | { |
129 | u_char rtype; | 129 | u_char rtype; |
130 | 130 | ||
131 | debug3("%s entering: type %d", __func__, type); | 131 | debug3("%s entering: type %d", __func__, type); |
132 | 132 | ||
133 | mm_request_receive(socket, m); | 133 | mm_request_receive(sock, m); |
134 | rtype = buffer_get_char(m); | 134 | rtype = buffer_get_char(m); |
135 | if (rtype != type) | 135 | if (rtype != type) |
136 | fatal("%s: read: rtype %d != type %d", __func__, | 136 | fatal("%s: read: rtype %d != type %d", __func__, |
@@ -544,7 +544,7 @@ mm_send_kex(Buffer *m, Kex *kex) | |||
544 | } | 544 | } |
545 | 545 | ||
546 | void | 546 | void |
547 | mm_send_keystate(struct monitor *pmonitor) | 547 | mm_send_keystate(struct monitor *monitor) |
548 | { | 548 | { |
549 | Buffer m; | 549 | Buffer m; |
550 | u_char *blob, *p; | 550 | u_char *blob, *p; |
@@ -580,7 +580,7 @@ mm_send_keystate(struct monitor *pmonitor) | |||
580 | goto skip; | 580 | goto skip; |
581 | } else { | 581 | } else { |
582 | /* Kex for rekeying */ | 582 | /* Kex for rekeying */ |
583 | mm_send_kex(&m, *pmonitor->m_pkex); | 583 | mm_send_kex(&m, *monitor->m_pkex); |
584 | } | 584 | } |
585 | 585 | ||
586 | debug3("%s: Sending new keys: %p %p", | 586 | debug3("%s: Sending new keys: %p %p", |
@@ -632,7 +632,7 @@ mm_send_keystate(struct monitor *pmonitor) | |||
632 | buffer_put_string(&m, buffer_ptr(&input), buffer_len(&input)); | 632 | buffer_put_string(&m, buffer_ptr(&input), buffer_len(&input)); |
633 | buffer_put_string(&m, buffer_ptr(&output), buffer_len(&output)); | 633 | buffer_put_string(&m, buffer_ptr(&output), buffer_len(&output)); |
634 | 634 | ||
635 | mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYEXPORT, &m); | 635 | mm_request_send(monitor->m_recvfd, MONITOR_REQ_KEYEXPORT, &m); |
636 | debug3("%s: Finished sending state", __func__); | 636 | debug3("%s: Finished sending state", __func__); |
637 | 637 | ||
638 | buffer_free(&m); | 638 | buffer_free(&m); |
@@ -1093,7 +1093,7 @@ mm_auth_rsa_verify_response(Key *key, BIGNUM *p, u_char response[16]) | |||
1093 | 1093 | ||
1094 | #ifdef GSSAPI | 1094 | #ifdef GSSAPI |
1095 | OM_uint32 | 1095 | OM_uint32 |
1096 | mm_ssh_gssapi_server_ctx(Gssctxt **ctx, gss_OID oid) | 1096 | mm_ssh_gssapi_server_ctx(Gssctxt **ctx, gss_OID goid) |
1097 | { | 1097 | { |
1098 | Buffer m; | 1098 | Buffer m; |
1099 | OM_uint32 major; | 1099 | OM_uint32 major; |
@@ -1102,7 +1102,7 @@ mm_ssh_gssapi_server_ctx(Gssctxt **ctx, gss_OID oid) | |||
1102 | *ctx = NULL; | 1102 | *ctx = NULL; |
1103 | 1103 | ||
1104 | buffer_init(&m); | 1104 | buffer_init(&m); |
1105 | buffer_put_string(&m, oid->elements, oid->length); | 1105 | buffer_put_string(&m, goid->elements, goid->length); |
1106 | 1106 | ||
1107 | mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSSETUP, &m); | 1107 | mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSSETUP, &m); |
1108 | mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSSETUP, &m); | 1108 | mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSSETUP, &m); |