From: Ken Raeburn Date: Tue, 10 Apr 2001 08:52:35 +0000 (+0000) Subject: more casting cleanup X-Git-Tag: krb5-1.3-alpha1~1575 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fe16c7f4d7ccff499be9f470f3932a0f14ab7789;p=krb5.git more casting cleanup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13171 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/crypto/ChangeLog b/src/lib/crypto/ChangeLog index 3268c3701..4640e962f 100644 --- a/src/lib/crypto/ChangeLog +++ b/src/lib/crypto/ChangeLog @@ -3,6 +3,13 @@ * make_checksum.c (krb5_c_make_checksum): Add cast assigning to krb5_data data field. * make_random_key.c (krb5_c_make_random_key): Likewise. + * hmac.c (krb5_hmac): Likewise. + * old-api_glue.c (krb5_init_random_key, krb5_decrypt_data): + Likewise. + * prng.c (krb5_c_make_random_octets): Likewise. + * verify_checksum.c (krb5_c_verify_checksum): Likewise. + + * prng.c (krb5_c_random_seed): Cast argument to krb5_nfold. * keyed_cksum.c (is_keyed_cksum): Use -1U to keep compiler quiet, since return type is not signed. diff --git a/src/lib/crypto/dk/stringtokey.c b/src/lib/crypto/dk/stringtokey.c index 57371cdf6..a0bd3441f 100644 --- a/src/lib/crypto/dk/stringtokey.c +++ b/src/lib/crypto/dk/stringtokey.c @@ -69,7 +69,7 @@ krb5_dk_string_to_key(enc, string, salt, key) krb5_nfold(concatlen*8, concat, keybytes*8, foldstring); indata.length = keybytes; - indata.data = foldstring; + indata.data = (char *) foldstring; foldkey.length = keylength; foldkey.contents = foldkeydata; diff --git a/src/lib/crypto/hash_provider/ChangeLog b/src/lib/crypto/hash_provider/ChangeLog index 99e1a5d41..8775ad0a5 100644 --- a/src/lib/crypto/hash_provider/ChangeLog +++ b/src/lib/crypto/hash_provider/ChangeLog @@ -1,3 +1,8 @@ +2001-04-10 Ken Raeburn + + * hash_md4.c (k5_md4_hash): Cast argument to krb5_MD4Update. + * hash_md5.c (k5_md5_hash): Cast argument to krb5_MD5Update. + 2001-03-09 Ken Raeburn * hash_crc32.c, hash_md4.c, hash_md5.c, hash_provider.h, diff --git a/src/lib/crypto/hash_provider/hash_md4.c b/src/lib/crypto/hash_provider/hash_md4.c index 529e900d6..5c9d6b153 100644 --- a/src/lib/crypto/hash_provider/hash_md4.c +++ b/src/lib/crypto/hash_provider/hash_md4.c @@ -52,7 +52,7 @@ k5_md4_hash(unsigned int icount, const krb5_data *input, krb5_MD4Init(&ctx); for (i=0; idata, ctx.digest, RSA_MD4_CKSUM_LENGTH); diff --git a/src/lib/crypto/hash_provider/hash_md5.c b/src/lib/crypto/hash_provider/hash_md5.c index 72df9dcf6..c08755fb5 100644 --- a/src/lib/crypto/hash_provider/hash_md5.c +++ b/src/lib/crypto/hash_provider/hash_md5.c @@ -52,7 +52,7 @@ k5_md5_hash(unsigned int icount, const krb5_data *input, krb5_MD5Init(&ctx); for (i=0; idata, ctx.digest, RSA_MD5_CKSUM_LENGTH); diff --git a/src/lib/crypto/hmac.c b/src/lib/crypto/hmac.c index 0b856b4ce..763744c0f 100644 --- a/src/lib/crypto/hmac.c +++ b/src/lib/crypto/hmac.c @@ -89,12 +89,12 @@ krb5_hmac(hash, key, icount, input, output) for (i=0; ihash))(icount+1, hashin, &hashout)))) goto cleanup; @@ -109,7 +109,7 @@ krb5_hmac(hash, key, icount, input, output) /* compute the outer hash */ hashin[0].length = blocksize; - hashin[0].data = xorkey; + hashin[0].data = (char *) xorkey; hashin[1] = hashout; output->length = hashsize; diff --git a/src/lib/crypto/old_api_glue.c b/src/lib/crypto/old_api_glue.c index 49fba8319..f5111e629 100644 --- a/src/lib/crypto/old_api_glue.c +++ b/src/lib/crypto/old_api_glue.c @@ -143,7 +143,7 @@ krb5_init_random_key(context, eblock, keyblock, ptr) krb5_data data; data.length = keyblock->length; - data.data = keyblock->contents; + data.data = (char *) keyblock->contents; return(krb5_c_random_seed(context, &data)); } @@ -365,7 +365,7 @@ krb5_error_code krb5_decrypt_data(context, key, ivec, enc_data, data) } data->length = enc_data->ciphertext.length; - if ((data->data = (krb5_octet *) malloc(data->length)) == NULL) + if ((data->data = (char *) malloc(data->length)) == NULL) return(ENOMEM); if ((ret = krb5_c_decrypt(context, key, 0, ivec?&ivecd:0, enc_data, data))) diff --git a/src/lib/crypto/prng.c b/src/lib/crypto/prng.c index aec6781da..38fc726ce 100644 --- a/src/lib/crypto/prng.c +++ b/src/lib/crypto/prng.c @@ -74,7 +74,8 @@ krb5_c_random_seed(krb5_context context, krb5_data *data) random_count = 0; inited = 1; - krb5_nfold(data->length*8, data->data, STATESIZE*8, STATE); + krb5_nfold(data->length*8, (unsigned char *) data->data, + STATESIZE*8, STATE); return(0); } @@ -113,7 +114,7 @@ krb5_c_random_make_octets(krb5_context context, krb5_data *data) if (random_count == 0) { /* set up random krb5_data, and key to be filled in */ data1.length = keybytes; - data1.data = STATEKEY; + data1.data = (char *) STATEKEY; key.length = keylength; key.contents = KEYCONTENTS; @@ -123,9 +124,9 @@ krb5_c_random_make_octets(krb5_context context, krb5_data *data) /* encrypt the block */ data1.length = blocksize; - data1.data = STATEBLOCK; + data1.data = (char *) STATEBLOCK; data2.length = blocksize; - data2.data = RANDBLOCK; + data2.data = (char *) RANDBLOCK; if ((ret = ((*(enc->encrypt))(&key, NULL, &data1, &data2)))) return(ret); diff --git a/src/lib/crypto/verify_checksum.c b/src/lib/crypto/verify_checksum.c index 3056e50ed..d44ec86e9 100644 --- a/src/lib/crypto/verify_checksum.c +++ b/src/lib/crypto/verify_checksum.c @@ -53,7 +53,7 @@ krb5_c_verify_checksum(context, key, usage, data, cksum, valid) /* if there's actually a verify function, call it */ indata.length = cksum->length; - indata.data = cksum->contents; + indata.data = (char *) cksum->contents; if (krb5_cksumtypes_list[i].keyhash && krb5_cksumtypes_list[i].keyhash->verify)