diff -urN radiusd-cistron-1.6-dist/src/Make.inc radiusd-cistron-1.6/src/Make.inc --- radiusd-cistron-1.6-dist/src/Make.inc 2003-06-02 11:15:30.000000000 -0500 +++ radiusd-cistron-1.6/src/Make.inc 2003-06-02 11:16:33.000000000 -0500 @@ -14,7 +14,8 @@ -DRADRELAY_PID=\"$(PID_DIR)/radrelay.pid\" SERVER_OBJS = radiusd.o files.o acct.o pam.o version.o proxy.o \ - exec.o auth.o timestr.o cache.o readusers.o + exec.o auth.o timestr.o cache.o readusers.o \ + crypt16.o LIB_OBJS = dict.o util.o md5.o attrprint.o radius.o log.o pair.o \ encrattr.o filters.o @@ -84,6 +85,9 @@ version.o: version.c $(INCLUDES) $(CC) $(CFLAGS) $(DIRS) $(DBM) $(PAM) -o version.o -c version.c +crypt16.o: crypt16.c $(INCLUDES) + $(CC) $(CFLAGS) $(DIRS) -c crypt16.c + encrattr.o: encrattr.c $(INCLUDES) $(CC) $(CFLAGS) $(DIRS) -c encrattr.c diff -urN radiusd-cistron-1.6-dist/src/crypt16.c radiusd-cistron-1.6/src/crypt16.c --- radiusd-cistron-1.6-dist/src/crypt16.c 1969-12-31 18:00:00.000000000 -0600 +++ radiusd-cistron-1.6/src/crypt16.c 2003-06-02 11:15:39.000000000 -0500 @@ -0,0 +1,33 @@ +#define _XOPEN_SOURCE 500 + +#include +#include + +char * +crypt16 (key, salt) + char *key; + char *salt; +{ + static char res[25]; + static char s2[3]; + char *p; + + /* Clear the string of any previous data */ + memset (res, 0, sizeof (res)); + + /* crypt the first part */ + p = crypt (key, salt); + strncpy (res, p, 13); + + if (strlen (key) > 8) { + /* crypt the rest */ + /* the first two characters of the first block (not counting + * the salt) make up the new salt */ + strncpy (s2, &(res[2]), 2); + p = crypt (&(key[8]), s2); + strncpy (&(res[13]), &(p[2]), 11); + memset (s2, 0, sizeof (s2)); + } + + return (res); +} diff -urN radiusd-cistron-1.6-dist/src/radiusd.h radiusd-cistron-1.6/src/radiusd.h --- radiusd-cistron-1.6-dist/src/radiusd.h 2003-06-02 11:15:30.000000000 -0500 +++ radiusd-cistron-1.6/src/radiusd.h 2003-06-02 11:15:39.000000000 -0500 @@ -358,3 +358,7 @@ /* timestr.c */ int timestr_match(char *, time_t); +/* crypt16.c */ +#define crypt crypt16 +char * crypt16 (char *, char *); +