diff options
author | djm@openbsd.org <djm@openbsd.org> | 2015-01-13 07:39:19 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2015-01-13 19:27:18 +1100 |
commit | 1f729f0614d1376c3332fa1edb6a5e5cec7e9e03 (patch) | |
tree | f651f10aa00dcecdf8e9362c0abb6282bbc99c95 /auth2-pubkey.c | |
parent | 816d1538c24209a93ba0560b27c4fda57c3fff65 (diff) |
upstream commit
add sshd_config HostbasedAcceptedKeyTypes and
PubkeyAcceptedKeyTypes options to allow sshd to control what public key types
will be accepted. Currently defaults to all. Feedback & ok markus@
Diffstat (limited to 'auth2-pubkey.c')
-rw-r--r-- | auth2-pubkey.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/auth2-pubkey.c b/auth2-pubkey.c index 2b0486222..d922eea26 100644 --- a/auth2-pubkey.c +++ b/auth2-pubkey.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: auth2-pubkey.c,v 1.44 2014/12/22 07:51:30 djm Exp $ */ | 1 | /* $OpenBSD: auth2-pubkey.c,v 1.45 2015/01/13 07:39:19 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -127,6 +127,13 @@ userauth_pubkey(Authctxt *authctxt) | |||
127 | logit("refusing previously-used %s key", key_type(key)); | 127 | logit("refusing previously-used %s key", key_type(key)); |
128 | goto done; | 128 | goto done; |
129 | } | 129 | } |
130 | if (match_pattern_list(sshkey_ssh_name(key), options.pubkey_key_types, | ||
131 | strlen(options.pubkey_key_types), 0) != 1) { | ||
132 | logit("%s: key type %s not in PubkeyAcceptedKeyTypes", | ||
133 | __func__, sshkey_ssh_name(key)); | ||
134 | goto done; | ||
135 | } | ||
136 | |||
130 | if (have_sig) { | 137 | if (have_sig) { |
131 | sig = packet_get_string(&slen); | 138 | sig = packet_get_string(&slen); |
132 | packet_check_eom(); | 139 | packet_check_eom(); |