summaryrefslogtreecommitdiff
path: root/auth.h
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2018-03-03 03:15:51 +0000
committerDamien Miller <djm@mindrot.org>2018-03-03 14:37:16 +1100
commit7c856857607112a3dfe6414696bf4c7ab7fb0cb3 (patch)
tree48c837fc9c9e11d64862d4f54c1a886b54d8721c /auth.h
parent90c4bec8b5f9ec4c003ae4abdf13fc7766f00c8b (diff)
upstream: switch over to the new authorized_keys options API and
remove the legacy one. Includes a fairly big refactor of auth2-pubkey.c to retain less state between key file lines. feedback and ok markus@ OpenBSD-Commit-ID: dece6cae0f47751b9892080eb13d6625599573df
Diffstat (limited to 'auth.h')
-rw-r--r--auth.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/auth.h b/auth.h
index 64f3c2eb5..23ce67caf 100644
--- a/auth.h
+++ b/auth.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth.h,v 1.94 2018/01/08 15:21:49 markus Exp $ */ 1/* $OpenBSD: auth.h,v 1.95 2018/03/03 03:15:51 djm Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000 Markus Friedl. All rights reserved. 4 * Copyright (c) 2000 Markus Friedl. All rights reserved.
@@ -42,9 +42,11 @@
42#include <krb5.h> 42#include <krb5.h>
43#endif 43#endif
44 44
45struct passwd;
45struct ssh; 46struct ssh;
46struct sshkey;
47struct sshbuf; 47struct sshbuf;
48struct sshkey;
49struct sshauthopt;
48 50
49typedef struct Authctxt Authctxt; 51typedef struct Authctxt Authctxt;
50typedef struct Authmethod Authmethod; 52typedef struct Authmethod Authmethod;
@@ -128,11 +130,12 @@ struct KbdintDevice
128int 130int
129auth_rhosts2(struct passwd *, const char *, const char *, const char *); 131auth_rhosts2(struct passwd *, const char *, const char *, const char *);
130 132
131int auth_password(Authctxt *, const char *); 133int auth_password(struct ssh *, const char *);
132 134
133int hostbased_key_allowed(struct passwd *, const char *, char *, 135int hostbased_key_allowed(struct passwd *, const char *, char *,
134 struct sshkey *); 136 struct sshkey *);
135int user_key_allowed(struct passwd *, struct sshkey *, int); 137int user_key_allowed(struct ssh *, struct passwd *, struct sshkey *, int,
138 struct sshauthopt **);
136int auth2_key_already_used(Authctxt *, const struct sshkey *); 139int auth2_key_already_used(Authctxt *, const struct sshkey *);
137 140
138/* 141/*
@@ -163,14 +166,12 @@ int auth_shadow_pwexpired(Authctxt *);
163#include "audit.h" 166#include "audit.h"
164void remove_kbdint_device(const char *); 167void remove_kbdint_device(const char *);
165 168
166void disable_forwarding(void);
167
168void do_authentication2(Authctxt *); 169void do_authentication2(Authctxt *);
169 170
170void auth_log(Authctxt *, int, int, const char *, const char *); 171void auth_log(Authctxt *, int, int, const char *, const char *);
171void auth_maxtries_exceeded(Authctxt *) __attribute__((noreturn)); 172void auth_maxtries_exceeded(Authctxt *) __attribute__((noreturn));
172void userauth_finish(struct ssh *, int, const char *, const char *); 173void userauth_finish(struct ssh *, int, const char *, const char *);
173int auth_root_allowed(const char *); 174int auth_root_allowed(struct ssh *, const char *);
174 175
175void userauth_send_banner(const char *); 176void userauth_send_banner(const char *);
176 177
@@ -214,8 +215,17 @@ int get_hostkey_index(struct sshkey *, int, struct ssh *);
214int sshd_hostkey_sign(struct sshkey *, struct sshkey *, u_char **, 215int sshd_hostkey_sign(struct sshkey *, struct sshkey *, u_char **,
215 size_t *, const u_char *, size_t, const char *, u_int); 216 size_t *, const u_char *, size_t, const char *, u_int);
216 217
218/* Key / cert options linkage to auth layer */
219const struct sshauthopt *auth_options(struct ssh *);
220int auth_activate_options(struct ssh *, struct sshauthopt *);
221void auth_restrict_session(struct ssh *);
222int auth_authorise_keyopts(struct ssh *, struct passwd *pw,
223 struct sshauthopt *, int, const char *);
224void auth_log_authopts(const char *, const struct sshauthopt *, int);
225
217/* debug messages during authentication */ 226/* debug messages during authentication */
218void auth_debug_add(const char *fmt,...) __attribute__((format(printf, 1, 2))); 227void auth_debug_add(const char *fmt,...)
228 __attribute__((format(printf, 1, 2)));
219void auth_debug_send(void); 229void auth_debug_send(void);
220void auth_debug_reset(void); 230void auth_debug_reset(void);
221 231
@@ -227,7 +237,7 @@ struct passwd *fakepw(void);
227pid_t subprocess(const char *, struct passwd *, 237pid_t subprocess(const char *, struct passwd *,
228 const char *, int, char **, FILE **, u_int flags); 238 const char *, int, char **, FILE **, u_int flags);
229 239
230int sys_auth_passwd(Authctxt *, const char *); 240int sys_auth_passwd(struct ssh *, const char *);
231 241
232#define SKEY_PROMPT "\nS/Key Password: " 242#define SKEY_PROMPT "\nS/Key Password: "
233 243