From dd10f166a343ec1cee5eac852bfb2c8a5fb45364 Mon Sep 17 00:00:00 2001 From: rufustfirefly Date: Tue, 8 May 2001 18:03:18 +0000 Subject: [PATCH] Tru64 patch from Burkhard Schmidt --- ChangeLog | 5 ++++- etc/uams/uams_dhx_passwd.c | 29 ++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 52d0b4ad..62d0cb31 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,13 @@ -($Id: ChangeLog,v 1.33 2001-05-08 15:43:30 rufustfirefly Exp $) +($Id: ChangeLog,v 1.34 2001-05-08 18:03:18 rufustfirefly Exp $) 2001-05-08 jeff b * bin/megatron/Makefile.am, etc/uams/Makefile.am: small Makefile fixes from Olaf Hering + * etc/uams/uams_dhx_passwd.c: Tru64 fixes from Burkhard Schmidt + + 2001-05-07 jeff b * contrib/shell_utils/netatalkshorternamelinks.pl: added script to diff --git a/etc/uams/uams_dhx_passwd.c b/etc/uams/uams_dhx_passwd.c index b8076cfb..98f67a7b 100644 --- a/etc/uams/uams_dhx_passwd.c +++ b/etc/uams/uams_dhx_passwd.c @@ -1,5 +1,5 @@ /* - * $Id: uams_dhx_passwd.c,v 1.6 2001-02-27 17:07:43 rufustfirefly Exp $ + * $Id: uams_dhx_passwd.c,v 1.7 2001-05-08 18:03:19 rufustfirefly Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) @@ -56,6 +56,12 @@ static CAST_KEY castkey; static struct passwd *dhxpwd; static u_int8_t randbuf[16]; +#ifdef DIGITAL_UNIX_SECURITY +#include +#include +#include +#endif /* DIGITAL_UNIX_SECURITY */ + /* dhx passwd */ static int passwd_login(void *obj, struct passwd **uam_pwd, char *ibuf, int ibuflen, @@ -74,6 +80,11 @@ static int passwd_login(void *obj, struct passwd **uam_pwd, char *name; DH *dh; +#ifdef TRU64 + static const char rnd_seed[] = "string to make the random number generator think it has entropy"; + RAND_seed(rnd_seed, sizeof rnd_seed); +#endif + *rbuflen = 0; if (uam_afpserver_option(obj, UAM_OPTION_USERNAME, (void *) &name, &i) < 0) @@ -201,6 +212,11 @@ static int passwd_logincont(void *obj, struct passwd **uam_pwd, u_int16_t sessid; char *p; +#ifdef DIGITAL_UNIX_SECURITY + char *bigcrypt(); + struct pr_passwd *pr; +#endif /* DIGITAL_UNIX_SECURITY */ + *rbuflen = 0; /* check for session id */ @@ -246,12 +262,23 @@ static int passwd_logincont(void *obj, struct passwd **uam_pwd, BN_free(bn3); rbuf[PASSWDLEN] = '\0'; +#ifdef DIGITAL_UNIX_SECURITY + pr = getprpwnam( dhxpwd->pw_name ); + if ( pr == NULL ) + return AFPERR_NOTAUTH; + if ( strcmp ( bigcrypt ( rbuf, pr->ufld.fd_encrypt ), + pr->ufld.fd_encrypt ) == 0 ) { + *uam_pwd = dhxpwd; + return AFP_OK; + } +#else /* DIGITAL_UNIX_SECURITY */ p = crypt( rbuf, dhxpwd->pw_passwd ); memset(rbuf, 0, PASSWDLEN); if ( strcmp( p, dhxpwd->pw_passwd ) == 0 ) { *uam_pwd = dhxpwd; return AFP_OK; } +#endif /* DIGITAL_UNIX_SECURITY */ return AFPERR_NOTAUTH; } -- 2.39.2