summaryrefslogtreecommitdiff
path: root/servconf.c
diff options
context:
space:
mode:
authorSimon Wilkinson <simon@sxw.org.uk>2014-02-09 16:09:48 +0000
committerColin Watson <cjwatson@debian.org>2018-04-03 08:20:56 +0100
commitcb427e23bf78d65407c78d868c4ef525dbfaa68f (patch)
tree595fd02db7d37d885ce1d309f50c6b9698ed4243 /servconf.c
parented6ae9c1a014a08ff5db3d768f01f2e427eeb476 (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 'servconf.c')
-rw-r--r--servconf.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/servconf.c b/servconf.c
index 0f0d09068..cbbea05bf 100644
--- a/servconf.c
+++ b/servconf.c
@@ -123,8 +123,10 @@ initialize_server_options(ServerOptions *options)
123 options->kerberos_ticket_cleanup = -1; 123 options->kerberos_ticket_cleanup = -1;
124 options->kerberos_get_afs_token = -1; 124 options->kerberos_get_afs_token = -1;
125 options->gss_authentication=-1; 125 options->gss_authentication=-1;
126 options->gss_keyex = -1;
126 options->gss_cleanup_creds = -1; 127 options->gss_cleanup_creds = -1;
127 options->gss_strict_acceptor = -1; 128 options->gss_strict_acceptor = -1;
129 options->gss_store_rekey = -1;
128 options->password_authentication = -1; 130 options->password_authentication = -1;
129 options->kbd_interactive_authentication = -1; 131 options->kbd_interactive_authentication = -1;
130 options->challenge_response_authentication = -1; 132 options->challenge_response_authentication = -1;
@@ -315,10 +317,14 @@ fill_default_server_options(ServerOptions *options)
315 options->kerberos_get_afs_token = 0; 317 options->kerberos_get_afs_token = 0;
316 if (options->gss_authentication == -1) 318 if (options->gss_authentication == -1)
317 options->gss_authentication = 0; 319 options->gss_authentication = 0;
320 if (options->gss_keyex == -1)
321 options->gss_keyex = 0;
318 if (options->gss_cleanup_creds == -1) 322 if (options->gss_cleanup_creds == -1)
319 options->gss_cleanup_creds = 1; 323 options->gss_cleanup_creds = 1;
320 if (options->gss_strict_acceptor == -1) 324 if (options->gss_strict_acceptor == -1)
321 options->gss_strict_acceptor = 1; 325 options->gss_strict_acceptor = 1;
326 if (options->gss_store_rekey == -1)
327 options->gss_store_rekey = 0;
322 if (options->password_authentication == -1) 328 if (options->password_authentication == -1)
323 options->password_authentication = 1; 329 options->password_authentication = 1;
324 if (options->kbd_interactive_authentication == -1) 330 if (options->kbd_interactive_authentication == -1)
@@ -461,6 +467,7 @@ typedef enum {
461 sHostKeyAlgorithms, 467 sHostKeyAlgorithms,
462 sClientAliveInterval, sClientAliveCountMax, sAuthorizedKeysFile, 468 sClientAliveInterval, sClientAliveCountMax, sAuthorizedKeysFile,
463 sGssAuthentication, sGssCleanupCreds, sGssStrictAcceptor, 469 sGssAuthentication, sGssCleanupCreds, sGssStrictAcceptor,
470 sGssKeyEx, sGssStoreRekey,
464 sAcceptEnv, sPermitTunnel, 471 sAcceptEnv, sPermitTunnel,
465 sMatch, sPermitOpen, sForceCommand, sChrootDirectory, 472 sMatch, sPermitOpen, sForceCommand, sChrootDirectory,
466 sUsePrivilegeSeparation, sAllowAgentForwarding, 473 sUsePrivilegeSeparation, sAllowAgentForwarding,
@@ -535,12 +542,20 @@ static struct {
535#ifdef GSSAPI 542#ifdef GSSAPI
536 { "gssapiauthentication", sGssAuthentication, SSHCFG_ALL }, 543 { "gssapiauthentication", sGssAuthentication, SSHCFG_ALL },
537 { "gssapicleanupcredentials", sGssCleanupCreds, SSHCFG_GLOBAL }, 544 { "gssapicleanupcredentials", sGssCleanupCreds, SSHCFG_GLOBAL },
545 { "gssapicleanupcreds", sGssCleanupCreds, SSHCFG_GLOBAL },
538 { "gssapistrictacceptorcheck", sGssStrictAcceptor, SSHCFG_GLOBAL }, 546 { "gssapistrictacceptorcheck", sGssStrictAcceptor, SSHCFG_GLOBAL },
547 { "gssapikeyexchange", sGssKeyEx, SSHCFG_GLOBAL },
548 { "gssapistorecredentialsonrekey", sGssStoreRekey, SSHCFG_GLOBAL },
539#else 549#else
540 { "gssapiauthentication", sUnsupported, SSHCFG_ALL }, 550 { "gssapiauthentication", sUnsupported, SSHCFG_ALL },
541 { "gssapicleanupcredentials", sUnsupported, SSHCFG_GLOBAL }, 551 { "gssapicleanupcredentials", sUnsupported, SSHCFG_GLOBAL },
552 { "gssapicleanupcreds", sUnsupported, SSHCFG_GLOBAL },
542 { "gssapistrictacceptorcheck", sUnsupported, SSHCFG_GLOBAL }, 553 { "gssapistrictacceptorcheck", sUnsupported, SSHCFG_GLOBAL },
554 { "gssapikeyexchange", sUnsupported, SSHCFG_GLOBAL },
555 { "gssapistorecredentialsonrekey", sUnsupported, SSHCFG_GLOBAL },
543#endif 556#endif
557 { "gssusesessionccache", sUnsupported, SSHCFG_GLOBAL },
558 { "gssapiusesessioncredcache", sUnsupported, SSHCFG_GLOBAL },
544 { "passwordauthentication", sPasswordAuthentication, SSHCFG_ALL }, 559 { "passwordauthentication", sPasswordAuthentication, SSHCFG_ALL },
545 { "kbdinteractiveauthentication", sKbdInteractiveAuthentication, SSHCFG_ALL }, 560 { "kbdinteractiveauthentication", sKbdInteractiveAuthentication, SSHCFG_ALL },
546 { "challengeresponseauthentication", sChallengeResponseAuthentication, SSHCFG_GLOBAL }, 561 { "challengeresponseauthentication", sChallengeResponseAuthentication, SSHCFG_GLOBAL },
@@ -1407,6 +1422,10 @@ process_server_config_line(ServerOptions *options, char *line,
1407 intptr = &options->gss_authentication; 1422 intptr = &options->gss_authentication;
1408 goto parse_flag; 1423 goto parse_flag;
1409 1424
1425 case sGssKeyEx:
1426 intptr = &options->gss_keyex;
1427 goto parse_flag;
1428
1410 case sGssCleanupCreds: 1429 case sGssCleanupCreds:
1411 intptr = &options->gss_cleanup_creds; 1430 intptr = &options->gss_cleanup_creds;
1412 goto parse_flag; 1431 goto parse_flag;
@@ -1415,6 +1434,10 @@ process_server_config_line(ServerOptions *options, char *line,
1415 intptr = &options->gss_strict_acceptor; 1434 intptr = &options->gss_strict_acceptor;
1416 goto parse_flag; 1435 goto parse_flag;
1417 1436
1437 case sGssStoreRekey:
1438 intptr = &options->gss_store_rekey;
1439 goto parse_flag;
1440
1418 case sPasswordAuthentication: 1441 case sPasswordAuthentication:
1419 intptr = &options->password_authentication; 1442 intptr = &options->password_authentication;
1420 goto parse_flag; 1443 goto parse_flag;
@@ -2453,7 +2476,10 @@ dump_config(ServerOptions *o)
2453#endif 2476#endif
2454#ifdef GSSAPI 2477#ifdef GSSAPI
2455 dump_cfg_fmtint(sGssAuthentication, o->gss_authentication); 2478 dump_cfg_fmtint(sGssAuthentication, o->gss_authentication);
2479 dump_cfg_fmtint(sGssKeyEx, o->gss_keyex);
2456 dump_cfg_fmtint(sGssCleanupCreds, o->gss_cleanup_creds); 2480 dump_cfg_fmtint(sGssCleanupCreds, o->gss_cleanup_creds);
2481 dump_cfg_fmtint(sGssStrictAcceptor, o->gss_strict_acceptor);
2482 dump_cfg_fmtint(sGssStoreRekey, o->gss_store_rekey);
2457#endif 2483#endif
2458 dump_cfg_fmtint(sPasswordAuthentication, o->password_authentication); 2484 dump_cfg_fmtint(sPasswordAuthentication, o->password_authentication);
2459 dump_cfg_fmtint(sKbdInteractiveAuthentication, 2485 dump_cfg_fmtint(sKbdInteractiveAuthentication,