[trivial PATCH 17/22] [rlm_pap.c] eliminate build warnings

Wang Tinggong wangtinggong at gmail.com
Mon Feb 1 18:30:58 CET 2010


Signed-off-by: Wang Tinggong <wangtinggong at gmail.com>
---
 src/modules/rlm_pap/rlm_pap.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/modules/rlm_pap/rlm_pap.c b/src/modules/rlm_pap/rlm_pap.c
index 540aa4d..8cdef63 100644
--- a/src/modules/rlm_pap/rlm_pap.c
+++ b/src/modules/rlm_pap/rlm_pap.c
@@ -483,7 +483,7 @@ static int pap_authenticate(void *instance, REQUEST *request)
 	FR_MD5_CTX md5_context;
 	fr_SHA1_CTX sha1_context;
 	uint8_t digest[40];
-	char buff[MAX_STRING_LEN];
+	unsigned char buff[MAX_STRING_LEN];
 	char buff2[MAX_STRING_LEN + 50];
 	int scheme = PAP_ENC_INVALID;
 
@@ -711,13 +711,15 @@ static int pap_authenticate(void *instance, REQUEST *request)
 
 		snprintf(buff2, sizeof(buff2), "%%{mschap:NT-Hash %s}",
 			request->password->vp_strvalue);
-		if (!radius_xlat(digest, sizeof(digest),buff2,request,NULL)){
+		if (!radius_xlat((char*)digest, sizeof(digest), buff2,
+			request, NULL)){
 			RDEBUG("mschap xlat failed");
 			snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: mschap xlat failed");
 			goto make_msg;
 		}
-		if ((fr_hex2bin(digest, digest, 16) != vp->length) ||
-		    (memcmp(digest, vp->vp_octets, vp->length) != 0)) {
+		if ((fr_hex2bin((const char*)digest, digest, 16)
+			!= vp->length)
+		    	|| (memcmp(digest, vp->vp_octets, vp->length) != 0)) {
 			snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: NT password check failed");
 			goto make_msg;
 		}
@@ -736,12 +738,13 @@ static int pap_authenticate(void *instance, REQUEST *request)
 		}
 		snprintf(buff2, sizeof(buff2), "%%{mschap:LM-Hash %s}",
 			request->password->vp_strvalue);
-		if (!radius_xlat(digest,sizeof(digest),buff2,request,NULL)){
+		if (!radius_xlat((char*)digest, sizeof(digest), buff2,
+			request, NULL)){
 			RDEBUG("mschap xlat failed");
 			snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: mschap xlat failed");
 			goto make_msg;
 		}
-		if ((fr_hex2bin(digest, digest, 16) != vp->length) ||
+		if ((fr_hex2bin((char*)digest, digest, 16) != vp->length) ||
 		    (memcmp(digest, vp->vp_octets, vp->length) != 0)) {
 			snprintf(module_fmsg,sizeof(module_fmsg),"rlm_pap: LM password check failed");
 		make_msg:
-- 
1.6.0.6



More information about the Freeradius-Devel mailing list