summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorEzra Peisach <epeisach@mit.edu>2006-04-20 04:24:48 +0000
committerEzra Peisach <epeisach@mit.edu>2006-04-20 04:24:48 +0000
commite79dd1356bec312af8aee6093dfddea0c978ebbd (patch)
treec90d63ccb09adc7db5f6d46ea7bef1b952f66956 /src/lib
parentd29518ffa3a2100c7c7296ac1afdc7b1202035f1 (diff)
shsUpdate should take an unsigned int for length
Update shsUpdate to take an unsigned int length instead of signed. The code already assumes that it is an integer >= 0. This change cleans up a number of signed/unsigned warnings. sha1/shs.h, shs.c, t_shs.c: change ints to unsigned int dk/dk_encrypt.c: static function trunc_hmac change a signed int to unsigned hash_provider/hash_sha1.c: Remove cast in argument to shsUpdate ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17945 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/crypto/dk/dk_encrypt.c2
-rw-r--r--src/lib/crypto/hash_provider/hash_sha1.c2
-rw-r--r--src/lib/crypto/sha1/shs.c2
-rw-r--r--src/lib/crypto/sha1/shs.h2
-rw-r--r--src/lib/crypto/sha1/t_shs3.c8
5 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/crypto/dk/dk_encrypt.c b/src/lib/crypto/dk/dk_encrypt.c
index 2431e61c89..dfa7e07da1 100644
--- a/src/lib/crypto/dk/dk_encrypt.c
+++ b/src/lib/crypto/dk/dk_encrypt.c
@@ -191,7 +191,7 @@ krb5int_aes_encrypt_length(const struct krb5_enc_provider *enc,
static krb5_error_code
trunc_hmac (const struct krb5_hash_provider *hash,
- const krb5_keyblock *ki, int num,
+ const krb5_keyblock *ki, unsigned int num,
const krb5_data *input, const krb5_data *output)
{
size_t hashsize;
diff --git a/src/lib/crypto/hash_provider/hash_sha1.c b/src/lib/crypto/hash_provider/hash_sha1.c
index 2ee56ad21c..5fbea6a9cc 100644
--- a/src/lib/crypto/hash_provider/hash_sha1.c
+++ b/src/lib/crypto/hash_provider/hash_sha1.c
@@ -40,7 +40,7 @@ k5_sha1_hash(unsigned int icount, const krb5_data *input,
shsInit(&ctx);
for (i=0; i<icount; i++)
- shsUpdate(&ctx, (unsigned char *) input[i].data, (int) input[i].length);
+ shsUpdate(&ctx, (unsigned char *) input[i].data, input[i].length);
shsFinal(&ctx);
for (i=0; i<(sizeof(ctx.digest)/sizeof(ctx.digest[0])); i++) {
diff --git a/src/lib/crypto/sha1/shs.c b/src/lib/crypto/sha1/shs.c
index 0d7daa6062..a027fd76d1 100644
--- a/src/lib/crypto/sha1/shs.c
+++ b/src/lib/crypto/sha1/shs.c
@@ -240,7 +240,7 @@ void SHSTransform(SHS_LONG *digest, const SHS_LONG *data)
/* Update SHS for a block of data */
-void shsUpdate(SHS_INFO *shsInfo, const SHS_BYTE *buffer, int count)
+void shsUpdate(SHS_INFO *shsInfo, const SHS_BYTE *buffer, unsigned int count)
{
SHS_LONG tmp;
int dataCount, canfill;
diff --git a/src/lib/crypto/sha1/shs.h b/src/lib/crypto/sha1/shs.h
index 96422c4689..6dcb41b408 100644
--- a/src/lib/crypto/sha1/shs.h
+++ b/src/lib/crypto/sha1/shs.h
@@ -27,7 +27,7 @@ typedef struct {
/* Message digest functions (shs.c) */
void shsInit(SHS_INFO *shsInfo);
-void shsUpdate(SHS_INFO *shsInfo, const SHS_BYTE *buffer, int count);
+void shsUpdate(SHS_INFO *shsInfo, const SHS_BYTE *buffer, unsigned int count);
void shsFinal(SHS_INFO *shsInfo);
diff --git a/src/lib/crypto/sha1/t_shs3.c b/src/lib/crypto/sha1/t_shs3.c
index cefec45eb5..96b36a76e9 100644
--- a/src/lib/crypto/sha1/t_shs3.c
+++ b/src/lib/crypto/sha1/t_shs3.c
@@ -357,7 +357,7 @@ static void test6(void)
} sdata;
unsigned char digest[SHS_DIGESTSIZE];
int failed;
- int i, j;
+ unsigned int i, j;
printf("Running SHS test 6 ...\n");
sdata.pad1 = 0x12345678;
@@ -470,12 +470,12 @@ unsigned char results7[SHS_DIGESTSIZE] = {
0x89,0x41,0x65,0xce,0x76,0xc1,0xd1,0xd1,0xc3,0x6f,
0xab,0x92,0x79,0x30,0x01,0x71,0x63,0x1f,0x74,0xfe};
-int jfsize[] = {0,1,31,32,
+unsigned int jfsize[] = {0,1,31,32,
33,55,56,63,
64,65,71,72,
73,95,96,97,
119,120,123,127};
-int kfsize[] = {0,1,31,32,33,55,56,63};
+unsigned int kfsize[] = {0,1,31,32,33,55,56,63};
static void test7(void)
{
@@ -488,7 +488,7 @@ static void test7(void)
} sdata;
unsigned char digest[SHS_DIGESTSIZE];
int failed;
- int i, j, k, l;
+ unsigned int i, j, k, l;
printf("Running SHS test 7 ...\n");
sdata.pad1 = 0x12345678;