netatalk  4.4.0dev
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
uams_dhx2_passwd.c File Reference
#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)
static int dhx2_setup (void *obj, char *ibuf _U_, size_t ibuflen _U_, char *rbuf, size_t *rbuflen)
static int login (void *obj, char *username, int ulen, struct passwd **uam_pwd _U_, 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)
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 _U_, struct passwd **uam_pwd _U_, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
static int logincont2 (void *obj _U_, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf _U_, 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

Macro Definition Documentation

◆ dhxhash

#define dhxhash ( a)
Value:
((((unsigned long) (a) >> 8) ^ \
(unsigned long) (a)) & 0xffff)

◆ PASSWDLEN

#define PASSWDLEN   255

◆ PRIMEBITS

#define PRIMEBITS   1024

Function Documentation

◆ dh_params_generate()

int dh_params_generate ( gcry_mpi_t * ret_p,
gcry_mpi_t * ret_g,
unsigned int bits )
static

This function will 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.

◆ dhx2_setup()

int dhx2_setup ( void * obj,
char *ibuf _U_,
size_t ibuflen _U_,
char * rbuf,
size_t * rbuflen )
static

◆ login()

int login ( void * obj,
char * username,
int ulen,
struct passwd **uam_pwd _U_,
char * ibuf,
size_t ibuflen,
char * rbuf,
size_t * rbuflen )
static

◆ logincont1()

int logincont1 ( void *obj _U_,
struct passwd **uam_pwd _U_,
char * ibuf,
size_t ibuflen,
char * rbuf,
size_t * rbuflen )
static

◆ logincont2()

int logincont2 ( void *obj _U_,
struct passwd ** uam_pwd,
char * ibuf,
size_t ibuflen,
char *rbuf _U_,
size_t * rbuflen )
static

◆ passwd_login()

int passwd_login ( void * obj,
struct passwd ** uam_pwd,
char * ibuf,
size_t ibuflen,
char * rbuf,
size_t * rbuflen )
static

◆ passwd_login_ext()

int passwd_login_ext ( void * obj,
char * uname,
struct passwd ** uam_pwd,
char * ibuf,
size_t ibuflen,
char * rbuf,
size_t * rbuflen )
static

◆ passwd_logincont()

int passwd_logincont ( void * obj,
struct passwd ** uam_pwd,
char * ibuf,
size_t ibuflen ,
char * rbuf,
size_t * rbuflen )
static

◆ uam_cleanup()

void uam_cleanup ( void )
static

◆ uam_setup()

int uam_setup ( void * obj,
const char * path )
static

Variable Documentation

◆ dhx_c2siv

unsigned char dhx_c2siv[] = { 'L', 'W', 'a', 'l', 'l', 'a', 'c', 'e' }
static

◆ dhx_s2civ

unsigned char dhx_s2civ[] = { 'C', 'J', 'a', 'l', 'b', 'e', 'r', 't' }
static

◆ dhxpwd

struct passwd* dhxpwd
static

◆ ID

uint16_t ID
static

◆ K_hash_len

int K_hash_len
static

◆ K_MD5hash

char* K_MD5hash = NULL
static

◆ p

gcry_mpi_t p
static

◆ Ra

gcry_mpi_t Ra
static

◆ serverNonce

gcry_mpi_t serverNonce
static

◆ uams_dhx2

UAM_MODULE_EXPORT struct uam_export uams_dhx2
Initial value:
= {
}
#define UAM_MODULE_VERSION
Definition uam.h:21
#define UAM_MODULE_SERVER
Definition uam.h:17
static int uam_setup(void *obj _U_, const char *path)
Definition uams_dhx2_pam.c:1028
static void uam_cleanup(void)
Definition uams_dhx2_pam.c:1050

◆ uams_dhx2_passwd