annotate src/auth/password-scheme.h @ 3863:55df57c028d4 HEAD

Added "bool" type and changed all ints that were used as booleans to bool.
author Timo Sirainen <tss@iki.fi>
date Fri, 13 Jan 2006 22:25:57 +0200
parents abef2ac8843a
children c04189d77a59
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1192
76321f65960d Fix realm usage with DIGEST-MD5. Support generating other password schemes
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
1 #ifndef __PASSWORD_SCHEME_H
76321f65960d Fix realm usage with DIGEST-MD5. Support generating other password schemes
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
2 #define __PASSWORD_SCHEME_H
76321f65960d Fix realm usage with DIGEST-MD5. Support generating other password schemes
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
3
2084
9ba79ebae6ab Added support for password scheme plugins. auth module dir defaults under
Timo Sirainen <tss@iki.fi>
parents: 1873
diff changeset
4 struct password_scheme {
9ba79ebae6ab Added support for password scheme plugins. auth module dir defaults under
Timo Sirainen <tss@iki.fi>
parents: 1873
diff changeset
5 const char *name;
9ba79ebae6ab Added support for password scheme plugins. auth module dir defaults under
Timo Sirainen <tss@iki.fi>
parents: 1873
diff changeset
6
3863
55df57c028d4 Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents: 2428
diff changeset
7 bool (*password_verify)(const char *plaintext, const char *password,
55df57c028d4 Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents: 2428
diff changeset
8 const char *user);
2084
9ba79ebae6ab Added support for password scheme plugins. auth module dir defaults under
Timo Sirainen <tss@iki.fi>
parents: 1873
diff changeset
9 const char *(*password_generate)(const char *plaintext,
9ba79ebae6ab Added support for password scheme plugins. auth module dir defaults under
Timo Sirainen <tss@iki.fi>
parents: 1873
diff changeset
10 const char *user);
9ba79ebae6ab Added support for password scheme plugins. auth module dir defaults under
Timo Sirainen <tss@iki.fi>
parents: 1873
diff changeset
11 };
9ba79ebae6ab Added support for password scheme plugins. auth module dir defaults under
Timo Sirainen <tss@iki.fi>
parents: 1873
diff changeset
12
1192
76321f65960d Fix realm usage with DIGEST-MD5. Support generating other password schemes
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
13 /* Returns 1 = matched, 0 = didn't match, -1 = unknown scheme */
76321f65960d Fix realm usage with DIGEST-MD5. Support generating other password schemes
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
14 int password_verify(const char *plaintext, const char *password,
76321f65960d Fix realm usage with DIGEST-MD5. Support generating other password schemes
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
15 const char *scheme, const char *user);
76321f65960d Fix realm usage with DIGEST-MD5. Support generating other password schemes
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
16
76321f65960d Fix realm usage with DIGEST-MD5. Support generating other password schemes
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
17 /* Extracts scheme from password, or returns NULL if it isn't found. */
76321f65960d Fix realm usage with DIGEST-MD5. Support generating other password schemes
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
18 const char *password_get_scheme(const char **password);
76321f65960d Fix realm usage with DIGEST-MD5. Support generating other password schemes
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
19
76321f65960d Fix realm usage with DIGEST-MD5. Support generating other password schemes
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
20 /* Create wanted password scheme out of plaintext password and username. */
76321f65960d Fix realm usage with DIGEST-MD5. Support generating other password schemes
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
21 const char *password_generate(const char *plaintext, const char *user,
76321f65960d Fix realm usage with DIGEST-MD5. Support generating other password schemes
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
22 const char *scheme);
76321f65960d Fix realm usage with DIGEST-MD5. Support generating other password schemes
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
23
2367
203938a7f45e Added dovecotpw utility. Patch by Joshua Goodall
Timo Sirainen <tss@iki.fi>
parents: 2084
diff changeset
24 /* Iterate through the list of password schemes, returning names */
203938a7f45e Added dovecotpw utility. Patch by Joshua Goodall
Timo Sirainen <tss@iki.fi>
parents: 2084
diff changeset
25 const char *password_list_schemes(const struct password_scheme **listptr);
203938a7f45e Added dovecotpw utility. Patch by Joshua Goodall
Timo Sirainen <tss@iki.fi>
parents: 2084
diff changeset
26
2084
9ba79ebae6ab Added support for password scheme plugins. auth module dir defaults under
Timo Sirainen <tss@iki.fi>
parents: 1873
diff changeset
27 void password_schemes_init(void);
9ba79ebae6ab Added support for password scheme plugins. auth module dir defaults under
Timo Sirainen <tss@iki.fi>
parents: 1873
diff changeset
28 void password_schemes_deinit(void);
9ba79ebae6ab Added support for password scheme plugins. auth module dir defaults under
Timo Sirainen <tss@iki.fi>
parents: 1873
diff changeset
29
1873
ed5e808d934f CRAM-MD5 mechanism by Joshua Goodall, plus some cleanups.
Timo Sirainen <tss@iki.fi>
parents: 1192
diff changeset
30 /* INTERNAL: */
ed5e808d934f CRAM-MD5 mechanism by Joshua Goodall, plus some cleanups.
Timo Sirainen <tss@iki.fi>
parents: 1192
diff changeset
31 const char *password_generate_md5_crypt(const char *pw, const char *salt);
ed5e808d934f CRAM-MD5 mechanism by Joshua Goodall, plus some cleanups.
Timo Sirainen <tss@iki.fi>
parents: 1192
diff changeset
32 const char *password_generate_cram_md5(const char *pw);
2381
6531fd0f779f Added LANMAN password scheme. Patch by Andrey Panin
Timo Sirainen <tss@iki.fi>
parents: 2377
diff changeset
33 const char *password_generate_lm(const char *pw);
2377
8f5be0be3199 NTLM authentication. Patch by Andrey Panin
Timo Sirainen <tss@iki.fi>
parents: 2367
diff changeset
34 const char *password_generate_ntlm(const char *pw);
2428
abef2ac8843a Added Compuserve RPA authentication. Patch by Andrey Panin.
Timo Sirainen <tss@iki.fi>
parents: 2381
diff changeset
35 const char *password_generate_rpa(const char *pw);
1873
ed5e808d934f CRAM-MD5 mechanism by Joshua Goodall, plus some cleanups.
Timo Sirainen <tss@iki.fi>
parents: 1192
diff changeset
36
1192
76321f65960d Fix realm usage with DIGEST-MD5. Support generating other password schemes
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
37 #endif