# warning fix for: # derive.c:63: warning: pointer targets in assignment differ in signedness # derive.c:66: warning: pointer targets in assignment differ in signedness # derive.c:75: warning: pointer targets in passing argument 2 of 'krb5_nfold' differ in signedness # derive.c:75: warning: pointer targets in passing argument 4 of 'krb5_nfold' differ in signedness # derive.c:96: warning: pointer targets in assignment differ in signedness # derive.c: In function 'krb5_derive_random': # derive.c:148: warning: pointer targets in assignment differ in signedness # derive.c:151: warning: pointer targets in assignment differ in signedness # derive.c:160: warning: pointer targets in passing argument 2 of 'krb5_nfold' differ in signedness # derive.c:160: warning: pointer targets in passing argument 4 of 'krb5_nfold' differ in signedness # # dk_decrypt.c:153: warning: pointer targets in assignment differ in signedness # # dk_encrypt.c: In function 'krb5_dk_encrypt': # dk_encrypt.c:98: warning: pointer targets in assignment differ in signedness # dk_encrypt.c:119: warning: pointer targets in assignment differ in signedness # dk_encrypt.c:132: warning: pointer targets in assignment differ in signedness # dk_encrypt.c:141: warning: pointer targets in assignment differ in signedness # dk_encrypt.c: In function 'krb5int_aes_dk_encrypt': # dk_encrypt.c:263: warning: pointer targets in assignment differ in signedness # dk_encrypt.c:284: warning: pointer targets in assignment differ in signedness # dk_encrypt.c:298: warning: pointer targets in assignment differ in signedness # dk_encrypt.c:308: warning: pointer targets in assignment differ in signedness # --- src/lib/crypto/dk/derive.c +++ src/lib/crypto/dk/derive.c 2006/06/21 10:13:47 @@ -60,10 +60,10 @@ return(ENOMEM); } - inblock.data = inblockdata; + inblock.data = (char*)inblockdata; inblock.length = blocksize; - outblock.data = outblockdata; + outblock.data = (char*)outblockdata; outblock.length = blocksize; /* initialize the input block */ @@ -71,8 +71,8 @@ if (in_constant->length == inblock.length) { memcpy(inblock.data, in_constant->data, inblock.length); } else { - krb5_nfold(in_constant->length*8, in_constant->data, - inblock.length*8, inblock.data); + krb5_nfold(in_constant->length*8, (unsigned char*)in_constant->data, + inblock.length*8, (unsigned char*)inblock.data); } /* loop encrypting the blocks until enough key bytes are generated */ @@ -93,7 +93,7 @@ /* postprocess the key */ - inblock.data = rawkey; + inblock.data = (char*)rawkey; inblock.length = keybytes; (*(enc->make_key))(&inblock, outkey); @@ -145,10 +145,10 @@ return(ENOMEM); } - inblock.data = inblockdata; + inblock.data = (char*)inblockdata; inblock.length = blocksize; - outblock.data = outblockdata; + outblock.data = (char*)outblockdata; outblock.length = blocksize; /* initialize the input block */ @@ -156,8 +156,8 @@ if (in_constant->length == inblock.length) { memcpy(inblock.data, in_constant->data, inblock.length); } else { - krb5_nfold(in_constant->length*8, in_constant->data, - inblock.length*8, inblock.data); + krb5_nfold(in_constant->length*8, (unsigned char*)in_constant->data, + inblock.length*8, (unsigned char*)inblock.data); } /* loop encrypting the blocks until enough key bytes are generated */ --- src/lib/crypto/dk/dk_decrypt.c +++ src/lib/crypto/dk/dk_decrypt.c 2006/06/21 10:13:47 @@ -150,7 +150,7 @@ cn = (unsigned char *) d1.data + d1.length - blocksize; else if (ivec_mode == 1) { int nblocks = (d1.length + blocksize - 1) / blocksize; - cn = d1.data + blocksize * (nblocks - 2); + cn = (unsigned char *) d1.data + blocksize * (nblocks - 2); } else abort(); } else --- src/lib/crypto/dk/dk_encrypt.c +++ src/lib/crypto/dk/dk_encrypt.c 2006/06/21 10:19:00 @@ -95,7 +95,7 @@ /* derive the keys */ - d1.data = constantdata; + d1.data = (char*)constantdata; d1.length = K5CLENGTH; d1.data[0] = (usage>>24)&0xff; @@ -116,7 +116,7 @@ /* put together the plaintext */ d1.length = blocksize; - d1.data = plaintext; + d1.data = (char*)plaintext; if ((ret = krb5_c_random_make_octets(/* XXX */ 0, &d1))) goto cleanup; @@ -129,7 +129,7 @@ /* encrypt the plaintext */ d1.length = plainlen; - d1.data = plaintext; + d1.data = (char*)plaintext; d2.length = plainlen; d2.data = output->data; @@ -138,7 +138,7 @@ goto cleanup; if (ivec != NULL && ivec->length == blocksize) - cn = d2.data + d2.length - blocksize; + cn = (unsigned char*)d2.data + d2.length - blocksize; else cn = NULL; @@ -260,7 +260,7 @@ /* derive the keys */ - d1.data = constantdata; + d1.data = (char*)constantdata; d1.length = K5CLENGTH; d1.data[0] = (usage>>24)&0xff; @@ -281,7 +281,7 @@ /* put together the plaintext */ d1.length = blocksize; - d1.data = plaintext; + d1.data = (char*)plaintext; if ((ret = krb5_c_random_make_octets(/* XXX */ 0, &d1))) goto cleanup; @@ -295,7 +295,7 @@ /* encrypt the plaintext */ d1.length = plainlen; - d1.data = plaintext; + d1.data = (char*)plaintext; d2.length = plainlen; d2.data = output->data; @@ -305,7 +305,7 @@ if (ivec != NULL && ivec->length == blocksize) { int nblocks = (d2.length + blocksize - 1) / blocksize; - cn = d2.data + blocksize * (nblocks - 2); + cn = (unsigned char*)d2.data + blocksize * (nblocks - 2); } else cn = NULL;