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>2016-12-28 20:05:02 +0000
commit40ab38b3f501f3e21662f0294eef06789605c5f8 (patch)
tree739e0a31e245a718789908269c5af5807da13ef0 /monitor_wrap.c
parent971a7653746a6972b907dfe0ce139c06e4a6f482 (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: 2016-12-28 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 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