summaryrefslogtreecommitdiff
path: root/monitor_wrap.c
diff options
context:
space:
mode:
Diffstat (limited to 'monitor_wrap.c')
-rw-r--r--monitor_wrap.c45
1 files changed, 43 insertions, 2 deletions
diff --git a/monitor_wrap.c b/monitor_wrap.c
index edf2814e5..752af6f93 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -276,10 +276,10 @@ mm_auth2_read_banner(void)
276 return (banner); 276 return (banner);
277} 277}
278 278
279/* Inform the privileged process about service and style */ 279/* Inform the privileged process about service, style, and role */
280 280
281void 281void
282mm_inform_authserv(char *service, char *style) 282mm_inform_authserv(char *service, char *style, char *role)
283{ 283{
284 Buffer m; 284 Buffer m;
285 285
@@ -288,12 +288,30 @@ mm_inform_authserv(char *service, char *style)
288 buffer_init(&m); 288 buffer_init(&m);
289 buffer_put_cstring(&m, service); 289 buffer_put_cstring(&m, service);
290 buffer_put_cstring(&m, style ? style : ""); 290 buffer_put_cstring(&m, style ? style : "");
291 buffer_put_cstring(&m, role ? role : "");
291 292
292 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHSERV, &m); 293 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHSERV, &m);
293 294
294 buffer_free(&m); 295 buffer_free(&m);
295} 296}
296 297
298/* Inform the privileged process about role */
299
300void
301mm_inform_authrole(char *role)
302{
303 Buffer m;
304
305 debug3("%s entering", __func__);
306
307 buffer_init(&m);
308 buffer_put_cstring(&m, role ? role : "");
309
310 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_AUTHROLE, &m);
311
312 buffer_free(&m);
313}
314
297/* Do the password authentication */ 315/* Do the password authentication */
298int 316int
299mm_auth_password(Authctxt *authctxt, char *password) 317mm_auth_password(Authctxt *authctxt, char *password)
@@ -1236,4 +1254,27 @@ mm_ssh_gssapi_userok(char *user)
1236 debug3("%s: user %sauthenticated",__func__, authenticated ? "" : "not "); 1254 debug3("%s: user %sauthenticated",__func__, authenticated ? "" : "not ");
1237 return (authenticated); 1255 return (authenticated);
1238} 1256}
1257
1258OM_uint32
1259mm_ssh_gssapi_sign(Gssctxt *ctx, gss_buffer_desc *data, gss_buffer_desc *hash)
1260{
1261 Buffer m;
1262 OM_uint32 major;
1263 u_int len;
1264
1265 buffer_init(&m);
1266 buffer_put_string(&m, data->value, data->length);
1267
1268 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSSIGN, &m);
1269 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSSIGN, &m);
1270
1271 major = buffer_get_int(&m);
1272 hash->value = buffer_get_string(&m, &len);
1273 hash->length = len;
1274
1275 buffer_free(&m);
1276
1277 return(major);
1278}
1279
1239#endif /* GSSAPI */ 1280#endif /* GSSAPI */