summaryrefslogtreecommitdiff
path: root/servconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'servconf.c')
-rw-r--r--servconf.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/servconf.c b/servconf.c
index 8e69ea5ce..b90dba63b 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,5 +1,5 @@
1 1
2/* $OpenBSD: servconf.c,v 1.231 2012/10/30 21:29:54 djm Exp $ */ 2/* $OpenBSD: servconf.c,v 1.232 2012/11/04 11:09:15 djm Exp $ */
3/* 3/*
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5 * All rights reserved 5 * All rights reserved
@@ -48,6 +48,8 @@
48#include "groupaccess.h" 48#include "groupaccess.h"
49#include "canohost.h" 49#include "canohost.h"
50#include "packet.h" 50#include "packet.h"
51#include "hostfile.h"
52#include "auth.h"
51 53
52static void add_listen_addr(ServerOptions *, char *, int); 54static void add_listen_addr(ServerOptions *, char *, int);
53static void add_one_listen_addr(ServerOptions *, char *, int); 55static void add_one_listen_addr(ServerOptions *, char *, int);
@@ -332,6 +334,7 @@ typedef enum {
332 sRevokedKeys, sTrustedUserCAKeys, sAuthorizedPrincipalsFile, 334 sRevokedKeys, sTrustedUserCAKeys, sAuthorizedPrincipalsFile,
333 sKexAlgorithms, sIPQoS, sVersionAddendum, 335 sKexAlgorithms, sIPQoS, sVersionAddendum,
334 sAuthorizedKeysCommand, sAuthorizedKeysCommandUser, 336 sAuthorizedKeysCommand, sAuthorizedKeysCommandUser,
337 sAuthenticationMethods,
335 sDeprecated, sUnsupported 338 sDeprecated, sUnsupported
336} ServerOpCodes; 339} ServerOpCodes;
337 340
@@ -459,6 +462,7 @@ static struct {
459 { "authorizedkeyscommand", sAuthorizedKeysCommand, SSHCFG_ALL }, 462 { "authorizedkeyscommand", sAuthorizedKeysCommand, SSHCFG_ALL },
460 { "authorizedkeyscommanduser", sAuthorizedKeysCommandUser, SSHCFG_ALL }, 463 { "authorizedkeyscommanduser", sAuthorizedKeysCommandUser, SSHCFG_ALL },
461 { "versionaddendum", sVersionAddendum, SSHCFG_GLOBAL }, 464 { "versionaddendum", sVersionAddendum, SSHCFG_GLOBAL },
465 { "authenticationmethods", sAuthenticationMethods, SSHCFG_ALL },
462 { NULL, sBadOption, 0 } 466 { NULL, sBadOption, 0 }
463}; 467};
464 468
@@ -1522,6 +1526,24 @@ process_server_config_line(ServerOptions *options, char *line,
1522 *charptr = xstrdup(arg); 1526 *charptr = xstrdup(arg);
1523 break; 1527 break;
1524 1528
1529 case sAuthenticationMethods:
1530 if (*activep && options->num_auth_methods == 0) {
1531 while ((arg = strdelim(&cp)) && *arg != '\0') {
1532 if (options->num_auth_methods >=
1533 MAX_AUTH_METHODS)
1534 fatal("%s line %d: "
1535 "too many authentication methods.",
1536 filename, linenum);
1537 if (auth2_methods_valid(arg, 0) != 0)
1538 fatal("%s line %d: invalid "
1539 "authentication method list.",
1540 filename, linenum);
1541 options->auth_methods[
1542 options->num_auth_methods++] = xstrdup(arg);
1543 }
1544 }
1545 return 0;
1546
1525 case sDeprecated: 1547 case sDeprecated:
1526 logit("%s line %d: Deprecated option %s", 1548 logit("%s line %d: Deprecated option %s",
1527 filename, linenum, arg); 1549 filename, linenum, arg);
@@ -1953,6 +1975,8 @@ dump_config(ServerOptions *o)
1953 dump_cfg_strarray(sAllowGroups, o->num_allow_groups, o->allow_groups); 1975 dump_cfg_strarray(sAllowGroups, o->num_allow_groups, o->allow_groups);
1954 dump_cfg_strarray(sDenyGroups, o->num_deny_groups, o->deny_groups); 1976 dump_cfg_strarray(sDenyGroups, o->num_deny_groups, o->deny_groups);
1955 dump_cfg_strarray(sAcceptEnv, o->num_accept_env, o->accept_env); 1977 dump_cfg_strarray(sAcceptEnv, o->num_accept_env, o->accept_env);
1978 dump_cfg_strarray_oneline(sAuthenticationMethods,
1979 o->num_auth_methods, o->auth_methods);
1956 1980
1957 /* other arguments */ 1981 /* other arguments */
1958 for (i = 0; i < o->num_subsystems; i++) 1982 for (i = 0; i < o->num_subsystems; i++)