#include <arpa/inet.h>#include <ctype.h>#include <errno.h>#include <fcntl.h>#include <pwd.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/param.h>#include <sys/stat.h>#include <unistd.h>#include <crack.h>#include <gcrypt.h>#include <atalk/logger.h>#include <atalk/afp.h>#include <atalk/uam.h>Macros | |
| #define | DES_KEY_SZ 8 |
| #define | PASSWDLEN 8 |
| #define | randhash(a) |
| #define | PASSWD_ILLEGAL '*' |
| #define | unhex(x) |
Functions | |
| static int | home_passwd (const struct passwd *pwd, const char *path, const int pathlen, unsigned char *passwd, const int len, const int set) |
| static int | afppasswd (const struct passwd *pwd, const char *path, const int pathlen, unsigned char *passwd, int len, const int set) |
| handle /path/afppasswd with an optional key file. we're a lot more trusting of this file. | |
| static int | randpass (const struct passwd *pwd, const char *file, unsigned char *passwd, const int len, const int set) |
| this sets the uid. | |
| static int | rand_login (void *obj, char *username, int ulen, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) |
| static int | randnum_logincont (void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) |
| check encrypted reply. | |
| static int | rand2num_logincont (void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) |
| static int | randnum_changepw (void *obj, const char *username, struct passwd *pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) |
| change password | |
| static int | randnum_login (void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) |
| static int | randnum_login_ext (void *obj, char *uname, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) |
| static int | uam_setup (void *obj, const char *path) |
| static void | uam_cleanup (void) |
Variables | |
| static unsigned char | seskey [8] |
| static struct passwd * | randpwd |
| static uint8_t | randbuf [8] |
| UAM_MODULE_EXPORT struct uam_export | uams_randnum |
| #define DES_KEY_SZ 8 |
| #define PASSWD_ILLEGAL '*' |
| #define PASSWDLEN 8 |
| #define randhash | ( | a | ) |
hash to a 16-bit number. this will generate completely harmless warnings on 64-bit machines.
| #define unhex | ( | x | ) |
|
static |
handle /path/afppasswd with an optional key file. we're a lot more trusting of this file.
here are the formats:
password is just the hex equivalent of either the ASCII password (if the key file doesn't exist) or the des encrypted password.
|
static |
handle ~/.passwd. courtesy of shirs.nosp@m.ch@i.nosp@m.bm.ne.nosp@m.t.
|
static |
differences from randnum:
|
static |
randnum sends an 8-byte number and uses the user's password to check against the encrypted reply.
|
static |
change password
|
static |
randnum login
|
static |
randnum login ext
|
static |
check encrypted reply.
|
static |
this sets the uid.
|
static |
|
static |
|
static |
|
static |
|
static |
| UAM_MODULE_EXPORT struct uam_export uams_randnum |