netatalk: uams_dhx_passwd.c File Reference

netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
uams_dhx_passwd.c File Reference
`#include <arpa/inet.h>`
`#include <pwd.h>`
`#include <errno.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <sys/time.h>`
`#include <time.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 | dhxhash(a)

## Functions
static int | pwd_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)
static int | passwd_login_ext (void *obj, char *uname, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
| cleartxt login ext
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
gcry_mpi_t | K
static struct passwd * | dhxpwd
static uint8_t | randbuf [16]
UAM_MODULE_EXPORT struct uam_export | uams_dhx
UAM_MODULE_EXPORT struct uam_export | uams_dhx_passwd

## Macro Definition Documentation

## ◆ CRYPT2BUFLEN

#define CRYPT2BUFLEN (KEYSIZE + PASSWDLEN)

## ◆ CRYPTBUFLEN

#define CRYPTBUFLEN (KEYSIZE*2)

## ◆ dhxhash

#define dhxhash | ( |  | a | ) |

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

hash a number to a 16-bit quantity

## ◆ KEYSIZE

#define KEYSIZE 16

## ◆ PASSWDLEN

#define PASSWDLEN 64

## Function Documentation

## ◆ passwd_login()

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

cleartxt login

## ◆ 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

cleartxt login ext

uname format :

byte 3
2 bytes len (network order)
len bytes utf8 name

## ◆ passwd_logincont()

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

## ◆ pwd_login()

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

dhx passwd

## ◆ uam_cleanup()

void uam_cleanup | ( | void |  | ) |
| static

## ◆ uam_setup()

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

## Variable Documentation

## ◆ dhxpwd

struct passwd* dhxpwd
| static

## ◆ K

gcry_mpi_t K

the secret key

## ◆ randbuf

uint8_t randbuf[16]
| static

## ◆ uams_dhx

UAM_MODULE_EXPORT struct uam_export uams_dhx

Initial value:
= {
UAM_MODULE_SERVER,
UAM_MODULE_VERSION,
uam_setup, uam_cleanup
}
UAM_MODULE_VERSION
#define UAM_MODULE_VERSION
Definition uam.h:21
UAM_MODULE_SERVER
#define UAM_MODULE_SERVER
Definition uam.h:17
uam_setup
static int uam_setup(void *obj, const char *path)
Definition uams_dhx2_pam.c:1018
uam_cleanup
static void uam_cleanup(void)
Definition uams_dhx2_pam.c:1040

## ◆ uams_dhx_passwd

UAM_MODULE_EXPORT struct uam_export uams_dhx_passwd

Initial value:
= {
UAM_MODULE_SERVER,
UAM_MODULE_VERSION,
uam_setup, uam_cleanup
}