From: Ezra Peisach Date: Mon, 25 Sep 2000 17:14:38 +0000 (+0000) Subject: * descbc.c, k5_md4des.c, k5_md5des.c, t_cksum.c: Cleanup unsigned X-Git-Tag: krb5-1.3-alpha1~1885 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ec34437212e0ab7a9fd69ba50ffc93bb7d3b1b94;p=krb5.git * descbc.c, k5_md4des.c, k5_md5des.c, t_cksum.c: Cleanup unsigned vs. signed warnings. * Makefile.in (t_cksum5, t_cksum4): Executables do not need to link with the krb5 library. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12670 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/crypto/keyhash_provider/ChangeLog b/src/lib/crypto/keyhash_provider/ChangeLog index 9e28d058d..92b15c31e 100644 --- a/src/lib/crypto/keyhash_provider/ChangeLog +++ b/src/lib/crypto/keyhash_provider/ChangeLog @@ -1,3 +1,11 @@ +2000-09-25 Ezra Peisach + + * descbc.c, k5_md4des.c, k5_md5des.c, t_cksum.c: Cleanup unsigned + vs. signed warnings. + + * Makefile.in (t_cksum5, t_cksum4): Executables do not need to + link with the krb5 library. + 2000-06-28 Ezra Peisach * descbc.c (k5_descbc_hash): Get rid of unused variable. diff --git a/src/lib/crypto/keyhash_provider/Makefile.in b/src/lib/crypto/keyhash_provider/Makefile.in index 50c9d352f..3d29c3e4f 100644 --- a/src/lib/crypto/keyhash_provider/Makefile.in +++ b/src/lib/crypto/keyhash_provider/Makefile.in @@ -35,11 +35,11 @@ t_cksum4.o: $(srcdir)/t_cksum.c t_cksum5.o: $(srcdir)/t_cksum.c $(CC) -DMD=5 $(ALL_CFLAGS) -o t_cksum5.o -c $(srcdir)/t_cksum.c -t_cksum4: t_cksum4.o $(KRB5_BASE_DEPLIBS) - $(CC_LINK) -o t_cksum4 t_cksum4.o $(KRB5_BASE_LIBS) +t_cksum4: t_cksum4.o $(CRYTPO_DEPLIB) + $(CC_LINK) -o t_cksum4 t_cksum4.o $(K5CRYPTO_LIB) -t_cksum5: t_cksum5.o $(KRB5_BASE_DEPLIBS) - $(CC_LINK) -o t_cksum5 t_cksum5.o $(KRB5_BASE_LIBS) +t_cksum5: t_cksum5.o $(CRYPTO_DEPLIB) + $(CC_LINK) -o t_cksum5 t_cksum5.o $(K5CRYPTO_LIB) check-unix:: t_cksum4 t_cksum5 $(RUN_SETUP) $(C)t_cksum4 "this is a test" diff --git a/src/lib/crypto/keyhash_provider/descbc.c b/src/lib/crypto/keyhash_provider/descbc.c index c608bec26..53a0e47f9 100644 --- a/src/lib/crypto/keyhash_provider/descbc.c +++ b/src/lib/crypto/keyhash_provider/descbc.c @@ -60,8 +60,11 @@ k5_descbc_hash(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, /* this has a return value, but it's useless to us */ - mit_des_cbc_cksum(input->data, output->data, input->length, - schedule, ivec?ivec->data:(char *)mit_des_zeroblock); + mit_des_cbc_cksum((unsigned char *) input->data, + (unsigned char *) output->data, input->length, + schedule, + ivec? (unsigned char *)ivec->data: + (unsigned char *)mit_des_zeroblock); memset(schedule, 0, sizeof(schedule)); diff --git a/src/lib/crypto/keyhash_provider/k5_md4des.c b/src/lib/crypto/keyhash_provider/k5_md4des.c index 7cefa98c3..360a81009 100644 --- a/src/lib/crypto/keyhash_provider/k5_md4des.c +++ b/src/lib/crypto/keyhash_provider/k5_md4des.c @@ -69,7 +69,7 @@ k5_md4des_hash(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, /* create the confouder */ data.length = CONFLENGTH; - data.data = conf; + data.data = (char *) conf; if ((ret = krb5_c_random_make_octets(/* XXX */ 0, &data))) return(ret); @@ -90,7 +90,8 @@ k5_md4des_hash(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, krb5_MD4Init(&ctx); krb5_MD4Update(&ctx, conf, CONFLENGTH); - krb5_MD4Update(&ctx, input->data, input->length); + krb5_MD4Update(&ctx, (unsigned char *) input->data, + (unsigned int) input->length); krb5_MD4Final(&ctx); /* construct the buffer to be encrypted */ @@ -103,7 +104,7 @@ k5_md4des_hash(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, mit_des_cbc_encrypt((krb5_pointer) output->data, (krb5_pointer) output->data, output->length, - schedule, (char *) mit_des_zeroblock, 1); + schedule, (unsigned char *) mit_des_zeroblock, 1); return(0); } @@ -157,7 +158,7 @@ k5_md4des_verify(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, if (!compathash) { mit_des_cbc_encrypt((krb5_pointer) hash->data, (krb5_pointer) plaintext, hash->length, - schedule, (char *) mit_des_zeroblock, 0); + schedule, (unsigned char *) mit_des_zeroblock, 0); } else { mit_des_cbc_encrypt((krb5_pointer) hash->data, (krb5_pointer) plaintext, hash->length, @@ -170,7 +171,8 @@ k5_md4des_verify(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, if (!compathash) { krb5_MD4Update(&ctx, plaintext, CONFLENGTH); } - krb5_MD4Update(&ctx, input->data, input->length); + krb5_MD4Update(&ctx, (unsigned char *) input->data, + (unsigned int) input->length); krb5_MD4Final(&ctx); /* compare the decrypted hash to the computed one */ diff --git a/src/lib/crypto/keyhash_provider/k5_md5des.c b/src/lib/crypto/keyhash_provider/k5_md5des.c index 788613904..bf9e5f7be 100644 --- a/src/lib/crypto/keyhash_provider/k5_md5des.c +++ b/src/lib/crypto/keyhash_provider/k5_md5des.c @@ -69,7 +69,7 @@ k5_md5des_hash(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, /* create the confouder */ data.length = CONFLENGTH; - data.data = conf; + data.data = (char *) conf; if ((ret = krb5_c_random_make_octets(/* XXX */ 0, &data))) return(ret); @@ -90,7 +90,8 @@ k5_md5des_hash(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, krb5_MD5Init(&ctx); krb5_MD5Update(&ctx, conf, CONFLENGTH); - krb5_MD5Update(&ctx, input->data, input->length); + krb5_MD5Update(&ctx, (unsigned char *) input->data, + (unsigned int) input->length); krb5_MD5Final(&ctx); /* construct the buffer to be encrypted */ @@ -103,7 +104,7 @@ k5_md5des_hash(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, mit_des_cbc_encrypt((krb5_pointer) output->data, (krb5_pointer) output->data, output->length, - schedule, (char *) mit_des_zeroblock, 1); + schedule, (unsigned char *) mit_des_zeroblock, 1); return(0); } @@ -156,7 +157,7 @@ k5_md5des_verify(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, if (!compathash) { mit_des_cbc_encrypt((krb5_pointer) hash->data, (krb5_pointer) plaintext, hash->length, - schedule, (char *) mit_des_zeroblock, 0); + schedule, (unsigned char *) mit_des_zeroblock, 0); } else { mit_des_cbc_encrypt((krb5_pointer) hash->data, (krb5_pointer) plaintext, hash->length, @@ -169,7 +170,8 @@ k5_md5des_verify(krb5_const krb5_keyblock *key, krb5_const krb5_data *ivec, if (!compathash) { krb5_MD5Update(&ctx, plaintext, CONFLENGTH); } - krb5_MD5Update(&ctx, input->data, input->length); + krb5_MD5Update(&ctx, (unsigned char *) input->data, + (unsigned) input->length); krb5_MD5Final(&ctx); /* compare the decrypted hash to the computed one */ diff --git a/src/lib/crypto/keyhash_provider/t_cksum.c b/src/lib/crypto/keyhash_provider/t_cksum.c index b15310349..9ef58a089 100644 --- a/src/lib/crypto/keyhash_provider/t_cksum.c +++ b/src/lib/crypto/keyhash_provider/t_cksum.c @@ -74,7 +74,6 @@ main(argc, argv) int msgindex; krb5_boolean valid; size_t length; - krb5_context kcontext; krb5_keyblock keyblock; krb5_error_code kret; krb5_data plaintext, newstyle_checksum; @@ -82,7 +81,7 @@ main(argc, argv) /* this is a terrible seed, but that's ok for the test. */ plaintext.length = 8; - plaintext.data = testkey; + plaintext.data = (char *) testkey; krb5_c_random_seed(/* XXX */ 0, &plaintext); @@ -94,8 +93,8 @@ main(argc, argv) newstyle_checksum.length = length; - if (!(newstyle_checksum.data = (krb5_octet *) - malloc(newstyle_checksum.length))) { + if (!(newstyle_checksum.data = (char *) + malloc((unsigned) newstyle_checksum.length))) { printf("cannot get memory for new style checksum\n"); return(ENOMEM); }