summaryrefslogtreecommitdiff
path: root/auth.h
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-07-04 04:02:36 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-07-04 04:02:36 +0000
commit16ae3d0dba5f81e5602798b915105284033dea75 (patch)
treece0c2bf0d7e961b1015d43d1a07269d81e7a9ce9 /auth.h
parent90279d80f57c79ac6566051172a94a2cca9674b1 (diff)
- itojun@cvs.openbsd.org 2001/06/26 06:32:58
[atomicio.h authfd.h authfile.h auth.h auth-options.h bufaux.h buffer.h canohost.h channels.h cipher.h clientloop.h compat.h compress.h crc32.h deattack.h dh.h dispatch.h groupaccess.h hostfile.h kex.h key.h log.h mac.h match.h misc.h mpaux.h packet.h radix.h readconf.h readpass.h rsa.h] prototype pedant. not very creative... - () -> (void) - no variable names
Diffstat (limited to 'auth.h')
-rw-r--r--auth.h56
1 files changed, 27 insertions, 29 deletions
diff --git a/auth.h b/auth.h
index 415967c2c..a29944113 100644
--- a/auth.h
+++ b/auth.h
@@ -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.19 2001/06/25 17:54:49 provos Exp $ 24 * $OpenBSD: auth.h,v 1.20 2001/06/26 06:32:47 itojun Exp $
25 */ 25 */
26#ifndef AUTH_H 26#ifndef AUTH_H
27#define AUTH_H 27#define AUTH_H
@@ -79,45 +79,44 @@ struct KbdintDevice
79 * authentication succeeds. If ignore_rhosts is non-zero, this will not 79 * authentication succeeds. If ignore_rhosts is non-zero, this will not
80 * consider .rhosts and .shosts (/etc/hosts.equiv will still be used). 80 * consider .rhosts and .shosts (/etc/hosts.equiv will still be used).
81 */ 81 */
82int auth_rhosts(struct passwd * pw, const char *client_user); 82int auth_rhosts(struct passwd *, const char *);
83 83
84/* extended interface similar to auth_rhosts() */ 84/* extended interface similar to auth_rhosts() */
85int 85int
86auth_rhosts2(struct passwd *pw, const char *client_user, const char *hostname, 86auth_rhosts2(struct passwd *, const char *, const char *, const char *);
87 const char *ipaddr);
88 87
89/* 88/*
90 * Tries to authenticate the user using the .rhosts file and the host using 89 * Tries to authenticate the user using the .rhosts file and the host using
91 * its host key. Returns true if authentication succeeds. 90 * its host key. Returns true if authentication succeeds.
92 */ 91 */
93int 92int
94auth_rhosts_rsa(struct passwd * pw, const char *client_user, RSA* client_host_key); 93auth_rhosts_rsa(struct passwd *, const char *, RSA *);
95 94
96/* 95/*
97 * Tries to authenticate the user using password. Returns true if 96 * Tries to authenticate the user using password. Returns true if
98 * authentication succeeds. 97 * authentication succeeds.
99 */ 98 */
100int auth_password(Authctxt *authctxt, const char *password); 99int auth_password(Authctxt *, const char *);
101 100
102/* 101/*
103 * Performs the RSA authentication dialog with the client. This returns 0 if 102 * Performs the RSA authentication dialog with the client. This returns 0 if
104 * the client could not be authenticated, and 1 if authentication was 103 * the client could not be authenticated, and 1 if authentication was
105 * successful. This may exit if there is a serious protocol violation. 104 * successful. This may exit if there is a serious protocol violation.
106 */ 105 */
107int auth_rsa(struct passwd * pw, BIGNUM * client_n); 106int auth_rsa(struct passwd *, BIGNUM *);
108 107
109/* 108/*
110 * Parses an RSA key (number of bits, e, n) from a string. Moves the pointer 109 * Parses an RSA key (number of bits, e, n) from a string. Moves the pointer
111 * over the key. Skips any whitespace at the beginning and at end. 110 * over the key. Skips any whitespace at the beginning and at end.
112 */ 111 */
113int auth_rsa_read_key(char **cpp, u_int *bitsp, BIGNUM * e, BIGNUM * n); 112int auth_rsa_read_key(char **, u_int *, BIGNUM *, BIGNUM *);
114 113
115/* 114/*
116 * Performs the RSA authentication challenge-response dialog with the client, 115 * Performs the RSA authentication challenge-response dialog with the client,
117 * and returns true (non-zero) if the client gave the correct answer to our 116 * and returns true (non-zero) if the client gave the correct answer to our
118 * challenge; returns zero if the client gives a wrong answer. 117 * challenge; returns zero if the client gives a wrong answer.
119 */ 118 */
120int auth_rsa_challenge_dialog(RSA *pk); 119int auth_rsa_challenge_dialog(RSA *);
121 120
122#ifdef KRB4 121#ifdef KRB4
123#include <krb.h> 122#include <krb.h>
@@ -126,17 +125,17 @@ int auth_rsa_challenge_dialog(RSA *pk);
126 * if the client could not be authenticated, and 1 if authentication was 125 * if the client could not be authenticated, and 1 if authentication was
127 * successful. This may exit if there is a serious protocol violation. 126 * successful. This may exit if there is a serious protocol violation.
128 */ 127 */
129int auth_krb4(const char *server_user, KTEXT auth, char **client); 128int auth_krb4(const char *, KTEXT, char **);
130int krb4_init(uid_t uid); 129int krb4_init(uid_t);
131void krb4_cleanup_proc(void *ignore); 130void krb4_cleanup_proc(void *);
132int auth_krb4_password(struct passwd * pw, const char *password); 131int auth_krb4_password(struct passwd *, const char *);
133 132
134#ifdef AFS 133#ifdef AFS
135#include <kafs.h> 134#include <kafs.h>
136 135
137/* Accept passed Kerberos v4 ticket-granting ticket and AFS tokens. */ 136/* Accept passed Kerberos v4 ticket-granting ticket and AFS tokens. */
138int auth_kerberos_tgt(struct passwd * pw, const char *string); 137int auth_kerberos_tgt(struct passwd *, const char *);
139int auth_afs_token(struct passwd * pw, const char *token_string); 138int auth_afs_token(struct passwd *, const char *);
140#endif /* AFS */ 139#endif /* AFS */
141 140
142#endif /* KRB4 */ 141#endif /* KRB4 */
@@ -148,33 +147,32 @@ void do_authentication(void);
148void do_authentication2(void); 147void do_authentication2(void);
149 148
150Authctxt *authctxt_new(void); 149Authctxt *authctxt_new(void);
151void auth_log(Authctxt *authctxt, int authenticated, char *method, char *info); 150void auth_log(Authctxt *, int, char *, char *);
152void userauth_finish(Authctxt *authctxt, int authenticated, char *method); 151void userauth_finish(Authctxt *, int, char *);
153int auth_root_allowed(char *method); 152int auth_root_allowed(char *);
154 153
155int auth2_challenge(Authctxt *authctxt, char *devs); 154int auth2_challenge(Authctxt *, char *);
156 155
157int allowed_user(struct passwd * pw); 156int allowed_user(struct passwd *);
158 157
159char *get_challenge(Authctxt *authctxt); 158char *get_challenge(Authctxt *);
160int verify_response(Authctxt *authctxt, const char *response); 159int verify_response(Authctxt *, const char *);
161 160
162struct passwd * auth_get_user(void); 161struct passwd * auth_get_user(void);
163 162
164/* expand a filename - return buffer is allocated by xmalloc */ 163/* expand a filename - return buffer is allocated by xmalloc */
165char *expand_filename(const char *template, struct passwd *pw); 164char *expand_filename(const char *, struct passwd *);
166char *authorized_keys_file(struct passwd *pw); 165char *authorized_keys_file(struct passwd *);
167char *authorized_keys_file2(struct passwd *pw); 166char *authorized_keys_file2(struct passwd *);
168 167
169/* check a file and the path to it */ 168/* check a file and the path to it */
170int 169int
171secure_filename(FILE *f, const char *file, struct passwd *pw, 170secure_filename(FILE *, const char *, struct passwd *, char *, size_t);
172 char *err, size_t errlen);
173 171
174/* helper for hostbased auth */ 172/* helper for hostbased auth */
175HostStatus 173HostStatus
176check_key_in_hostfiles(struct passwd *pw, Key *key, const char *host, 174check_key_in_hostfiles(struct passwd *, Key *, const char *,
177 const char *sysfile, const char *userfile); 175 const char *, const char *);
178 176
179#define AUTH_FAIL_MAX 6 177#define AUTH_FAIL_MAX 6
180#define AUTH_FAIL_LOG (AUTH_FAIL_MAX/2) 178#define AUTH_FAIL_LOG (AUTH_FAIL_MAX/2)