aboutsummaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/readconf.c b/readconf.c
index bcca6ed47c4c..f26fabaa6af4 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readconf.c,v 1.363 2021/09/16 05:36:03 djm Exp $ */
+/* $OpenBSD: readconf.c,v 1.366 2022/02/08 08:59:12 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -890,6 +890,15 @@ static const struct multistate multistate_canonicalizehostname[] = {
{ "always", SSH_CANONICALISE_ALWAYS },
{ NULL, -1 }
};
+static const struct multistate multistate_pubkey_auth[] = {
+ { "true", SSH_PUBKEY_AUTH_ALL },
+ { "false", SSH_PUBKEY_AUTH_NO },
+ { "yes", SSH_PUBKEY_AUTH_ALL },
+ { "no", SSH_PUBKEY_AUTH_NO },
+ { "unbound", SSH_PUBKEY_AUTH_UNBOUND },
+ { "host-bound", SSH_PUBKEY_AUTH_HBOUND },
+ { NULL, -1 }
+};
static const struct multistate multistate_compression[] = {
#ifdef WITH_ZLIB
{ "yes", COMP_ZLIB },
@@ -934,7 +943,7 @@ process_config_line_depth(Options *options, struct passwd *pw, const char *host,
const char *original_host, char *line, const char *filename,
int linenum, int *activep, int flags, int *want_final_pass, int depth)
{
- char *str, **charptr, *endofnumber, *keyword, *arg, *arg2, *p, ch;
+ char *str, **charptr, *endofnumber, *keyword, *arg, *arg2, *p;
char **cpptr, ***cppptr, fwdarg[256];
u_int i, *uintptr, uvalue, max_entries = 0;
int r, oactive, negated, opcode, *intptr, value, value2, cmdline = 0;
@@ -1102,8 +1111,9 @@ parse_time:
goto parse_string;
case oPubkeyAuthentication:
+ multistate_ptr = multistate_pubkey_auth;
intptr = &options->pubkey_authentication;
- goto parse_flag;
+ goto parse_multistate;
case oHostbasedAuthentication:
intptr = &options->hostbased_authentication;
@@ -1574,9 +1584,8 @@ parse_pubkey_algos:
}
while ((arg = argv_next(&ac, &av)) != NULL) {
arg2 = xstrdup(arg);
- ch = '\0';
- p = hpdelim2(&arg, &ch);
- if (p == NULL || ch == '/') {
+ p = hpdelim(&arg);
+ if (p == NULL) {
fatal("%s line %d: missing host in %s",
filename, linenum,
lookup_opcode_name(opcode));
@@ -2487,7 +2496,7 @@ fill_default_options(Options * options)
if (options->fwd_opts.streamlocal_bind_unlink == -1)
options->fwd_opts.streamlocal_bind_unlink = 0;
if (options->pubkey_authentication == -1)
- options->pubkey_authentication = 1;
+ options->pubkey_authentication = SSH_PUBKEY_AUTH_ALL;
if (options->gss_authentication == -1)
options->gss_authentication = 0;
if (options->gss_deleg_creds == -1)
@@ -2523,7 +2532,6 @@ fill_default_options(Options * options)
}
if (options->num_identity_files == 0) {
add_identity_file(options, "~/", _PATH_SSH_CLIENT_ID_RSA, 0);
- add_identity_file(options, "~/", _PATH_SSH_CLIENT_ID_DSA, 0);
#ifdef OPENSSL_HAS_ECC
add_identity_file(options, "~/", _PATH_SSH_CLIENT_ID_ECDSA, 0);
add_identity_file(options, "~/",
@@ -2534,6 +2542,7 @@ fill_default_options(Options * options)
add_identity_file(options, "~/",
_PATH_SSH_CLIENT_ID_ED25519_SK, 0);
add_identity_file(options, "~/", _PATH_SSH_CLIENT_ID_XMSS, 0);
+ add_identity_file(options, "~/", _PATH_SSH_CLIENT_ID_DSA, 0);
}
if (options->escape_char == -1)
options->escape_char = '~';
@@ -3137,6 +3146,8 @@ fmt_intarg(OpCodes code, int val)
return fmt_multistate_int(val, multistate_canonicalizehostname);
case oAddKeysToAgent:
return fmt_multistate_int(val, multistate_yesnoaskconfirm);
+ case oPubkeyAuthentication:
+ return fmt_multistate_int(val, multistate_pubkey_auth);
case oFingerprintHash:
return ssh_digest_alg_name(val);
default: