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);
121 int auth_rhosts(
struct passwd *,
const char *);
123 auth_rhosts2(
struct passwd *,
const char *,
const char *,
const char *);
125 int auth_rhosts_rsa(Authctxt *,
char *, Key *);
126 int auth_password(Authctxt *,
const char *);
127 int auth_rsa(Authctxt *, BIGNUM *);
128 int auth_rsa_challenge_dialog(Key *);
129 BIGNUM *auth_rsa_generate_challenge(Key *);
130 int auth_rsa_verify_response(Key *, BIGNUM *, u_char[]);
131 int auth_rsa_key_allowed(
struct passwd *, BIGNUM *, Key **);
133 int auth_rhosts_rsa_key_allowed(
struct passwd *,
const char *,
134 const char *, Key *);
135 int hostbased_key_allowed(
struct passwd *,
const char *,
char *, Key *);
136 int user_key_allowed(
struct passwd *, Key *,
int);
137 void pubkey_auth_info(Authctxt *,
const Key *,
const char *, ...)
138 __attribute__((__format__ (printf, 3, 4)));
139 void auth2_record_userkey(Authctxt *, struct sshkey *);
140 int auth2_userkey_already_used(Authctxt *, struct sshkey *);
143 int auth_secure_path(const
char *, struct stat *, const
char *, uid_t,
147 int auth_krb5(Authctxt *authctxt, krb5_data *auth,
char **client, krb5_data *);
148 int auth_krb5_tgt(Authctxt *authctxt, krb5_data *tgt);
149 int auth_krb5_password(Authctxt *authctxt,
const char *password);
150 void krb5_cleanup_proc(Authctxt *authctxt);
153 #if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE) 155 int auth_shadow_acctexpired(
struct spwd *);
156 int auth_shadow_pwexpired(Authctxt *);
159 #include "auth-pam.h" 161 void remove_kbdint_device(
const char *);
163 void disable_forwarding(
void);
165 void do_authentication(Authctxt *);
166 void do_authentication2(Authctxt *);
168 void auth_info(Authctxt *authctxt,
const char *, ...)
169 __attribute__((__format__ (printf, 2, 3)))
170 __attribute__((__nonnull__ (2)));
171 void auth_log(Authctxt *,
int,
int, const
char *, const
char *);
172 void auth_maxtries_exceeded(Authctxt *) __attribute__((noreturn));
173 void userauth_finish(Authctxt *,
int, const
char *, const
char *);
174 int auth_root_allowed(const
char *);
176 void userauth_send_banner(const
char *);
178 char *auth2_read_banner(
void);
179 int auth2_methods_valid(const
char *,
int);
180 int auth2_update_methods_lists(Authctxt *, const
char *, const
char *);
181 int auth2_setup_methods_lists(Authctxt *);
182 int auth2_method_allowed(Authctxt *, const
char *, const
char *);
184 void privsep_challenge_enable(
void);
186 int auth2_challenge(Authctxt *,
char *);
187 void auth2_challenge_stop(Authctxt *);
188 int bsdauth_query(
void *,
char **,
char **, u_int *,
char ***, u_int **);
189 int bsdauth_respond(
void *, u_int,
char **);
190 int skey_query(
void *,
char **,
char **, u_int *,
char ***, u_int **);
191 int skey_respond(
void *, u_int,
char **);
193 int allowed_user(struct passwd *);
194 struct passwd * getpwnamallow(const
char *user);
196 char *get_challenge(Authctxt *);
197 int verify_response(Authctxt *, const
char *);
198 void abandon_challenge_response(Authctxt *);
200 char *expand_authorized_keys(const
char *, struct passwd *pw);
201 char *authorized_principals_file(struct passwd *);
203 FILE *auth_openkeyfile(const
char *, struct passwd *,
int);
204 FILE *auth_openprincipals(const
char *, struct passwd *,
int);
205 int auth_key_is_revoked(Key *);
207 const
char *auth_get_canonical_hostname(struct ssh *,
int);
210 check_key_in_hostfiles(struct passwd *, Key *, const
char *,
211 const
char *, const
char *);
214 Key *get_hostkey_by_index(
int);
215 Key *get_hostkey_public_by_index(
int, struct ssh *);
216 Key *get_hostkey_public_by_type(
int,
int, struct ssh *);
217 Key *get_hostkey_private_by_type(
int,
int, struct ssh *);
218 int get_hostkey_index(Key *,
int, struct ssh *);
219 int ssh1_session_key(BIGNUM *);
220 int sshd_hostkey_sign(Key *, Key *, u_char **,
size_t *,
221 const u_char *,
size_t, const
char *, u_int);
224 void auth_debug_add(const
char *fmt,...) __attribute__((format(printf, 1, 2)));
225 void auth_debug_send(
void);
226 void auth_debug_reset(
void);
228 struct passwd *fakepw(
void);
230 int sys_auth_passwd(Authctxt *, const
char *);
232 #define SKEY_PROMPT "\nS/Key Password: " 234 #if defined(KRB5) && !defined(HEIMDAL) 236 krb5_error_code ssh_krb5_cc_gen(krb5_context, krb5_ccache *);