summaryrefslogtreecommitdiff
path: root/auth2-pubkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth2-pubkey.c')
-rw-r--r--auth2-pubkey.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/auth2-pubkey.c b/auth2-pubkey.c
index 3ccc3a213..4feeae3e2 100644
--- a/auth2-pubkey.c
+++ b/auth2-pubkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth2-pubkey.c,v 1.79 2018/06/06 18:29:18 markus Exp $ */ 1/* $OpenBSD: auth2-pubkey.c,v 1.80 2018/07/03 11:39:54 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -109,7 +109,7 @@ userauth_pubkey(struct ssh *ssh)
109 pktype = sshkey_type_from_name(pkalg); 109 pktype = sshkey_type_from_name(pkalg);
110 if (pktype == KEY_UNSPEC) { 110 if (pktype == KEY_UNSPEC) {
111 /* this is perfectly legal */ 111 /* this is perfectly legal */
112 logit("%s: unsupported public key algorithm: %s", 112 verbose("%s: unsupported public key algorithm: %s",
113 __func__, pkalg); 113 __func__, pkalg);
114 goto done; 114 goto done;
115 } 115 }
@@ -136,8 +136,7 @@ userauth_pubkey(struct ssh *ssh)
136 logit("refusing previously-used %s key", sshkey_type(key)); 136 logit("refusing previously-used %s key", sshkey_type(key));
137 goto done; 137 goto done;
138 } 138 }
139 if (match_pattern_list(sshkey_ssh_name(key), 139 if (match_pattern_list(pkalg, options.pubkey_key_types, 0) != 1) {
140 options.pubkey_key_types, 0) != 1) {
141 logit("%s: key type %s not in PubkeyAcceptedKeyTypes", 140 logit("%s: key type %s not in PubkeyAcceptedKeyTypes",
142 __func__, sshkey_ssh_name(key)); 141 __func__, sshkey_ssh_name(key));
143 goto done; 142 goto done;
@@ -188,8 +187,10 @@ userauth_pubkey(struct ssh *ssh)
188 /* test for correct signature */ 187 /* test for correct signature */
189 authenticated = 0; 188 authenticated = 0;
190 if (PRIVSEP(user_key_allowed(ssh, pw, key, 1, &authopts)) && 189 if (PRIVSEP(user_key_allowed(ssh, pw, key, 1, &authopts)) &&
191 PRIVSEP(sshkey_verify(key, sig, slen, sshbuf_ptr(b), 190 PRIVSEP(sshkey_verify(key, sig, slen,
192 sshbuf_len(b), NULL, ssh->compat)) == 0) { 191 sshbuf_ptr(b), sshbuf_len(b),
192 (ssh->compat & SSH_BUG_SIGTYPE) == 0 ? pkalg : NULL,
193 ssh->compat)) == 0) {
193 authenticated = 1; 194 authenticated = 1;
194 } 195 }
195 sshbuf_free(b); 196 sshbuf_free(b);