move sha1 and md4 code into lib
authorfcusack <fcusack>
Thu, 20 Jun 2002 10:10:42 +0000 (10:10 +0000)
committerfcusack <fcusack>
Thu, 20 Jun 2002 10:10:42 +0000 (10:10 +0000)
src/include/md4.h [moved from src/modules/rlm_mschap/md4.h with 97% similarity]
src/include/md5.h
src/include/sha1.h [moved from src/modules/rlm_mschap/sha1.h with 100% similarity]
src/lib/Makefile
src/lib/md4.c [moved from src/modules/rlm_mschap/md4c.c with 100% similarity]
src/lib/sha1.c [moved from src/modules/rlm_mschap/sha1.c with 100% similarity]
src/modules/rlm_mschap/Makefile
src/modules/rlm_mschap/README
src/modules/rlm_mschap/rlm_mschap.c
src/modules/rlm_mschap/smbencrypt.c

similarity index 97%
rename from src/modules/rlm_mschap/md4.h
rename to src/include/md4.h
index 6ef876c..9f1b727 100644 (file)
 
 /* POINTER defines a generic pointer type */
 typedef unsigned char *POINTER;
+#define _POINTER_T
 
 /* UINT2 defines a two byte word */
 typedef unsigned short int UINT2;
+#define _UINT2_T
 
 /* UINT4 defines a four byte word */
 #if defined(__alpha) && (defined(__osf__) || defined(__linux__))
@@ -26,6 +28,7 @@ typedef unsigned int UINT4;
 #else
 typedef unsigned long int UINT4;
 #endif
+#define _UINT4_T
 
 /* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
    If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
index d1da2e3..b427547 100644 (file)
 #endif
 
 /* POINTER defines a generic pointer type */
+#ifndef _POINTER_T
 typedef unsigned char *POINTER;
+#endif
 typedef const unsigned char *CONSTPOINTER;
 
 /* UINT2 defines a two byte word */
+#ifndef _UINT2_T
 typedef unsigned short int UINT2;
+#endif
 
 /* UINT4 defines a four byte word */
+#ifndef _UINT4_T
 #if defined(__alpha) && (defined(__osf__) || defined(__linux__))
 typedef unsigned int UINT4;
 #else
 typedef unsigned long int UINT4;
 #endif
+#endif
 
 /* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
    If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
index 9622e3c..8adc56a 100644 (file)
@@ -2,7 +2,7 @@
 include ../../Make.inc
 
 OBJS           = dict.o print.o radius.o valuepair.o token.o misc.o \
-               log.o filters.o missing.o md5.o hmac.o snprintf.o
+               log.o filters.o missing.o md4.o md5.o sha1.o hmac.o snprintf.o
 
 INCLUDES       = ../include/radius.h ../include/libradius.h \
                  ../include/missing.h ../include/autoconf.h
@@ -44,9 +44,15 @@ log.o:       log.c $(INCLUDES)
 missing.o: missing.c $(INCLUDES)
        $(CC) $(CFLAGS) -c missing.c
 
+md4.o: md4.c ../include/md4.h
+       $(CC) $(CFLAGS) -c md4.c
+
 md5.o: md5.c ../include/md5.h
        $(CC) $(CFLAGS) -c md5.c
 
+sha1.o: sha1.c ../include/sha1.h
+       $(CC) $(CFLAGS) -c sha1.c
+
 hmac.o: hmac.c $(INCLUDES) 
        $(CC) $(CFLAGS) -c hmac.c
 
similarity index 100%
rename from src/modules/rlm_mschap/md4c.c
rename to src/lib/md4.c
similarity index 100%
rename from src/modules/rlm_mschap/sha1.c
rename to src/lib/sha1.c
index 4d17b80..ec49c4a 100644 (file)
@@ -1,6 +1,6 @@
 TARGET         = rlm_mschap
-SRCS           = rlm_mschap.c deskey.c desport.c md4c.c smbpass.c sha1.c
-HEADERS                = md4.h des.h smbpass.h sha1.h
+SRCS           = rlm_mschap.c deskey.c desport.c smbpass.c
+HEADERS                = des.h smbpass.h
 RLM_CFLAGS     =
 RLM_UTILS      = smbencrypt
 RLM_INSTALL    = smbencrypt
@@ -13,4 +13,4 @@ $(STATIC_OBJS): $(HEADERS)
 $(DYNAMIC_OBJS): $(HEADERS)
 
 smbencrypt: $(STATIC_OBJS)
-       $(CC) $(LDFLAGS) -osmbencrypt smbencrypt.c deskey.o desport.o md4c.o smbpass.o
\ No newline at end of file
+       $(CC) -I../../include $(LDFLAGS) -o smbencrypt smbencrypt.c deskey.o desport.o smbpass.o ../../lib/md4.o
index ed20e97..27c9f2b 100644 (file)
@@ -2,7 +2,7 @@ New features were added:
 + LM support to MS-CHAP
 + support  for  SAMBA passwd files. It introduces new files smbpass.c and
   smbpass.h
-+ support for MS-CHAPv2. SHA1 digest support was added (sha1.c, sha2.c)
++ support for MS-CHAPv2. SHA1 digest support was added (sha1.c, sha1.h)
 ! module is configurable via radiusd.conf and supports instances
 ! module supports both authorization and authentication. Authorization
   sets authentication to MS-CHAP if any NTLM-related things found.
index c3bad12..e1447eb 100644 (file)
@@ -56,6 +56,7 @@
 #include       "modules.h"
 
 #include       "des.h"
+#include        "md4.h"
 #include        "md5.h"
 #include       "sha1.h"
 #include       "smbpass.h"
@@ -109,8 +110,6 @@ static void mppe_gen_respkey(uint8_t* secret,uint8_t* vector,
                        uint8_t* salt,uint8_t* enckey,uint8_t* key);
 #endif
 
-void md4_calc (unsigned char *, unsigned char *, unsigned int);
-
 
 
 /* 
index d04e864..f9eb7f0 100644 (file)
@@ -6,8 +6,8 @@
  
  */
 
-#include       "../../include/autoconf.h"
-#include       "../../include/libradius.h"
+#include       "autoconf.h"
+#include       "libradius.h"
 #include        <stdio.h>
 #include        <stdlib.h>
 #include        <string.h>