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 64ff92885..d5cb640af 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -924,7 +924,7 @@ mm_ssh_gssapi_checkmic(Gssctxt *ctx, gss_buffer_t gssbuf, gss_buffer_t gssmic)
924} 924}
925 925
926int 926int
927mm_ssh_gssapi_userok(char *user) 927mm_ssh_gssapi_userok(char *user, struct passwd *pw)
928{ 928{
929 Buffer m; 929 Buffer m;
930 int authenticated = 0; 930 int authenticated = 0;
@@ -941,5 +941,50 @@ mm_ssh_gssapi_userok(char *user)
941 debug3("%s: user %sauthenticated",__func__, authenticated ? "" : "not "); 941 debug3("%s: user %sauthenticated",__func__, authenticated ? "" : "not ");
942 return (authenticated); 942 return (authenticated);
943} 943}
944
945OM_uint32
946mm_ssh_gssapi_sign(Gssctxt *ctx, gss_buffer_desc *data, gss_buffer_desc *hash)
947{
948 Buffer m;
949 OM_uint32 major;
950 u_int len;
951
952 buffer_init(&m);
953 buffer_put_string(&m, data->value, data->length);
954
955 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSSIGN, &m);
956 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSSIGN, &m);
957
958 major = buffer_get_int(&m);
959 hash->value = buffer_get_string(&m, &len);
960 hash->length = len;
961
962 buffer_free(&m);
963
964 return(major);
965}
966
967int
968mm_ssh_gssapi_update_creds(ssh_gssapi_ccache *store)
969{
970 Buffer m;
971 int ok;
972
973 buffer_init(&m);
974
975 buffer_put_cstring(&m, store->filename ? store->filename : "");
976 buffer_put_cstring(&m, store->envvar ? store->envvar : "");
977 buffer_put_cstring(&m, store->envval ? store->envval : "");
978
979 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSUPCREDS, &m);
980 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSUPCREDS, &m);
981
982 ok = buffer_get_int(&m);
983
984 buffer_free(&m);
985
986 return (ok);
987}
988
944#endif /* GSSAPI */ 989#endif /* GSSAPI */
945 990