1 /* $OpenBSD: monitor_wrap.c,v 1.99 2018/03/03 03:15:51 djm Exp $ */
3 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
4 * Copyright 2002 Markus Friedl <markus@openbsd.org>
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #include <sys/types.h>
42 #include <openssl/bn.h>
43 #include <openssl/dh.h>
44 #include <openssl/evp.h>
47 #include "openbsd-compat/sys-queue.h"
59 #include "auth-options.h"
64 #ifdef TARGET_OS_MAC /* XXX Broken krb5 headers on Mac */
67 #define TARGET_OS_MAC 1
75 #include "monitor_wrap.h"
77 #include "monitor_fdpass.h"
87 extern z_stream incoming_stream;
88 extern z_stream outgoing_stream;
89 extern struct monitor *pmonitor;
90 extern Buffer loginmsg;
91 extern ServerOptions options;
94 mm_log_handler(LogLevel level, const char *msg, void *ctx)
97 struct monitor *mon = (struct monitor *)ctx;
99 if (mon->m_log_sendfd == -1)
100 fatal("%s: no log channel", __func__);
102 buffer_init(&log_msg);
104 * Placeholder for packet length. Will be filled in with the actual
105 * packet length once the packet has been constucted. This saves
108 buffer_put_int(&log_msg, 0);
110 buffer_put_int(&log_msg, level);
111 buffer_put_cstring(&log_msg, msg);
112 put_u32(buffer_ptr(&log_msg), buffer_len(&log_msg) - 4);
113 if (atomicio(vwrite, mon->m_log_sendfd, buffer_ptr(&log_msg),
114 buffer_len(&log_msg)) != buffer_len(&log_msg))
115 fatal("%s: write: %s", __func__, strerror(errno));
116 buffer_free(&log_msg);
123 * m_pid is only set in the privileged part, and
124 * points to the unprivileged child.
126 return (pmonitor && pmonitor->m_pid > 0);
130 mm_request_send(int sock, enum monitor_reqtype type, Buffer *m)
132 u_int mlen = buffer_len(m);
135 debug3("%s entering: type %d", __func__, type);
137 put_u32(buf, mlen + 1);
138 buf[4] = (u_char) type; /* 1st byte of payload is mesg-type */
139 if (atomicio(vwrite, sock, buf, sizeof(buf)) != sizeof(buf))
140 fatal("%s: write: %s", __func__, strerror(errno));
141 if (atomicio(vwrite, sock, buffer_ptr(m), mlen) != mlen)
142 fatal("%s: write: %s", __func__, strerror(errno));
146 mm_request_receive(int sock, Buffer *m)
151 debug3("%s entering", __func__);
153 if (atomicio(read, sock, buf, sizeof(buf)) != sizeof(buf)) {
156 fatal("%s: read: %s", __func__, strerror(errno));
158 msg_len = get_u32(buf);
159 if (msg_len > 256 * 1024)
160 fatal("%s: read: bad msg_len %d", __func__, msg_len);
162 buffer_append_space(m, msg_len);
163 if (atomicio(read, sock, buffer_ptr(m), msg_len) != msg_len)
164 fatal("%s: read: %s", __func__, strerror(errno));
168 mm_request_receive_expect(int sock, enum monitor_reqtype type, Buffer *m)
172 debug3("%s entering: type %d", __func__, type);
174 mm_request_receive(sock, m);
175 rtype = buffer_get_char(m);
177 fatal("%s: read: rtype %d != type %d", __func__,
183 mm_choose_dh(int min, int nbits, int max)
190 buffer_put_int(&m, min);
191 buffer_put_int(&m, nbits);
192 buffer_put_int(&m, max);
194 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_MODULI, &m);
196 debug3("%s: waiting for MONITOR_ANS_MODULI", __func__);
197 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_MODULI, &m);
199 success = buffer_get_char(&m);
201 fatal("%s: MONITOR_ANS_MODULI failed", __func__);
203 if ((p = BN_new()) == NULL)
204 fatal("%s: BN_new failed", __func__);
205 if ((g = BN_new()) == NULL)
206 fatal("%s: BN_new failed", __func__);
207 buffer_get_bignum2(&m, p);
208 buffer_get_bignum2(&m, g);
210 debug3("%s: remaining %d", __func__, buffer_len(&m));
213 return (dh_new_group(g, p));
218 mm_key_sign(struct sshkey *key, u_char **sigp, u_int *lenp,
219 const u_char *data, u_int datalen, const char *hostkey_alg)
221 struct kex *kex = *pmonitor->m_pkex;
224 debug3("%s entering", __func__);
227 buffer_put_int(&m, kex->host_key_index(key, 0, active_state));
228 buffer_put_string(&m, data, datalen);
229 buffer_put_cstring(&m, hostkey_alg);
231 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SIGN, &m);
233 debug3("%s: waiting for MONITOR_ANS_SIGN", __func__);
234 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_SIGN, &m);
235 *sigp = buffer_get_string(&m, lenp);
242 mm_getpwnamallow(const char *username)
244 struct ssh *ssh = active_state; /* XXX */
248 ServerOptions *newopts;
250 debug3("%s entering", __func__);
253 buffer_put_cstring(&m, username);
255 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PWNAM, &m);
257 debug3("%s: waiting for MONITOR_ANS_PWNAM", __func__);
258 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PWNAM, &m);
260 if (buffer_get_char(&m) == 0) {
264 pw = buffer_get_string(&m, &len);
265 if (len != sizeof(struct passwd))
266 fatal("%s: struct passwd size mismatch", __func__);
267 pw->pw_name = buffer_get_string(&m, NULL);
268 pw->pw_passwd = buffer_get_string(&m, NULL);
269 #ifdef HAVE_STRUCT_PASSWD_PW_GECOS
270 pw->pw_gecos = buffer_get_string(&m, NULL);
272 #ifdef HAVE_STRUCT_PASSWD_PW_CLASS
273 pw->pw_class = buffer_get_string(&m, NULL);
275 pw->pw_dir = buffer_get_string(&m, NULL);
276 pw->pw_shell = buffer_get_string(&m, NULL);
279 /* copy options block as a Match directive may have changed some */
280 newopts = buffer_get_string(&m, &len);
281 if (len != sizeof(*newopts))
282 fatal("%s: option block size mismatch", __func__);
284 #define M_CP_STROPT(x) do { \
285 if (newopts->x != NULL) \
286 newopts->x = buffer_get_string(&m, NULL); \
288 #define M_CP_STRARRAYOPT(x, nx) do { \
289 newopts->x = newopts->nx == 0 ? \
290 NULL : xcalloc(newopts->nx, sizeof(*newopts->x)); \
291 for (i = 0; i < newopts->nx; i++) \
292 newopts->x[i] = buffer_get_string(&m, NULL); \
294 /* See comment in servconf.h */
295 COPY_MATCH_STRING_OPTS();
297 #undef M_CP_STRARRAYOPT
299 copy_set_server_options(&options, newopts, 1);
300 log_change_level(options.log_level);
301 process_permitopen(ssh, &options);
310 mm_auth2_read_banner(void)
315 debug3("%s entering", __func__);
318 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTH2_READ_BANNER, &m);
321 mm_request_receive_expect(pmonitor->m_recvfd,
322 MONITOR_ANS_AUTH2_READ_BANNER, &m);
323 banner = buffer_get_string(&m, NULL);
326 /* treat empty banner as missing banner */
327 if (strlen(banner) == 0) {
334 /* Inform the privileged process about service and style */
337 mm_inform_authserv(char *service, char *style)
341 debug3("%s entering", __func__);
344 buffer_put_cstring(&m, service);
345 buffer_put_cstring(&m, style ? style : "");
347 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHSERV, &m);
352 /* Do the password authentication */
354 mm_auth_password(struct ssh *ssh, char *password)
357 int authenticated = 0;
359 debug3("%s entering", __func__);
362 buffer_put_cstring(&m, password);
363 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHPASSWORD, &m);
365 debug3("%s: waiting for MONITOR_ANS_AUTHPASSWORD", __func__);
366 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_AUTHPASSWORD, &m);
368 authenticated = buffer_get_int(&m);
370 sshpam_set_maxtries_reached(buffer_get_int(&m));
375 debug3("%s: user %sauthenticated",
376 __func__, authenticated ? "" : "not ");
377 return (authenticated);
381 mm_user_key_allowed(struct ssh *ssh, struct passwd *pw, struct sshkey *key,
382 int pubkey_auth_attempt, struct sshauthopt **authoptp)
384 return (mm_key_allowed(MM_USERKEY, NULL, NULL, key,
385 pubkey_auth_attempt, authoptp));
389 mm_hostbased_key_allowed(struct passwd *pw, const char *user, const char *host,
392 return (mm_key_allowed(MM_HOSTKEY, user, host, key, 0, NULL));
396 mm_key_allowed(enum mm_keytype type, const char *user, const char *host,
397 struct sshkey *key, int pubkey_auth_attempt, struct sshauthopt **authoptp)
403 struct sshauthopt *opts = NULL;
405 debug3("%s entering", __func__);
407 if (authoptp != NULL)
410 /* Convert the key to a blob and the pass it over */
411 if (!key_to_blob(key, &blob, &len))
415 buffer_put_int(&m, type);
416 buffer_put_cstring(&m, user ? user : "");
417 buffer_put_cstring(&m, host ? host : "");
418 buffer_put_string(&m, blob, len);
419 buffer_put_int(&m, pubkey_auth_attempt);
422 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYALLOWED, &m);
424 debug3("%s: waiting for MONITOR_ANS_KEYALLOWED", __func__);
425 mm_request_receive_expect(pmonitor->m_recvfd,
426 MONITOR_ANS_KEYALLOWED, &m);
428 allowed = buffer_get_int(&m);
429 if (allowed && type == MM_USERKEY) {
430 if ((r = sshauthopt_deserialise(&m, &opts)) != 0)
431 fatal("%s: sshauthopt_deserialise: %s",
432 __func__, ssh_err(r));
436 if (authoptp != NULL) {
440 sshauthopt_free(opts);
446 * This key verify needs to send the key type along, because the
447 * privileged parent makes the decision if the key is allowed
448 * for authentication.
452 mm_sshkey_verify(const struct sshkey *key, const u_char *sig, size_t siglen,
453 const u_char *data, size_t datalen, const char *sigalg, u_int compat)
458 u_int encoded_ret = 0;
460 debug3("%s entering", __func__);
462 /* Convert the key to a blob and the pass it over */
463 if (!key_to_blob(key, &blob, &len))
467 buffer_put_string(&m, blob, len);
468 buffer_put_string(&m, sig, siglen);
469 buffer_put_string(&m, data, datalen);
470 buffer_put_cstring(&m, sigalg == NULL ? "" : sigalg);
473 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KEYVERIFY, &m);
475 debug3("%s: waiting for MONITOR_ANS_KEYVERIFY", __func__);
476 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_KEYVERIFY, &m);
478 encoded_ret = buffer_get_int(&m);
482 if (encoded_ret != 0)
483 return SSH_ERR_SIGNATURE_INVALID;
488 mm_send_keystate(struct monitor *monitor)
490 struct ssh *ssh = active_state; /* XXX */
494 if ((m = sshbuf_new()) == NULL)
495 fatal("%s: sshbuf_new failed", __func__);
496 if ((r = ssh_packet_get_state(ssh, m)) != 0)
497 fatal("%s: get_state failed: %s",
498 __func__, ssh_err(r));
499 mm_request_send(monitor->m_recvfd, MONITOR_REQ_KEYEXPORT, m);
500 debug3("%s: Finished sending state", __func__);
505 mm_pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, size_t namebuflen)
509 int success = 0, tmp1 = -1, tmp2 = -1;
511 /* Kludge: ensure there are fds free to receive the pty/tty */
512 if ((tmp1 = dup(pmonitor->m_recvfd)) == -1 ||
513 (tmp2 = dup(pmonitor->m_recvfd)) == -1) {
514 error("%s: cannot allocate fds for pty", __func__);
525 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PTY, &m);
527 debug3("%s: waiting for MONITOR_ANS_PTY", __func__);
528 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PTY, &m);
530 success = buffer_get_int(&m);
532 debug3("%s: pty alloc failed", __func__);
536 p = buffer_get_string(&m, NULL);
537 msg = buffer_get_string(&m, NULL);
540 strlcpy(namebuf, p, namebuflen); /* Possible truncation */
543 buffer_append(&loginmsg, msg, strlen(msg));
546 if ((*ptyfd = mm_receive_fd(pmonitor->m_recvfd)) == -1 ||
547 (*ttyfd = mm_receive_fd(pmonitor->m_recvfd)) == -1)
548 fatal("%s: receive fds failed", __func__);
555 mm_session_pty_cleanup2(Session *s)
562 buffer_put_cstring(&m, s->tty);
563 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PTYCLEANUP, &m);
566 /* closed dup'ed master */
567 if (s->ptymaster != -1 && close(s->ptymaster) < 0)
568 error("close(s->ptymaster/%d): %s",
569 s->ptymaster, strerror(errno));
571 /* unlink pty from session */
577 mm_start_pam(Authctxt *authctxt)
581 debug3("%s entering", __func__);
582 if (!options.use_pam)
583 fatal("UsePAM=no, but ended up in %s anyway", __func__);
586 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PAM_START, &m);
592 mm_do_pam_account(void)
598 debug3("%s entering", __func__);
599 if (!options.use_pam)
600 fatal("UsePAM=no, but ended up in %s anyway", __func__);
603 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PAM_ACCOUNT, &m);
605 mm_request_receive_expect(pmonitor->m_recvfd,
606 MONITOR_ANS_PAM_ACCOUNT, &m);
607 ret = buffer_get_int(&m);
608 msg = buffer_get_string(&m, NULL);
609 buffer_append(&loginmsg, msg, strlen(msg));
614 debug3("%s returning %d", __func__, ret);
620 mm_sshpam_init_ctx(Authctxt *authctxt)
625 debug3("%s", __func__);
627 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PAM_INIT_CTX, &m);
628 debug3("%s: waiting for MONITOR_ANS_PAM_INIT_CTX", __func__);
629 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PAM_INIT_CTX, &m);
630 success = buffer_get_int(&m);
632 debug3("%s: pam_init_ctx failed", __func__);
641 mm_sshpam_query(void *ctx, char **name, char **info,
642 u_int *num, char ***prompts, u_int **echo_on)
648 debug3("%s", __func__);
650 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PAM_QUERY, &m);
651 debug3("%s: waiting for MONITOR_ANS_PAM_QUERY", __func__);
652 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PAM_QUERY, &m);
653 ret = buffer_get_int(&m);
654 debug3("%s: pam_query returned %d", __func__, ret);
655 *name = buffer_get_string(&m, NULL);
656 *info = buffer_get_string(&m, NULL);
657 sshpam_set_maxtries_reached(buffer_get_int(&m));
658 *num = buffer_get_int(&m);
659 if (*num > PAM_MAX_NUM_MSG)
660 fatal("%s: recieved %u PAM messages, expected <= %u",
661 __func__, *num, PAM_MAX_NUM_MSG);
662 *prompts = xcalloc((*num + 1), sizeof(char *));
663 *echo_on = xcalloc((*num + 1), sizeof(u_int));
664 for (i = 0; i < *num; ++i) {
665 (*prompts)[i] = buffer_get_string(&m, NULL);
666 (*echo_on)[i] = buffer_get_int(&m);
673 mm_sshpam_respond(void *ctx, u_int num, char **resp)
679 debug3("%s", __func__);
681 buffer_put_int(&m, num);
682 for (i = 0; i < num; ++i)
683 buffer_put_cstring(&m, resp[i]);
684 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PAM_RESPOND, &m);
685 debug3("%s: waiting for MONITOR_ANS_PAM_RESPOND", __func__);
686 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PAM_RESPOND, &m);
687 ret = buffer_get_int(&m);
688 debug3("%s: pam_respond returned %d", __func__, ret);
694 mm_sshpam_free_ctx(void *ctxtp)
698 debug3("%s", __func__);
700 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PAM_FREE_CTX, &m);
701 debug3("%s: waiting for MONITOR_ANS_PAM_FREE_CTX", __func__);
702 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PAM_FREE_CTX, &m);
707 /* Request process termination */
715 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_TERM, &m);
720 mm_chall_setup(char **name, char **infotxt, u_int *numprompts,
721 char ***prompts, u_int **echo_on)
724 *infotxt = xstrdup("");
726 *prompts = xcalloc(*numprompts, sizeof(char *));
727 *echo_on = xcalloc(*numprompts, sizeof(u_int));
732 mm_bsdauth_query(void *ctx, char **name, char **infotxt,
733 u_int *numprompts, char ***prompts, u_int **echo_on)
739 debug3("%s: entering", __func__);
742 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_BSDAUTHQUERY, &m);
744 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_BSDAUTHQUERY,
746 success = buffer_get_int(&m);
748 debug3("%s: no challenge", __func__);
753 /* Get the challenge, and format the response */
754 challenge = buffer_get_string(&m, NULL);
757 mm_chall_setup(name, infotxt, numprompts, prompts, echo_on);
758 (*prompts)[0] = challenge;
760 debug3("%s: received challenge: %s", __func__, challenge);
766 mm_bsdauth_respond(void *ctx, u_int numresponses, char **responses)
771 debug3("%s: entering", __func__);
772 if (numresponses != 1)
776 buffer_put_cstring(&m, responses[0]);
777 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_BSDAUTHRESPOND, &m);
779 mm_request_receive_expect(pmonitor->m_recvfd,
780 MONITOR_ANS_BSDAUTHRESPOND, &m);
782 authok = buffer_get_int(&m);
785 return ((authok == 0) ? -1 : 0);
790 mm_skey_query(void *ctx, char **name, char **infotxt,
791 u_int *numprompts, char ***prompts, u_int **echo_on)
797 debug3("%s: entering", __func__);
800 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SKEYQUERY, &m);
802 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_SKEYQUERY,
804 success = buffer_get_int(&m);
806 debug3("%s: no challenge", __func__);
811 /* Get the challenge, and format the response */
812 challenge = buffer_get_string(&m, NULL);
815 debug3("%s: received challenge: %s", __func__, challenge);
817 mm_chall_setup(name, infotxt, numprompts, prompts, echo_on);
819 xasprintf(*prompts, "%s%s", challenge, SKEY_PROMPT);
826 mm_skey_respond(void *ctx, u_int numresponses, char **responses)
831 debug3("%s: entering", __func__);
832 if (numresponses != 1)
836 buffer_put_cstring(&m, responses[0]);
837 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_SKEYRESPOND, &m);
839 mm_request_receive_expect(pmonitor->m_recvfd,
840 MONITOR_ANS_SKEYRESPOND, &m);
842 authok = buffer_get_int(&m);
845 return ((authok == 0) ? -1 : 0);
849 #ifdef SSH_AUDIT_EVENTS
851 mm_audit_event(ssh_audit_event_t event)
855 debug3("%s entering", __func__);
858 buffer_put_int(&m, event);
860 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUDIT_EVENT, &m);
865 mm_audit_run_command(const char *command)
869 debug3("%s entering command %s", __func__, command);
872 buffer_put_cstring(&m, command);
874 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUDIT_COMMAND, &m);
877 #endif /* SSH_AUDIT_EVENTS */
881 mm_ssh_gssapi_server_ctx(Gssctxt **ctx, gss_OID goid)
886 /* Client doesn't get to see the context */
890 buffer_put_string(&m, goid->elements, goid->length);
892 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSSETUP, &m);
893 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSSETUP, &m);
895 major = buffer_get_int(&m);
902 mm_ssh_gssapi_accept_ctx(Gssctxt *ctx, gss_buffer_desc *in,
903 gss_buffer_desc *out, OM_uint32 *flags)
910 buffer_put_string(&m, in->value, in->length);
912 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSSTEP, &m);
913 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSSTEP, &m);
915 major = buffer_get_int(&m);
916 out->value = buffer_get_string(&m, &len);
919 *flags = buffer_get_int(&m);
927 mm_ssh_gssapi_checkmic(Gssctxt *ctx, gss_buffer_t gssbuf, gss_buffer_t gssmic)
933 buffer_put_string(&m, gssbuf->value, gssbuf->length);
934 buffer_put_string(&m, gssmic->value, gssmic->length);
936 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSCHECKMIC, &m);
937 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSCHECKMIC,
940 major = buffer_get_int(&m);
946 mm_ssh_gssapi_userok(char *user)
949 int authenticated = 0;
953 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSUSEROK, &m);
954 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSUSEROK,
957 authenticated = buffer_get_int(&m);
960 debug3("%s: user %sauthenticated",__func__, authenticated ? "" : "not ");
961 return (authenticated);