1d059297112922cabb0c674840589be8db821fd9aAdam Langley/* $OpenBSD: auth.h,v 1.82 2015/02/16 22:13:32 djm Exp $ */
2bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
3bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman/*
4bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * Copyright (c) 2000 Markus Friedl.  All rights reserved.
5bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman *
6bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * Redistribution and use in source and binary forms, with or without
7bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * modification, are permitted provided that the following conditions
8bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * are met:
9bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * 1. Redistributions of source code must retain the above copyright
10bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman *    notice, this list of conditions and the following disclaimer.
11bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * 2. Redistributions in binary form must reproduce the above copyright
12bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman *    notice, this list of conditions and the following disclaimer in the
13bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman *    documentation and/or other materials provided with the distribution.
14bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman *
15bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman *
26bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman */
27bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
28bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#ifndef AUTH_H
29bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#define AUTH_H
30bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
31bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#include <signal.h>
32bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
33bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#include <openssl/rsa.h>
34bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
35bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#ifdef HAVE_LOGIN_CAP
36bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#include <login_cap.h>
37bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#endif
38bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#ifdef BSD_AUTH
39bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#include <bsd_auth.h>
40bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#endif
41bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#ifdef KRB5
42bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#include <krb5.h>
43bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#endif
44bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
45d059297112922cabb0c674840589be8db821fd9aAdam Langleystruct ssh;
46d059297112922cabb0c674840589be8db821fd9aAdam Langleystruct sshkey;
47d059297112922cabb0c674840589be8db821fd9aAdam Langley
48bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmantypedef struct Authctxt Authctxt;
49bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmantypedef struct Authmethod Authmethod;
50bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmantypedef struct KbdintDevice KbdintDevice;
51bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
52bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanstruct Authctxt {
53bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	sig_atomic_t	 success;
54bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	int		 authenticated;	/* authenticated and alarms cancelled */
55bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	int		 postponed;	/* authentication needs another step */
56bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	int		 valid;		/* user exists and is allowed to login */
57bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	int		 attempt;
58bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	int		 failures;
59bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	int		 server_caused_failure;
60bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	int		 force_pwchange;
61bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	char		*user;		/* username sent by the client */
62bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	char		*service;
63bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	struct passwd	*pw;		/* set if 'valid' */
64bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	char		*style;
65bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	void		*kbdintctxt;
66d059297112922cabb0c674840589be8db821fd9aAdam Langley	char		*info;		/* Extra info for next auth_log */
67bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#ifdef BSD_AUTH
68bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	auth_session_t	*as;
69bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#endif
70d059297112922cabb0c674840589be8db821fd9aAdam Langley	char		**auth_methods;	/* modified from server config */
71d059297112922cabb0c674840589be8db821fd9aAdam Langley	u_int		 num_auth_methods;
72bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#ifdef KRB5
73bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	krb5_context	 krb5_ctx;
74bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	krb5_ccache	 krb5_fwd_ccache;
75bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	krb5_principal	 krb5_user;
76bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	char		*krb5_ticket_file;
77bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	char		*krb5_ccname;
78bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#endif
79bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	Buffer		*loginmsg;
80bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	void		*methoddata;
81d059297112922cabb0c674840589be8db821fd9aAdam Langley
82d059297112922cabb0c674840589be8db821fd9aAdam Langley	struct sshkey	**prev_userkeys;
83d059297112922cabb0c674840589be8db821fd9aAdam Langley	u_int		 nprev_userkeys;
84bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman};
85bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman/*
86bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * Every authentication method has to handle authentication requests for
87bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * non-existing users, or for users that are not allowed to login. In this
88bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * case 'valid' is set to 0, but 'user' points to the username requested by
89bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * the client.
90bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman */
91bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
92bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanstruct Authmethod {
93bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	char	*name;
94bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	int	(*userauth)(Authctxt *authctxt);
95bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	int	*enabled;
96bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman};
97bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
98bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman/*
99bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * Keyboard interactive device:
100bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * init_ctx	returns: non NULL upon success
101bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * query	returns: 0 - success, otherwise failure
102bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman * respond	returns: 0 - success, 1 - need further interaction,
103bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman *		otherwise - failure
104bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman */
105bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanstruct KbdintDevice
106bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman{
107bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	const char *name;
108bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	void*	(*init_ctx)(Authctxt*);
109bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	int	(*query)(void *ctx, char **name, char **infotxt,
110bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman		    u_int *numprompts, char ***prompts, u_int **echo_on);
111bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	int	(*respond)(void *ctx, u_int numresp, char **responses);
112bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman	void	(*free_ctx)(void *ctx);
113bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman};
114bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
115bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint      auth_rhosts(struct passwd *, const char *);
116bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint
117bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanauth_rhosts2(struct passwd *, const char *, const char *, const char *);
118bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
119bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint	 auth_rhosts_rsa(Authctxt *, char *, Key *);
120bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint      auth_password(Authctxt *, const char *);
121bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint      auth_rsa(Authctxt *, BIGNUM *);
122bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint      auth_rsa_challenge_dialog(Key *);
123bd77cf78387b72b7b3ea870459077672bf75c3b5Greg HartmanBIGNUM	*auth_rsa_generate_challenge(Key *);
124bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint	 auth_rsa_verify_response(Key *, BIGNUM *, u_char[]);
125bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint	 auth_rsa_key_allowed(struct passwd *, BIGNUM *, Key **);
126bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
127bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint	 auth_rhosts_rsa_key_allowed(struct passwd *, char *, char *, Key *);
128bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint	 hostbased_key_allowed(struct passwd *, const char *, char *, Key *);
129bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint	 user_key_allowed(struct passwd *, Key *);
130d059297112922cabb0c674840589be8db821fd9aAdam Langleyvoid	 pubkey_auth_info(Authctxt *, const Key *, const char *, ...)
131d059297112922cabb0c674840589be8db821fd9aAdam Langley	    __attribute__((__format__ (printf, 3, 4)));
132d059297112922cabb0c674840589be8db821fd9aAdam Langleyvoid	 auth2_record_userkey(Authctxt *, struct sshkey *);
133d059297112922cabb0c674840589be8db821fd9aAdam Langleyint	 auth2_userkey_already_used(Authctxt *, struct sshkey *);
134d059297112922cabb0c674840589be8db821fd9aAdam Langley
135d059297112922cabb0c674840589be8db821fd9aAdam Langleystruct stat;
136d059297112922cabb0c674840589be8db821fd9aAdam Langleyint	 auth_secure_path(const char *, struct stat *, const char *, uid_t,
137d059297112922cabb0c674840589be8db821fd9aAdam Langley    char *, size_t);
138bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
139bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#ifdef KRB5
140bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint	auth_krb5(Authctxt *authctxt, krb5_data *auth, char **client, krb5_data *);
141bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint	auth_krb5_tgt(Authctxt *authctxt, krb5_data *tgt);
142bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint	auth_krb5_password(Authctxt *authctxt, const char *password);
143bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanvoid	krb5_cleanup_proc(Authctxt *authctxt);
144bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#endif /* KRB5 */
145bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
146bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE)
147bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#include <shadow.h>
148bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint auth_shadow_acctexpired(struct spwd *);
149bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint auth_shadow_pwexpired(Authctxt *);
150bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#endif
151bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
152bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#include "auth-pam.h"
153bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#include "audit.h"
154bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanvoid remove_kbdint_device(const char *);
155bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
156bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanvoid disable_forwarding(void);
157bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
158bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanvoid	do_authentication(Authctxt *);
159bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanvoid	do_authentication2(Authctxt *);
160bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
161d059297112922cabb0c674840589be8db821fd9aAdam Langleyvoid	auth_info(Authctxt *authctxt, const char *, ...)
162d059297112922cabb0c674840589be8db821fd9aAdam Langley	    __attribute__((__format__ (printf, 2, 3)))
163d059297112922cabb0c674840589be8db821fd9aAdam Langley	    __attribute__((__nonnull__ (2)));
164d059297112922cabb0c674840589be8db821fd9aAdam Langleyvoid	auth_log(Authctxt *, int, int, const char *, const char *);
165d059297112922cabb0c674840589be8db821fd9aAdam Langleyvoid	auth_maxtries_exceeded(Authctxt *) __attribute__((noreturn));
166d059297112922cabb0c674840589be8db821fd9aAdam Langleyvoid	userauth_finish(Authctxt *, int, const char *, const char *);
167d059297112922cabb0c674840589be8db821fd9aAdam Langleyint	auth_root_allowed(const char *);
168d059297112922cabb0c674840589be8db821fd9aAdam Langley
169bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanvoid	userauth_send_banner(const char *);
170bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
171bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanchar	*auth2_read_banner(void);
172d059297112922cabb0c674840589be8db821fd9aAdam Langleyint	 auth2_methods_valid(const char *, int);
173d059297112922cabb0c674840589be8db821fd9aAdam Langleyint	 auth2_update_methods_lists(Authctxt *, const char *, const char *);
174d059297112922cabb0c674840589be8db821fd9aAdam Langleyint	 auth2_setup_methods_lists(Authctxt *);
175d059297112922cabb0c674840589be8db821fd9aAdam Langleyint	 auth2_method_allowed(Authctxt *, const char *, const char *);
176bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
177bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanvoid	privsep_challenge_enable(void);
178bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
179bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint	auth2_challenge(Authctxt *, char *);
180bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanvoid	auth2_challenge_stop(Authctxt *);
181bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint	bsdauth_query(void *, char **, char **, u_int *, char ***, u_int **);
182bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint	bsdauth_respond(void *, u_int, char **);
183bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint	skey_query(void *, char **, char **, u_int *, char ***, u_int **);
184bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint	skey_respond(void *, u_int, char **);
185bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
186bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint	allowed_user(struct passwd *);
187bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanstruct passwd * getpwnamallow(const char *user);
188bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
189bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanchar	*get_challenge(Authctxt *);
190bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint	verify_response(Authctxt *, const char *);
191bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanvoid	abandon_challenge_response(Authctxt *);
192bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
193bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanchar	*expand_authorized_keys(const char *, struct passwd *pw);
194bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanchar	*authorized_principals_file(struct passwd *);
195bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
196bd77cf78387b72b7b3ea870459077672bf75c3b5Greg HartmanFILE	*auth_openkeyfile(const char *, struct passwd *, int);
197bd77cf78387b72b7b3ea870459077672bf75c3b5Greg HartmanFILE	*auth_openprincipals(const char *, struct passwd *, int);
198bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint	 auth_key_is_revoked(Key *);
199bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
200bd77cf78387b72b7b3ea870459077672bf75c3b5Greg HartmanHostStatus
201bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmancheck_key_in_hostfiles(struct passwd *, Key *, const char *,
202bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman    const char *, const char *);
203bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
204bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman/* hostkey handling */
205bd77cf78387b72b7b3ea870459077672bf75c3b5Greg HartmanKey	*get_hostkey_by_index(int);
206d059297112922cabb0c674840589be8db821fd9aAdam LangleyKey	*get_hostkey_public_by_index(int, struct ssh *);
207d059297112922cabb0c674840589be8db821fd9aAdam LangleyKey	*get_hostkey_public_by_type(int, int, struct ssh *);
208d059297112922cabb0c674840589be8db821fd9aAdam LangleyKey	*get_hostkey_private_by_type(int, int, struct ssh *);
209d059297112922cabb0c674840589be8db821fd9aAdam Langleyint	 get_hostkey_index(Key *, int, struct ssh *);
210bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint	 ssh1_session_key(BIGNUM *);
211d059297112922cabb0c674840589be8db821fd9aAdam Langleyint	 sshd_hostkey_sign(Key *, Key *, u_char **, size_t *,
212d059297112922cabb0c674840589be8db821fd9aAdam Langley	     const u_char *, size_t, u_int);
213bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
214bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman/* debug messages during authentication */
215bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanvoid	 auth_debug_add(const char *fmt,...) __attribute__((format(printf, 1, 2)));
216bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanvoid	 auth_debug_send(void);
217bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanvoid	 auth_debug_reset(void);
218bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
219bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanstruct passwd *fakepw(void);
220bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
221bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmanint	 sys_auth_passwd(Authctxt *, const char *);
222bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
223bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#define SKEY_PROMPT "\nS/Key Password: "
224bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman
225bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#if defined(KRB5) && !defined(HEIMDAL)
226bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#include <krb5.h>
227bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartmankrb5_error_code ssh_krb5_cc_gen(krb5_context, krb5_ccache *);
228bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#endif
229bd77cf78387b72b7b3ea870459077672bf75c3b5Greg Hartman#endif
230