Go to the source code of this file.
Data Structures | |
| struct | uam_mod |
| struct | uam_obj |
Macros | |
| #define | uam_attach(a, b) |
| #define | uam_detach(a) |
| #define | auth_unregister(a) uam_detach(a) |
Functions | |
| struct uam_mod * | uam_load (AFPObj *, const char *, const char *) |
| void | uam_unload (struct uam_mod *) |
| unload the module. | |
| int | auth_load (AFPObj *, const char *, const char *) |
| int | auth_register (const int, struct uam_obj *) |
| struct uam_obj * | auth_uamfind (const int, const char *, const int) |
| void | auth_unload (void) |
| int | uam_random_string (AFPObj *, char *, int) |
| Fill a buffer with cryptographically secure random bytes. | |
interface between uam.c and auth.c
| #define auth_unregister | ( | a | ) | uam_detach(a) |
| #define uam_attach | ( | a, | |
| b | |||
| ) |
| #define uam_detach | ( | a | ) |
| int auth_load | ( | AFPObj * | obj, |
| const char * | path, | ||
| const char * | list | ||
| ) |
load all of the modules
| int auth_register | ( | const int | type, |
| struct uam_obj * | uam | ||
| ) |
| struct uam_obj * auth_uamfind | ( | const int | type, |
| const char * | name, | ||
| const int | len | ||
| ) |
just do a linked list search. this could be sped up with a hashed list, but i doubt anyone's going to have enough uams to matter.
| void auth_unload | ( | void | ) |
get rid of all of the uams
| int uam_random_string | ( | AFPObj * | obj, |
| char * | buf, | ||
| int | len | ||
| ) |
Fill a buffer with cryptographically secure random bytes.
Reads from /dev/urandom, looping until all bytes are filled so the caller always receives a fully-populated nonce. Retries on EINTR; never falls back to a deterministic source.
| obj | AFP session object (unused) |
| buf | destination buffer |
| len | number of bytes to fill; must be a positive multiple of 4 |
|
extern |
unload the module.
we check for a cleanup function, but we don't die if one doesn't exist. however, things are likely to leak without one.