#include <arpa/inet.h>#include <errno.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <gcrypt.h>#include <atalk/afp.h>#include <atalk/logger.h>#include <atalk/uam.h>Macros | |
| #define | KEYSIZE 16 |
| #define | PASSWDLEN 64 |
| #define | CRYPTBUFLEN (KEYSIZE*2) |
| #define | CRYPT2BUFLEN (KEYSIZE + PASSWDLEN) |
| #define | CHANGEPWBUFLEN (KEYSIZE + 2*PASSWDLEN) |
| #define | dhxhash(a) |
| #define | COPY_STRING(s) |
| #define | PAM_CRED_ESTABLISH PAM_ESTABLISH_CRED |
Functions | |
| static int | PAM_conv (int num_msg, struct pam_message **msg, struct pam_response **resp, void *appdata_ptr) |
| PAM conversation function. | |
| static int | dhx_setup (void *obj, const unsigned char *ibuf, size_t ibuflen, unsigned char *rbuf, size_t *rbuflen) |
| static int | login (void *obj, unsigned char *username, int ulen, struct passwd **uam_pwd, const unsigned char *ibuf, size_t ibuflen, unsigned char *rbuf, size_t *rbuflen) |
| static int | pam_login (void *obj, struct passwd **uam_pwd, unsigned char *ibuf, size_t ibuflen, unsigned char *rbuf, size_t *rbuflen) |
| dhx login | |
| static int | pam_login_ext (void *obj, char *uname, struct passwd **uam_pwd, const unsigned char *ibuf, size_t ibuflen, unsigned char *rbuf, size_t *rbuflen) |
| static int | pam_logincont (void *obj, struct passwd **uam_pwd, const unsigned char *ibuf, size_t ibuflen, unsigned char *rbuf, size_t *rbuflen) |
| static void | pam_logout (void) |
| static int | pam_changepw (void *obj, unsigned char *username, const struct passwd *pwd, unsigned char *ibuf, size_t ibuflen, unsigned char *rbuf, size_t *rbuflen) |
| change pw for dhx | |
| static int | uam_setup (void *obj, const char *path) |
| static void | uam_cleanup (void) |
Variables | |
| gcry_mpi_t | K |
| static struct passwd * | dhxpwd |
| static uint8_t | randbuf [KEYSIZE] |
| static unsigned char | msg2_iv [] = "CJalbert" |
| static unsigned char | msg3_iv [] = "LWallace" |
| static const unsigned char | p_binary [] |
| static const unsigned char | g_binary [] = {0x07} |
| static pam_handle_t * | pamh = NULL |
| static unsigned char * | PAM_username |
| static unsigned char * | PAM_password |
| static struct pam_conv | PAM_conversation |
| UAM_MODULE_EXPORT struct uam_export | uams_dhx |
| UAM_MODULE_EXPORT struct uam_export | uams_dhx_pam |
| #define COPY_STRING | ( | s | ) |
| #define CRYPTBUFLEN (KEYSIZE*2) |
| #define dhxhash | ( | a | ) |
hash a number to a 16-bit quantity
| #define KEYSIZE 16 |
| #define PAM_CRED_ESTABLISH PAM_ESTABLISH_CRED |
| #define PASSWDLEN 64 |
|
static |
|
static |
|
static |
change pw for dhx
|
static |
PAM conversation function.
|
static |
dhx login
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| gcry_mpi_t K |
the secret key
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| UAM_MODULE_EXPORT struct uam_export uams_dhx |
| UAM_MODULE_EXPORT struct uam_export uams_dhx_pam |