summaryrefslogtreecommitdiff
path: root/monitor_wrap.c
diff options
context:
space:
mode:
Diffstat (limited to 'monitor_wrap.c')
-rw-r--r--monitor_wrap.c47
1 files changed, 46 insertions, 1 deletions
diff --git a/monitor_wrap.c b/monitor_wrap.c
index 9666bda4b..e749efc18 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -943,7 +943,7 @@ mm_ssh_gssapi_checkmic(Gssctxt *ctx, gss_buffer_t gssbuf, gss_buffer_t gssmic)
943} 943}
944 944
945int 945int
946mm_ssh_gssapi_userok(char *user) 946mm_ssh_gssapi_userok(char *user, struct passwd *pw)
947{ 947{
948 Buffer m; 948 Buffer m;
949 int authenticated = 0; 949 int authenticated = 0;
@@ -960,5 +960,50 @@ mm_ssh_gssapi_userok(char *user)
960 debug3("%s: user %sauthenticated",__func__, authenticated ? "" : "not "); 960 debug3("%s: user %sauthenticated",__func__, authenticated ? "" : "not ");
961 return (authenticated); 961 return (authenticated);
962} 962}
963
964OM_uint32
965mm_ssh_gssapi_sign(Gssctxt *ctx, gss_buffer_desc *data, gss_buffer_desc *hash)
966{
967 Buffer m;
968 OM_uint32 major;
969 u_int len;
970
971 buffer_init(&m);
972 buffer_put_string(&m, data->value, data->length);
973
974 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSSIGN, &m);
975 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSSIGN, &m);
976
977 major = buffer_get_int(&m);
978 hash->value = buffer_get_string(&m, &len);
979 hash->length = len;
980
981 buffer_free(&m);
982
983 return(major);
984}
985
986int
987mm_ssh_gssapi_update_creds(ssh_gssapi_ccache *store)
988{
989 Buffer m;
990 int ok;
991
992 buffer_init(&m);
993
994 buffer_put_cstring(&m, store->filename ? store->filename : "");
995 buffer_put_cstring(&m, store->envvar ? store->envvar : "");
996 buffer_put_cstring(&m, store->envval ? store->envval : "");
997
998 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSUPCREDS, &m);
999 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSUPCREDS, &m);
1000
1001 ok = buffer_get_int(&m);
1002
1003 buffer_free(&m);
1004
1005 return (ok);
1006}
1007
963#endif /* GSSAPI */ 1008#endif /* GSSAPI */
964 1009