#include <arpa/inet.h>#include <errno.h>#include <gcrypt.h>#include <pwd.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/time.h>#include <time.h>#include <unistd.h>#include <atalk/afp.h>#include <atalk/logger.h>#include <atalk/uam.h>Macros | |
| #define | PASSWDLEN 255 |
| #define | PRIMEBITS 1024 |
| #define | dhxhash(a) |
Functions | |
| static int | dh_params_generate (gcry_mpi_t *ret_p, gcry_mpi_t *ret_g, unsigned int bits) |
| Generate a new pair of prime and generator for use in the Diffie-Hellman key exchange. | |
| static int | dhx2_setup (void *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) |
| static int | login (void *obj, char *username, int ulen, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) |
| static int | passwd_login (void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) |
| dhx login | |
| static int | passwd_login_ext (void *obj, char *uname, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) |
| static int | logincont1 (void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) |
| static int | logincont2 (void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) |
| static int | passwd_logincont (void *obj, 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 gcry_mpi_t | p |
| static gcry_mpi_t | Ra |
| static gcry_mpi_t | serverNonce |
| static char * | K_MD5hash = NULL |
| static int | K_hash_len |
| static uint16_t | ID |
| static unsigned char | dhx_c2siv [] = { 'L', 'W', 'a', 'l', 'l', 'a', 'c', 'e' } |
| static unsigned char | dhx_s2civ [] = { 'C', 'J', 'a', 'l', 'b', 'e', 'r', 't' } |
| static struct passwd * | dhxpwd |
| UAM_MODULE_EXPORT struct uam_export | uams_dhx2 |
| UAM_MODULE_EXPORT struct uam_export | uams_dhx2_passwd |
| #define dhxhash | ( | a | ) |
hash a number to a 16-bit quantity
| #define PASSWDLEN 255 |
| #define PRIMEBITS 1024 |
Number of bits for p which we generate. Everybody out there uses 512, so we beat them
|
static |
Generate a new pair of prime and generator for use in the Diffie-Hellman key exchange.
The bits value should be one of 768, 1024, 2048, 3072 or 4096.
|
static |
|
static |
|
static |
|
static |
|
static |
dhx login
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| UAM_MODULE_EXPORT struct uam_export uams_dhx2 |
| UAM_MODULE_EXPORT struct uam_export uams_dhx2_passwd |