*
***********************************************************************/
static char const RCSID[] =
-"$Id: radius.c,v 1.26 2004/10/28 00:22:54 paulus Exp $";
+"$Id: radius.c,v 1.27 2004/11/14 07:26:26 paulus Exp $";
#include "pppd.h"
#include "chap-new.h"
#include <sys/types.h>
#include <sys/time.h>
#include <string.h>
+#include <netinet/in.h>
+#include <stdlib.h>
#define BUF_LEN 1024
memcpy(plain, vp->strvalue, sizeof(plain));
- MD5Init(&Context);
- MD5Update(&Context, req_info->secret, strlen(req_info->secret));
- MD5Update(&Context, req_info->request_vector, AUTH_VECTOR_LEN);
- MD5Final(buf, &Context);
+ MD5_Init(&Context);
+ MD5_Update(&Context, req_info->secret, strlen(req_info->secret));
+ MD5_Update(&Context, req_info->request_vector, AUTH_VECTOR_LEN);
+ MD5_Final(buf, &Context);
for (i = 0; i < 16; i++)
plain[i] ^= buf[i];
- MD5Init(&Context);
- MD5Update(&Context, req_info->secret, strlen(req_info->secret));
- MD5Update(&Context, vp->strvalue, 16);
- MD5Final(buf, &Context);
+ MD5_Init(&Context);
+ MD5_Update(&Context, req_info->secret, strlen(req_info->secret));
+ MD5_Update(&Context, vp->strvalue, 16);
+ MD5_Final(buf, &Context);
for(i = 0; i < 16; i++)
plain[i + 16] ^= buf[i];
memcpy(plain, crypt, 32);
- MD5Init(&Context);
- MD5Update(&Context, req_info->secret, strlen(req_info->secret));
- MD5Update(&Context, req_info->request_vector, AUTH_VECTOR_LEN);
- MD5Update(&Context, salt, 2);
- MD5Final(buf, &Context);
+ MD5_Init(&Context);
+ MD5_Update(&Context, req_info->secret, strlen(req_info->secret));
+ MD5_Update(&Context, req_info->request_vector, AUTH_VECTOR_LEN);
+ MD5_Update(&Context, salt, 2);
+ MD5_Final(buf, &Context);
for (i = 0; i < 16; i++)
plain[i] ^= buf[i];
return -1;
}
- MD5Init(&Context);
- MD5Update(&Context, req_info->secret, strlen(req_info->secret));
- MD5Update(&Context, crypt, 16);
- MD5Final(buf, &Context);
+ MD5_Init(&Context);
+ MD5_Update(&Context, req_info->secret, strlen(req_info->secret));
+ MD5_Update(&Context, crypt, 16);
+ MD5_Final(buf, &Context);
plain[16] ^= buf[0]; /* only need the first byte */