diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-07-04 04:02:36 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-07-04 04:02:36 +0000 |
commit | 16ae3d0dba5f81e5602798b915105284033dea75 (patch) | |
tree | ce0c2bf0d7e961b1015d43d1a07269d81e7a9ce9 /auth.h | |
parent | 90279d80f57c79ac6566051172a94a2cca9674b1 (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.h | 56 |
1 files changed, 27 insertions, 29 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.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 | */ |
82 | int auth_rhosts(struct passwd * pw, const char *client_user); | 82 | int auth_rhosts(struct passwd *, const char *); |
83 | 83 | ||
84 | /* extended interface similar to auth_rhosts() */ | 84 | /* extended interface similar to auth_rhosts() */ |
85 | int | 85 | int |
86 | auth_rhosts2(struct passwd *pw, const char *client_user, const char *hostname, | 86 | auth_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 | */ |
93 | int | 92 | int |
94 | auth_rhosts_rsa(struct passwd * pw, const char *client_user, RSA* client_host_key); | 93 | auth_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 | */ |
100 | int auth_password(Authctxt *authctxt, const char *password); | 99 | int 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 | */ |
107 | int auth_rsa(struct passwd * pw, BIGNUM * client_n); | 106 | int 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 | */ |
113 | int auth_rsa_read_key(char **cpp, u_int *bitsp, BIGNUM * e, BIGNUM * n); | 112 | int 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 | */ |
120 | int auth_rsa_challenge_dialog(RSA *pk); | 119 | int 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 | */ |
129 | int auth_krb4(const char *server_user, KTEXT auth, char **client); | 128 | int auth_krb4(const char *, KTEXT, char **); |
130 | int krb4_init(uid_t uid); | 129 | int krb4_init(uid_t); |
131 | void krb4_cleanup_proc(void *ignore); | 130 | void krb4_cleanup_proc(void *); |
132 | int auth_krb4_password(struct passwd * pw, const char *password); | 131 | int 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. */ |
138 | int auth_kerberos_tgt(struct passwd * pw, const char *string); | 137 | int auth_kerberos_tgt(struct passwd *, const char *); |
139 | int auth_afs_token(struct passwd * pw, const char *token_string); | 138 | int 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); | |||
148 | void do_authentication2(void); | 147 | void do_authentication2(void); |
149 | 148 | ||
150 | Authctxt *authctxt_new(void); | 149 | Authctxt *authctxt_new(void); |
151 | void auth_log(Authctxt *authctxt, int authenticated, char *method, char *info); | 150 | void auth_log(Authctxt *, int, char *, char *); |
152 | void userauth_finish(Authctxt *authctxt, int authenticated, char *method); | 151 | void userauth_finish(Authctxt *, int, char *); |
153 | int auth_root_allowed(char *method); | 152 | int auth_root_allowed(char *); |
154 | 153 | ||
155 | int auth2_challenge(Authctxt *authctxt, char *devs); | 154 | int auth2_challenge(Authctxt *, char *); |
156 | 155 | ||
157 | int allowed_user(struct passwd * pw); | 156 | int allowed_user(struct passwd *); |
158 | 157 | ||
159 | char *get_challenge(Authctxt *authctxt); | 158 | char *get_challenge(Authctxt *); |
160 | int verify_response(Authctxt *authctxt, const char *response); | 159 | int verify_response(Authctxt *, const char *); |
161 | 160 | ||
162 | struct passwd * auth_get_user(void); | 161 | struct 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 */ |
165 | char *expand_filename(const char *template, struct passwd *pw); | 164 | char *expand_filename(const char *, struct passwd *); |
166 | char *authorized_keys_file(struct passwd *pw); | 165 | char *authorized_keys_file(struct passwd *); |
167 | char *authorized_keys_file2(struct passwd *pw); | 166 | char *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 */ |
170 | int | 169 | int |
171 | secure_filename(FILE *f, const char *file, struct passwd *pw, | 170 | secure_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 */ |
175 | HostStatus | 173 | HostStatus |
176 | check_key_in_hostfiles(struct passwd *pw, Key *key, const char *host, | 174 | check_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) |