X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fuams%2Fuams_dhx2_passwd.c;h=8d31b9f845b3502eb4935d38a0df5cf6635cfac2;hb=15c1fc2f2328736dd428ec3be37c893d8ee2e065;hp=2f3639db2971f0028e90d236fe18bc7092f1e4d1;hpb=ae97675aefb21e9e3039b759c688f5f1328cfa7e;p=netatalk.git diff --git a/etc/uams/uams_dhx2_passwd.c b/etc/uams/uams_dhx2_passwd.c index 2f3639db..8d31b9f8 100644 --- a/etc/uams/uams_dhx2_passwd.c +++ b/etc/uams/uams_dhx2_passwd.c @@ -12,19 +12,14 @@ #ifdef UAM_DHX2 +#include + #include #include #include #include #include - -#ifdef NETBSD -#define _XOPEN_SOURCE 500 /* for crypt() */ -#endif -#ifdef FREEBSD -#define _XOPEN_SOURCE /* for crypt() */ -#endif - +#include #include #ifdef HAVE_CRYPT_H @@ -58,7 +53,7 @@ static gcry_mpi_t p, Ra; static gcry_mpi_t serverNonce; static char *K_MD5hash = NULL; static int K_hash_len; -static u_int16_t ID; +static uint16_t ID; /* The initialization vectors for CAST128 are fixed by Apple. */ static unsigned char dhx_c2siv[] = { 'L', 'W', 'a', 'l', 'l', 'a', 'c', 'e' }; @@ -214,7 +209,7 @@ static int dhx2_setup(void *obj, char *ibuf _U_, size_t ibuflen _U_, /* Session ID first */ ID = dhxhash(obj); - *(u_int16_t *)rbuf = htons(ID); + *(uint16_t *)rbuf = htons(ID); rbuf += 2; *rbuflen += 2; @@ -228,7 +223,7 @@ static int dhx2_setup(void *obj, char *ibuf _U_, size_t ibuflen _U_, *rbuflen += 4; /* len = length of p = PRIMEBITS/8 */ - *(u_int16_t *)rbuf = htons((u_int16_t) PRIMEBITS/8); + *(uint16_t *)rbuf = htons((uint16_t) PRIMEBITS/8); rbuf += 2; *rbuflen += 2; @@ -312,7 +307,7 @@ static int passwd_login_ext(void *obj, char *uname, struct passwd **uam_pwd, { char *username; size_t len, ulen; - u_int16_t temp16; + uint16_t temp16; *rbuflen = 0; @@ -440,7 +435,7 @@ static int logincont1(void *obj _U_, struct passwd **uam_pwd _U_, /* ---- Start building reply packet ---- */ /* Session ID + 1 first */ - *(u_int16_t *)rbuf = htons(ID+1); + *(uint16_t *)rbuf = htons(ID+1); rbuf += 2; *rbuflen += 2; @@ -587,11 +582,11 @@ static int passwd_logincont(void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen) { - u_int16_t retID; + uint16_t retID; int ret; /* check for session id */ - retID = ntohs(*(u_int16_t *)ibuf); + retID = ntohs(*(uint16_t *)ibuf); if (retID == ID) ret = logincont1(obj, uam_pwd, ibuf, ibuflen, rbuf, rbuflen); else if (retID == ID+1)