xref: /freebsd/crypto/openssh/auth.h (revision 5b9b2fafd4d6d82af10bf630cbfc9393b8ed1d0a)
1b66f2d16SKris Kennaway /*
2b66f2d16SKris Kennaway  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
3b66f2d16SKris Kennaway  *
4b66f2d16SKris Kennaway  * Redistribution and use in source and binary forms, with or without
5b66f2d16SKris Kennaway  * modification, are permitted provided that the following conditions
6b66f2d16SKris Kennaway  * are met:
7b66f2d16SKris Kennaway  * 1. Redistributions of source code must retain the above copyright
8b66f2d16SKris Kennaway  *    notice, this list of conditions and the following disclaimer.
9b66f2d16SKris Kennaway  * 2. Redistributions in binary form must reproduce the above copyright
10b66f2d16SKris Kennaway  *    notice, this list of conditions and the following disclaimer in the
11b66f2d16SKris Kennaway  *    documentation and/or other materials provided with the distribution.
12b66f2d16SKris Kennaway  *
13b66f2d16SKris Kennaway  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14b66f2d16SKris Kennaway  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15b66f2d16SKris Kennaway  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16b66f2d16SKris Kennaway  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17b66f2d16SKris Kennaway  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18b66f2d16SKris Kennaway  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19b66f2d16SKris Kennaway  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20b66f2d16SKris Kennaway  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21b66f2d16SKris Kennaway  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22b66f2d16SKris Kennaway  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
235b9b2fafSBrian Feldman  *
245b9b2fafSBrian Feldman  * $OpenBSD: auth.h,v 1.7 2000/10/16 09:38:44 djm Exp $
25b66f2d16SKris Kennaway  */
26a04a10f8SKris Kennaway #ifndef AUTH_H
27a04a10f8SKris Kennaway #define AUTH_H
28a04a10f8SKris Kennaway 
295b9b2fafSBrian Feldman typedef struct Authctxt Authctxt;
305b9b2fafSBrian Feldman struct Authctxt {
315b9b2fafSBrian Feldman 	int success;
325b9b2fafSBrian Feldman 	int valid;
335b9b2fafSBrian Feldman 	int attempt;
345b9b2fafSBrian Feldman 	char *user;
355b9b2fafSBrian Feldman 	char *service;
365b9b2fafSBrian Feldman 	struct passwd *pw;
375b9b2fafSBrian Feldman };
385b9b2fafSBrian Feldman 
39a04a10f8SKris Kennaway void	do_authentication(void);
40a04a10f8SKris Kennaway void	do_authentication2(void);
41a04a10f8SKris Kennaway 
425b9b2fafSBrian Feldman void	userauth_log(Authctxt *authctxt, int authenticated, char *method);
435b9b2fafSBrian Feldman void	userauth_reply(Authctxt *authctxt, int authenticated);
445b9b2fafSBrian Feldman 
455b9b2fafSBrian Feldman int	auth2_skey(Authctxt *authctxt);
46a04a10f8SKris Kennaway 
47b66f2d16SKris Kennaway int	allowed_user(struct passwd * pw);
485b9b2fafSBrian Feldman struct passwd * auth_get_user(void);
49a04a10f8SKris Kennaway 
50a04a10f8SKris Kennaway #define AUTH_FAIL_MAX 6
51a04a10f8SKris Kennaway #define AUTH_FAIL_LOG (AUTH_FAIL_MAX/2)
52a04a10f8SKris Kennaway #define AUTH_FAIL_MSG "Too many authentication failures for %.100s"
53a04a10f8SKris Kennaway 
54a04a10f8SKris Kennaway #endif
55