diff options
Diffstat (limited to 'auth.h')
-rw-r--r-- | auth.h | 27 |
1 files changed, 24 insertions, 3 deletions
@@ -21,7 +21,7 @@ | |||
21 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 21 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
23 | * | 23 | * |
24 | * $OpenBSD: auth.h,v 1.15 2001/04/12 19:15:24 markus Exp $ | 24 | * $OpenBSD: auth.h,v 1.16 2001/05/18 14:13:28 markus Exp $ |
25 | */ | 25 | */ |
26 | #ifndef AUTH_H | 26 | #ifndef AUTH_H |
27 | #define AUTH_H | 27 | #define AUTH_H |
@@ -36,6 +36,8 @@ | |||
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | typedef struct Authctxt Authctxt; | 38 | typedef struct Authctxt Authctxt; |
39 | typedef struct KbdintDevice KbdintDevice; | ||
40 | |||
39 | struct Authctxt { | 41 | struct Authctxt { |
40 | int success; | 42 | int success; |
41 | int postponed; | 43 | int postponed; |
@@ -46,12 +48,31 @@ struct Authctxt { | |||
46 | char *service; | 48 | char *service; |
47 | struct passwd *pw; | 49 | struct passwd *pw; |
48 | char *style; | 50 | char *style; |
51 | void *kbdintctxt; | ||
49 | #ifdef BSD_AUTH | 52 | #ifdef BSD_AUTH |
50 | auth_session_t *as; | 53 | auth_session_t *as; |
51 | #endif | 54 | #endif |
52 | }; | 55 | }; |
53 | 56 | ||
54 | /* | 57 | /* |
58 | * Keyboard interactive device: | ||
59 | * init_ctx returns: non NULL upon success | ||
60 | * query returns: 0 - success, otherwise failure | ||
61 | * respond returns: 0 - success, 1 - need further interaction, | ||
62 | * otherwise - failure | ||
63 | */ | ||
64 | struct KbdintDevice | ||
65 | { | ||
66 | const char *name; | ||
67 | void* (*init_ctx) __P((Authctxt*)); | ||
68 | int (*query) __P((void *ctx, char **name, char **infotxt, | ||
69 | u_int *numprompts, char ***prompts, | ||
70 | u_int **echo_on)); | ||
71 | int (*respond) __P((void *ctx, u_int numresp, char **responses)); | ||
72 | void (*free_ctx) __P((void *ctx)); | ||
73 | }; | ||
74 | |||
75 | /* | ||
55 | * Tries to authenticate the user using the .rhosts file. Returns true if | 76 | * Tries to authenticate the user using the .rhosts file. Returns true if |
56 | * authentication succeeds. If ignore_rhosts is non-zero, this will not | 77 | * authentication succeeds. If ignore_rhosts is non-zero, this will not |
57 | * consider .rhosts and .shosts (/etc/hosts.equiv will still be used). | 78 | * consider .rhosts and .shosts (/etc/hosts.equiv will still be used). |
@@ -133,8 +154,8 @@ int auth2_challenge(Authctxt *authctxt, char *devs); | |||
133 | 154 | ||
134 | int allowed_user(struct passwd * pw); | 155 | int allowed_user(struct passwd * pw); |
135 | 156 | ||
136 | char *get_challenge(Authctxt *authctxt, char *devs); | 157 | char *get_challenge(Authctxt *authctxt); |
137 | int verify_response(Authctxt *authctxt, char *response); | 158 | int verify_response(Authctxt *authctxt, const char *response); |
138 | 159 | ||
139 | struct passwd * auth_get_user(void); | 160 | struct passwd * auth_get_user(void); |
140 | 161 | ||