casts, etc. to quiet compiler warnings
authoraland <aland>
Thu, 5 Apr 2007 13:37:21 +0000 (13:37 +0000)
committeraland <aland>
Thu, 5 Apr 2007 13:37:21 +0000 (13:37 +0000)
src/lib/token.c
src/main/auth.c
src/modules/rlm_checkval/rlm_checkval.c
src/modules/rlm_copy_packet/rlm_copy_packet.c
src/modules/rlm_digest/rlm_digest.c
src/modules/rlm_eap/types/rlm_eap_leap/eap_leap.c
src/modules/rlm_eap/types/rlm_eap_leap/smbdes.c

index 52cad85..cad7c1c 100644 (file)
@@ -75,7 +75,7 @@ static LRAD_TOKEN getthing(char **ptr, char *buf, int buflen, int tok,
        char    *s, *p;
        int     quote;
        int     escape;
-       int     x;
+       unsigned int    x;
        const LRAD_NAME_NUMBER*t;
        LRAD_TOKEN rcode;
 
index 90bf567..e94bd73 100644 (file)
@@ -149,7 +149,7 @@ static int rad_check_password(REQUEST *request)
        VALUE_PAIR *cur_config_item;
        VALUE_PAIR *password_pair;
        VALUE_PAIR *auth_item;
-       char string[MAX_STRING_LEN];
+       uint8_t my_chap[MAX_STRING_LEN];
        int auth_type = -1;
        int result;
        int auth_type_count = 0;
@@ -319,13 +319,13 @@ static int rad_check_password(REQUEST *request)
                                return -1;
                        }
 
-                       rad_chap_encode(request->packet, string,
-                                       auth_item->vp_strvalue[0], password_pair);
+                       rad_chap_encode(request->packet, my_chap,
+                                       auth_item->vp_octets[0], password_pair);
 
                        /*
                         *      Compare them
                         */
-                       if (memcmp(string + 1, auth_item->vp_strvalue + 1,
+                       if (memcmp(my_chap + 1, auth_item->vp_strvalue + 1,
                                   CHAP_VALUE_LENGTH) != 0) {
                                DEBUG2("auth: user supplied CHAP-Password does NOT match local User-Password");
                                return -1;
@@ -665,7 +665,7 @@ autz_redo:
                /* double check: maybe the secret is wrong? */
                if ((debug_flag > 1) && (auth_item != NULL) &&
                                (auth_item->attribute == PW_USER_PASSWORD)) {
-                       u_char *p;
+                       char *p;
 
                        p = auth_item->vp_strvalue;
                        while (*p != '\0') {
index 41f5015..267b3e0 100644 (file)
@@ -74,8 +74,6 @@ static const CONF_PARSER module_config[] = {
 
 static int checkval_detach(void *instance)
 {
-       rlm_checkval_t *data = (rlm_checkval_t *) instance;
-
        free(instance);
        return 0;
 }
index 0603993..48e536c 100644 (file)
@@ -55,8 +55,6 @@ static const CONF_PARSER module_config[] = {
 
 static int packet_detach(void *instance)
 {
-       rlm_packet_t    *inst = instance;
-
        free(instance);
        return 0;
 }
index 7576d4a..0d8f50d 100644 (file)
@@ -265,7 +265,7 @@ static int digest_authenticate(void *instance, REQUEST *request)
                 */
                if (passwd->attribute == PW_CLEARTEXT_PASSWORD) {
                        librad_md5_calc(hash, &a1[0], a1_len);
-                       lrad_bin2hex(hash, &a1[0], 16);
+                       lrad_bin2hex(hash, (char *) &a1[0], 16);
                } else {        /* MUST be Digest-HA1 */
                        memcpy(&a1[0], passwd->vp_strvalue, 32);
                }
@@ -388,7 +388,7 @@ static int digest_authenticate(void *instance, REQUEST *request)
        } else {
                memcpy(&hash[0], &a1[0], a1_len);
        }
-       lrad_bin2hex(hash, kd, sizeof(hash));
+       lrad_bin2hex(hash, (char *) kd, sizeof(hash));
 
 #ifndef NDEBUG
        if (debug_flag) {
@@ -457,7 +457,7 @@ static int digest_authenticate(void *instance, REQUEST *request)
 
        librad_md5_calc(&hash[0], &a2[0], a2_len);
 
-       lrad_bin2hex(hash, kd + kd_len, sizeof(hash));
+       lrad_bin2hex(hash, (char *) kd + kd_len, sizeof(hash));
 
 #ifndef NDEBUG
        if (debug_flag) {
@@ -489,7 +489,7 @@ static int digest_authenticate(void *instance, REQUEST *request)
                return RLM_MODULE_INVALID;
        }
 
-       if (lrad_hex2bin(&vp->vp_octets[0], &hash[0], vp->length >> 1) != (vp->length >> 1)) {
+       if (lrad_hex2bin(&vp->vp_strvalue[0], &hash[0], vp->length >> 1) != (vp->length >> 1)) {
                DEBUG2("rlm_digest: Invalid text in Digest-Response");
                return RLM_MODULE_INVALID;
        }
index a85e0d1..bfc29b5 100644 (file)
@@ -225,7 +225,7 @@ static int eapleap_ntpwdhash(unsigned char *ntpwdhash, VALUE_PAIR *password)
        } else {                /* MUST be NT-Password */
                if (password->length == 32) {
                        password->length = lrad_hex2bin(password->vp_strvalue,
-                                                       password->vp_strvalue,
+                                                       password->vp_octets,
                                                        16);
                }
                if (password->length != 16) {
@@ -285,7 +285,7 @@ LEAP_PACKET *eapleap_stage6(LEAP_PACKET *packet, REQUEST *request,
        unsigned char ntpwdhash[16], ntpwdhashhash[16];
        unsigned char buffer[256];
        LEAP_PACKET *reply;
-       char *p;
+       unsigned char *p;
        VALUE_PAIR *vp;
 
        /*
index ccee0fc..c753f1c 100644 (file)
@@ -50,7 +50,7 @@ RCSID("$Id$")
 
 #include <string.h>
 #include <ctype.h>
-
+#include "eap_leap.h"
 
 #define uchar unsigned char