summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/monitor_wrap.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/ssh/monitor_wrap.c')
-rw-r--r--usr.bin/ssh/monitor_wrap.c88
1 files changed, 44 insertions, 44 deletions
diff --git a/usr.bin/ssh/monitor_wrap.c b/usr.bin/ssh/monitor_wrap.c
index 7d91c50090c..ea8b1624c3d 100644
--- a/usr.bin/ssh/monitor_wrap.c
+++ b/usr.bin/ssh/monitor_wrap.c
@@ -25,7 +25,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: monitor_wrap.c,v 1.6 2002/05/12 23:53:45 djm Exp $");
+RCSID("$OpenBSD: monitor_wrap.c,v 1.7 2002/05/15 15:47:49 mouring Exp $");
#include <openssl/bn.h>
#include <openssl/dh.h>
@@ -56,7 +56,7 @@ extern int compat20;
extern Newkeys *newkeys[];
extern z_stream incoming_stream;
extern z_stream outgoing_stream;
-extern struct monitor *monitor;
+extern struct monitor *pmonitor;
extern Buffer input, output;
void
@@ -126,10 +126,10 @@ mm_choose_dh(int min, int nbits, int max)
buffer_put_int(&m, nbits);
buffer_put_int(&m, max);
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_MODULI, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_MODULI, &m);
debug3("%s: waiting for MONITOR_ANS_MODULI", __FUNCTION__);
- mm_request_receive_expect(monitor->m_recvfd, MONITOR_ANS_MODULI, &m);
+ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_MODULI, &m);
success = buffer_get_char(&m);
if (success == 0)
@@ -151,7 +151,7 @@ mm_choose_dh(int min, int nbits, int max)
int
mm_key_sign(Key *key, u_char **sigp, u_int *lenp, u_char *data, u_int datalen)
{
- Kex *kex = *monitor->m_pkex;
+ Kex *kex = *pmonitor->m_pkex;
Buffer m;
debug3("%s entering", __FUNCTION__);
@@ -160,10 +160,10 @@ mm_key_sign(Key *key, u_char **sigp, u_int *lenp, u_char *data, u_int datalen)
buffer_put_int(&m, kex->host_key_index(key));
buffer_put_string(&m, data, datalen);
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_SIGN, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SIGN, &m);
debug3("%s: waiting for MONITOR_ANS_SIGN", __FUNCTION__);
- mm_request_receive_expect(monitor->m_recvfd, MONITOR_ANS_SIGN, &m);
+ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_SIGN, &m);
*sigp = buffer_get_string(&m, lenp);
buffer_free(&m);
@@ -182,10 +182,10 @@ mm_getpwnamallow(const char *login)
buffer_init(&m);
buffer_put_cstring(&m, login);
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_PWNAM, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PWNAM, &m);
debug3("%s: waiting for MONITOR_ANS_PWNAM", __FUNCTION__);
- mm_request_receive_expect(monitor->m_recvfd, MONITOR_ANS_PWNAM, &m);
+ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PWNAM, &m);
if (buffer_get_char(&m) == 0) {
buffer_free(&m);
@@ -213,10 +213,10 @@ char* mm_auth2_read_banner(void)
debug3("%s entering", __FUNCTION__);
buffer_init(&m);
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_AUTH2_READ_BANNER, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTH2_READ_BANNER, &m);
buffer_clear(&m);
- mm_request_receive_expect(monitor->m_recvfd, MONITOR_ANS_AUTH2_READ_BANNER, &m);
+ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUTH2_READ_BANNER, &m);
banner = buffer_get_string(&m, NULL);
buffer_free(&m);
@@ -236,7 +236,7 @@ mm_inform_authserv(char *service, char *style)
buffer_put_cstring(&m, service);
buffer_put_cstring(&m, style ? style : "");
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_AUTHSERV, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHSERV, &m);
buffer_free(&m);
}
@@ -252,10 +252,10 @@ mm_auth_password(Authctxt *authctxt, char *password)
buffer_init(&m);
buffer_put_cstring(&m, password);
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_AUTHPASSWORD, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHPASSWORD, &m);
debug3("%s: waiting for MONITOR_ANS_AUTHPASSWORD", __FUNCTION__);
- mm_request_receive_expect(monitor->m_recvfd, MONITOR_ANS_AUTHPASSWORD, &m);
+ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUTHPASSWORD, &m);
authenticated = buffer_get_int(&m);
@@ -325,10 +325,10 @@ mm_key_allowed(enum mm_keytype type, char *user, char *host, Key *key)
buffer_put_string(&m, blob, len);
xfree(blob);
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_KEYALLOWED, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYALLOWED, &m);
debug3("%s: waiting for MONITOR_ANS_KEYALLOWED", __FUNCTION__);
- mm_request_receive_expect(monitor->m_recvfd, MONITOR_ANS_KEYALLOWED, &m);
+ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_KEYALLOWED, &m);
allowed = buffer_get_int(&m);
@@ -366,10 +366,10 @@ mm_key_verify(Key *key, u_char *sig, u_int siglen, u_char *data, u_int datalen)
buffer_put_string(&m, data, datalen);
xfree(blob);
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_KEYVERIFY, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYVERIFY, &m);
debug3("%s: waiting for MONITOR_ANS_KEYVERIFY", __FUNCTION__);
- mm_request_receive_expect(monitor->m_recvfd, MONITOR_ANS_KEYVERIFY, &m);
+ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_KEYVERIFY, &m);
verified = buffer_get_int(&m);
@@ -508,7 +508,7 @@ mm_send_kex(Buffer *m, Kex *kex)
}
void
-mm_send_keystate(struct monitor *monitor)
+mm_send_keystate(struct monitor *pmonitor)
{
Buffer m;
u_char *blob, *p;
@@ -534,7 +534,7 @@ mm_send_keystate(struct monitor *monitor)
goto skip;
} else {
/* Kex for rekeying */
- mm_send_kex(&m, *monitor->m_pkex);
+ mm_send_kex(&m, *pmonitor->m_pkex);
}
debug3("%s: Sending new keys: %p %p",
@@ -580,7 +580,7 @@ mm_send_keystate(struct monitor *monitor)
buffer_put_string(&m, buffer_ptr(&input), buffer_len(&input));
buffer_put_string(&m, buffer_ptr(&output), buffer_len(&output));
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_KEYEXPORT, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYEXPORT, &m);
debug3("%s: Finished sending state", __FUNCTION__);
buffer_free(&m);
@@ -594,10 +594,10 @@ mm_pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen)
int success = 0;
buffer_init(&m);
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_PTY, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PTY, &m);
debug3("%s: waiting for MONITOR_ANS_PTY", __FUNCTION__);
- mm_request_receive_expect(monitor->m_recvfd, MONITOR_ANS_PTY, &m);
+ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PTY, &m);
success = buffer_get_int(&m);
if (success == 0) {
@@ -611,8 +611,8 @@ mm_pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen)
strlcpy(namebuf, p, namebuflen); /* Possible truncation */
xfree(p);
- *ptyfd = mm_receive_fd(monitor->m_recvfd);
- *ttyfd = mm_receive_fd(monitor->m_recvfd);
+ *ptyfd = mm_receive_fd(pmonitor->m_recvfd);
+ *ttyfd = mm_receive_fd(pmonitor->m_recvfd);
/* Success */
return (1);
@@ -628,7 +628,7 @@ mm_session_pty_cleanup2(void *session)
return;
buffer_init(&m);
buffer_put_cstring(&m, s->tty);
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_PTYCLEANUP, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PTYCLEANUP, &m);
buffer_free(&m);
/* closed dup'ed master */
@@ -647,7 +647,7 @@ mm_terminate(void)
Buffer m;
buffer_init(&m);
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_TERM, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_TERM, &m);
buffer_free(&m);
}
@@ -659,9 +659,9 @@ mm_ssh1_session_key(BIGNUM *num)
buffer_init(&m);
buffer_put_bignum2(&m, num);
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_SESSKEY, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SESSKEY, &m);
- mm_request_receive_expect(monitor->m_recvfd, MONITOR_ANS_SESSKEY, &m);
+ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_SESSKEY, &m);
rsafail = buffer_get_int(&m);
buffer_get_bignum2(&m, num);
@@ -694,9 +694,9 @@ mm_bsdauth_query(void *ctx, char **name, char **infotxt,
debug3("%s: entering", __FUNCTION__);
buffer_init(&m);
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_BSDAUTHQUERY, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_BSDAUTHQUERY, &m);
- mm_request_receive_expect(monitor->m_recvfd, MONITOR_ANS_BSDAUTHQUERY,
+ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_BSDAUTHQUERY,
&m);
res = buffer_get_int(&m);
if (res == -1) {
@@ -729,9 +729,9 @@ mm_bsdauth_respond(void *ctx, u_int numresponses, char **responses)
buffer_init(&m);
buffer_put_cstring(&m, responses[0]);
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_BSDAUTHRESPOND, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_BSDAUTHRESPOND, &m);
- mm_request_receive_expect(monitor->m_recvfd,
+ mm_request_receive_expect(pmonitor->m_recvfd,
MONITOR_ANS_BSDAUTHRESPOND, &m);
authok = buffer_get_int(&m);
@@ -751,9 +751,9 @@ mm_skey_query(void *ctx, char **name, char **infotxt,
debug3("%s: entering", __FUNCTION__);
buffer_init(&m);
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_SKEYQUERY, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SKEYQUERY, &m);
- mm_request_receive_expect(monitor->m_recvfd, MONITOR_ANS_SKEYQUERY,
+ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_SKEYQUERY,
&m);
res = buffer_get_int(&m);
if (res == -1) {
@@ -792,9 +792,9 @@ mm_skey_respond(void *ctx, u_int numresponses, char **responses)
buffer_init(&m);
buffer_put_cstring(&m, responses[0]);
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_SKEYRESPOND, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SKEYRESPOND, &m);
- mm_request_receive_expect(monitor->m_recvfd,
+ mm_request_receive_expect(pmonitor->m_recvfd,
MONITOR_ANS_SKEYRESPOND, &m);
authok = buffer_get_int(&m);
@@ -815,7 +815,7 @@ mm_ssh1_session_id(u_char session_id[16])
for (i = 0; i < 16; i++)
buffer_put_char(&m, session_id[i]);
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_SESSID, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SESSID, &m);
buffer_free(&m);
}
@@ -833,8 +833,8 @@ mm_auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey)
buffer_init(&m);
buffer_put_bignum2(&m, client_n);
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_RSAKEYALLOWED, &m);
- mm_request_receive_expect(monitor->m_recvfd, MONITOR_ANS_RSAKEYALLOWED, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_RSAKEYALLOWED, &m);
+ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_RSAKEYALLOWED, &m);
allowed = buffer_get_int(&m);
@@ -873,8 +873,8 @@ mm_auth_rsa_generate_challenge(Key *key)
buffer_put_string(&m, blob, blen);
xfree(blob);
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_RSACHALLENGE, &m);
- mm_request_receive_expect(monitor->m_recvfd, MONITOR_ANS_RSACHALLENGE, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_RSACHALLENGE, &m);
+ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_RSACHALLENGE, &m);
buffer_get_bignum2(&m, challenge);
buffer_free(&m);
@@ -902,8 +902,8 @@ mm_auth_rsa_verify_response(Key *key, BIGNUM *p, u_char response[16])
buffer_put_string(&m, response, 16);
xfree(blob);
- mm_request_send(monitor->m_recvfd, MONITOR_REQ_RSARESPONSE, &m);
- mm_request_receive_expect(monitor->m_recvfd, MONITOR_ANS_RSARESPONSE, &m);
+ mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_RSARESPONSE, &m);
+ mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_RSARESPONSE, &m);
success = buffer_get_int(&m);
buffer_free(&m);