summaryrefslogtreecommitdiff
path: root/monitor_wrap.c
diff options
context:
space:
mode:
authorSimon Wilkinson <simon@sxw.org.uk>2014-02-09 16:09:48 +0000
committerColin Watson <cjwatson@debian.org>2017-10-04 13:54:43 +0100
commit4e70490950e5c5134df48848affaf73685bf0284 (patch)
tree59de097e770693fb1f81268e85f7802df32cb58e /monitor_wrap.c
parent62f54f20bf351468e0124f63cc2902ee40d9b0e9 (diff)
GSSAPI key exchange support
This patch has been rejected upstream: "None of the OpenSSH developers are in favour of adding this, and this situation has not changed for several years. This is not a slight on Simon's patch, which is of fine quality, but just that a) we don't trust GSSAPI implementations that much and b) we don't like adding new KEX since they are pre-auth attack surface. This one is particularly scary, since it requires hooks out to typically root-owned system resources." However, quite a lot of people rely on this in Debian, and it's better to have it merged into the main openssh package rather than having separate -krb5 packages (as we used to have). It seems to have a generally good security history. Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1242 Last-Updated: 2017-10-04 Patch-Name: gssapi.patch
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 69212aaf3..0e171a6a6 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -937,7 +937,7 @@ mm_ssh_gssapi_checkmic(Gssctxt *ctx, gss_buffer_t gssbuf, gss_buffer_t gssmic)
937} 937}
938 938
939int 939int
940mm_ssh_gssapi_userok(char *user) 940mm_ssh_gssapi_userok(char *user, struct passwd *pw)
941{ 941{
942 Buffer m; 942 Buffer m;
943 int authenticated = 0; 943 int authenticated = 0;
@@ -954,5 +954,50 @@ mm_ssh_gssapi_userok(char *user)
954 debug3("%s: user %sauthenticated",__func__, authenticated ? "" : "not "); 954 debug3("%s: user %sauthenticated",__func__, authenticated ? "" : "not ");
955 return (authenticated); 955 return (authenticated);
956} 956}
957
958OM_uint32
959mm_ssh_gssapi_sign(Gssctxt *ctx, gss_buffer_desc *data, gss_buffer_desc *hash)
960{
961 Buffer m;
962 OM_uint32 major;
963 u_int len;
964
965 buffer_init(&m);
966 buffer_put_string(&m, data->value, data->length);
967
968 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSSIGN, &m);
969 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSSIGN, &m);
970
971 major = buffer_get_int(&m);
972 hash->value = buffer_get_string(&m, &len);
973 hash->length = len;
974
975 buffer_free(&m);
976
977 return(major);
978}
979
980int
981mm_ssh_gssapi_update_creds(ssh_gssapi_ccache *store)
982{
983 Buffer m;
984 int ok;
985
986 buffer_init(&m);
987
988 buffer_put_cstring(&m, store->filename ? store->filename : "");
989 buffer_put_cstring(&m, store->envvar ? store->envvar : "");
990 buffer_put_cstring(&m, store->envval ? store->envval : "");
991
992 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSUPCREDS, &m);
993 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSUPCREDS, &m);
994
995 ok = buffer_get_int(&m);
996
997 buffer_free(&m);
998
999 return (ok);
1000}
1001
957#endif /* GSSAPI */ 1002#endif /* GSSAPI */
958 1003