33 #include <openssl/rsa.h> 36 #include <login_cap.h> 51 typedef struct Authctxt Authctxt;
52 typedef struct Authmethod Authmethod;
53 typedef struct KbdintDevice KbdintDevice;
62 int server_caused_failure;
74 u_int num_auth_methods;
76 krb5_context krb5_ctx;
77 krb5_ccache krb5_fwd_ccache;
78 krb5_principal krb5_user;
79 char *krb5_ticket_file;
83 char *session_env_file;
88 struct sshkey **prev_userkeys;
100 int (*userauth)(Authctxt *authctxt);
114 void* (*init_ctx)(Authctxt*);
115 int (*query)(
void *ctx,
char **name,
char **infotxt,
116 u_int *numprompts,
char ***prompts, u_int **echo_on);
117 int (*respond)(
void *ctx, u_int numresp,
char **responses);
118 void (*free_ctx)(
void *ctx);
122 auth_rhosts2(
struct passwd *,
const char *,
const char *,
const char *);
124 int auth_password(Authctxt *,
const char *);
126 int hostbased_key_allowed(
struct passwd *,
const char *,
char *, Key *);
127 int user_key_allowed(
struct passwd *, Key *,
int);
128 void pubkey_auth_info(Authctxt *,
const Key *,
const char *, ...)
129 __attribute__((__format__ (printf, 3, 4)));
130 void auth2_record_userkey(Authctxt *, struct sshkey *);
131 int auth2_userkey_already_used(Authctxt *, struct sshkey *);
134 int auth_secure_path(const
char *, struct stat *, const
char *, uid_t,
138 int auth_krb5(Authctxt *authctxt, krb5_data *auth,
char **client, krb5_data *);
139 int auth_krb5_tgt(Authctxt *authctxt, krb5_data *tgt);
140 int auth_krb5_password(Authctxt *authctxt,
const char *password);
141 void krb5_cleanup_proc(Authctxt *authctxt);
144 #if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE) 146 int auth_shadow_acctexpired(
struct spwd *);
147 int auth_shadow_pwexpired(Authctxt *);
150 #include "auth-pam.h" 152 void remove_kbdint_device(
const char *);
154 void disable_forwarding(
void);
156 void do_authentication2(Authctxt *);
158 void auth_info(Authctxt *authctxt,
const char *, ...)
159 __attribute__((__format__ (printf, 2, 3)))
160 __attribute__((__nonnull__ (2)));
161 void auth_log(Authctxt *,
int,
int, const
char *, const
char *);
162 void auth_maxtries_exceeded(Authctxt *) __attribute__((noreturn));
163 void userauth_finish(Authctxt *,
int, const
char *, const
char *);
164 int auth_root_allowed(const
char *);
166 void userauth_send_banner(const
char *);
168 char *auth2_read_banner(
void);
169 int auth2_methods_valid(const
char *,
int);
170 int auth2_update_methods_lists(Authctxt *, const
char *, const
char *);
171 int auth2_setup_methods_lists(Authctxt *);
172 int auth2_method_allowed(Authctxt *, const
char *, const
char *);
174 void privsep_challenge_enable(
void);
176 int auth2_challenge(Authctxt *,
char *);
177 void auth2_challenge_stop(Authctxt *);
178 int bsdauth_query(
void *,
char **,
char **, u_int *,
char ***, u_int **);
179 int bsdauth_respond(
void *, u_int,
char **);
180 int skey_query(
void *,
char **,
char **, u_int *,
char ***, u_int **);
181 int skey_respond(
void *, u_int,
char **);
183 int allowed_user(struct passwd *);
184 struct passwd * getpwnamallow(const
char *user);
186 char *expand_authorized_keys(const
char *, struct passwd *pw);
187 char *authorized_principals_file(struct passwd *);
189 FILE *auth_openkeyfile(const
char *, struct passwd *,
int);
190 FILE *auth_openprincipals(const
char *, struct passwd *,
int);
191 int auth_key_is_revoked(Key *);
193 const
char *auth_get_canonical_hostname(struct ssh *,
int);
196 check_key_in_hostfiles(struct passwd *, Key *, const
char *,
197 const
char *, const
char *);
200 Key *get_hostkey_by_index(
int);
201 Key *get_hostkey_public_by_index(
int, struct ssh *);
202 Key *get_hostkey_public_by_type(
int,
int, struct ssh *);
203 Key *get_hostkey_private_by_type(
int,
int, struct ssh *);
204 int get_hostkey_index(Key *,
int, struct ssh *);
205 int sshd_hostkey_sign(Key *, Key *, u_char **,
size_t *,
206 const u_char *,
size_t, const
char *, u_int);
209 void auth_debug_add(const
char *fmt,...) __attribute__((format(printf, 1, 2)));
210 void auth_debug_send(
void);
211 void auth_debug_reset(
void);
213 struct passwd *fakepw(
void);
215 int sys_auth_passwd(Authctxt *, const
char *);
217 #define SKEY_PROMPT "\nS/Key Password: " 219 #if defined(KRB5) && !defined(HEIMDAL) 221 krb5_error_code ssh_krb5_cc_gen(krb5_context, krb5_ccache *);