summaryrefslogtreecommitdiff
path: root/auth2-hostbased.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth2-hostbased.c')
-rw-r--r--auth2-hostbased.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/auth2-hostbased.c b/auth2-hostbased.c
index 8996f7e05..359393291 100644
--- a/auth2-hostbased.c
+++ b/auth2-hostbased.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth2-hostbased.c,v 1.33 2018/01/23 05:27:21 djm Exp $ */ 1/* $OpenBSD: auth2-hostbased.c,v 1.36 2018/07/31 03:10:27 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -34,7 +34,7 @@
34#include "xmalloc.h" 34#include "xmalloc.h"
35#include "ssh2.h" 35#include "ssh2.h"
36#include "packet.h" 36#include "packet.h"
37#include "buffer.h" 37#include "sshbuf.h"
38#include "log.h" 38#include "log.h"
39#include "misc.h" 39#include "misc.h"
40#include "servconf.h" 40#include "servconf.h"
@@ -67,10 +67,6 @@ userauth_hostbased(struct ssh *ssh)
67 size_t alen, blen, slen; 67 size_t alen, blen, slen;
68 int r, pktype, authenticated = 0; 68 int r, pktype, authenticated = 0;
69 69
70 if (!authctxt->valid) {
71 debug2("%s: disabled because of invalid user", __func__);
72 return 0;
73 }
74 /* XXX use sshkey_froms() */ 70 /* XXX use sshkey_froms() */
75 if ((r = sshpkt_get_cstring(ssh, &pkalg, &alen)) != 0 || 71 if ((r = sshpkt_get_cstring(ssh, &pkalg, &alen)) != 0 ||
76 (r = sshpkt_get_string(ssh, &pkblob, &blen)) != 0 || 72 (r = sshpkt_get_string(ssh, &pkblob, &blen)) != 0 ||
@@ -111,13 +107,17 @@ userauth_hostbased(struct ssh *ssh)
111 "signature format"); 107 "signature format");
112 goto done; 108 goto done;
113 } 109 }
114 if (match_pattern_list(sshkey_ssh_name(key), 110 if (match_pattern_list(pkalg, options.hostbased_key_types, 0) != 1) {
115 options.hostbased_key_types, 0) != 1) {
116 logit("%s: key type %s not in HostbasedAcceptedKeyTypes", 111 logit("%s: key type %s not in HostbasedAcceptedKeyTypes",
117 __func__, sshkey_type(key)); 112 __func__, sshkey_type(key));
118 goto done; 113 goto done;
119 } 114 }
120 115
116 if (!authctxt->valid || authctxt->user == NULL) {
117 debug2("%s: disabled because of invalid user", __func__);
118 goto done;
119 }
120
121 if ((b = sshbuf_new()) == NULL) 121 if ((b = sshbuf_new()) == NULL)
122 fatal("%s: sshbuf_new failed", __func__); 122 fatal("%s: sshbuf_new failed", __func__);
123 /* reconstruct packet */ 123 /* reconstruct packet */