summaryrefslogtreecommitdiff
path: root/auth-krb5.c
diff options
context:
space:
mode:
authorSimon Wilkinson <simon@sxw.org.uk>2014-02-09 16:09:48 +0000
committerColin Watson <cjwatson@debian.org>2014-02-09 16:16:58 +0000
commit950be7e1b1a01ee9b25e2a72726a6370b8acacb6 (patch)
tree64829a84f903d7e2d3270c43e3f80df7db2a6a10 /auth-krb5.c
parentee196dab7c5f97f0b80c8099343a375bead92010 (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: 2013-11-09 Patch-Name: gssapi.patch
Diffstat (limited to 'auth-krb5.c')
-rw-r--r--auth-krb5.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/auth-krb5.c b/auth-krb5.c
index 7c83f597f..5613b5772 100644
--- a/auth-krb5.c
+++ b/auth-krb5.c
@@ -181,8 +181,13 @@ auth_krb5_password(Authctxt *authctxt, const char *password)
181 181
182 len = strlen(authctxt->krb5_ticket_file) + 6; 182 len = strlen(authctxt->krb5_ticket_file) + 6;
183 authctxt->krb5_ccname = xmalloc(len); 183 authctxt->krb5_ccname = xmalloc(len);
184#ifdef USE_CCAPI
185 snprintf(authctxt->krb5_ccname, len, "API:%s",
186 authctxt->krb5_ticket_file);
187#else
184 snprintf(authctxt->krb5_ccname, len, "FILE:%s", 188 snprintf(authctxt->krb5_ccname, len, "FILE:%s",
185 authctxt->krb5_ticket_file); 189 authctxt->krb5_ticket_file);
190#endif
186 191
187#ifdef USE_PAM 192#ifdef USE_PAM
188 if (options.use_pam) 193 if (options.use_pam)
@@ -239,15 +244,22 @@ krb5_cleanup_proc(Authctxt *authctxt)
239#ifndef HEIMDAL 244#ifndef HEIMDAL
240krb5_error_code 245krb5_error_code
241ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) { 246ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) {
242 int tmpfd, ret, oerrno; 247 int ret, oerrno;
243 char ccname[40]; 248 char ccname[40];
244 mode_t old_umask; 249 mode_t old_umask;
250#ifdef USE_CCAPI
251 char cctemplate[] = "API:krb5cc_%d";
252#else
253 char cctemplate[] = "FILE:/tmp/krb5cc_%d_XXXXXXXXXX";
254 int tmpfd;
255#endif
245 256
246 ret = snprintf(ccname, sizeof(ccname), 257 ret = snprintf(ccname, sizeof(ccname),
247 "FILE:/tmp/krb5cc_%d_XXXXXXXXXX", geteuid()); 258 cctemplate, geteuid());
248 if (ret < 0 || (size_t)ret >= sizeof(ccname)) 259 if (ret < 0 || (size_t)ret >= sizeof(ccname))
249 return ENOMEM; 260 return ENOMEM;
250 261
262#ifndef USE_CCAPI
251 old_umask = umask(0177); 263 old_umask = umask(0177);
252 tmpfd = mkstemp(ccname + strlen("FILE:")); 264 tmpfd = mkstemp(ccname + strlen("FILE:"));
253 oerrno = errno; 265 oerrno = errno;
@@ -264,6 +276,7 @@ ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) {
264 return oerrno; 276 return oerrno;
265 } 277 }
266 close(tmpfd); 278 close(tmpfd);
279#endif
267 280
268 return (krb5_cc_resolve(ctx, ccname, ccache)); 281 return (krb5_cc_resolve(ctx, ccname, ccache));
269} 282}