diff options
author | Ezra Peisach <epeisach@mit.edu> | 2011-08-24 20:04:49 +0000 |
---|---|---|
committer | Ezra Peisach <epeisach@mit.edu> | 2011-08-24 20:04:49 +0000 |
commit | 7bd583158912d1e19b1b117d076d5917009e0cd6 (patch) | |
tree | 13a89b03a8933dd890eaf3af3f7411dee9e0e167 /src/lib/crypto | |
parent | c02f8208dd3e91bf090afd1c1f152a9def3486f8 (diff) | |
download | krb5-7bd583158912d1e19b1b117d076d5917009e0cd6.tar.gz krb5-7bd583158912d1e19b1b117d076d5917009e0cd6.tar.xz krb5-7bd583158912d1e19b1b117d076d5917009e0cd6.zip |
Fix signed/unsigned warnings in tests
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25113 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/crypto')
-rw-r--r-- | src/lib/crypto/builtin/aes/aes-gen.c | 20 | ||||
-rw-r--r-- | src/lib/crypto/builtin/sha1/t_shs3.c | 12 | ||||
-rw-r--r-- | src/lib/crypto/crypto_tests/t_crc.c | 2 |
3 files changed, 17 insertions, 17 deletions
diff --git a/src/lib/crypto/builtin/aes/aes-gen.c b/src/lib/crypto/builtin/aes/aes-gen.c index 855e6a470d..573de52b2c 100644 --- a/src/lib/crypto/builtin/aes/aes-gen.c +++ b/src/lib/crypto/builtin/aes/aes-gen.c @@ -21,7 +21,7 @@ aes_ctx ctx, dctx; static void init () { - int i, j, r; + unsigned int i, j, r; srand(42); for (i = 0; i < 16; i++) @@ -40,7 +40,7 @@ static void init () static void hexdump(const unsigned char *ptr, size_t len) { - int i; + size_t i; for (i = 0; i < len; i++) printf ("%s%02X", (i % 16 == 0) ? "\n " : " ", ptr[i]); } @@ -88,7 +88,7 @@ static void fips_test () static void xor (unsigned char *out, const unsigned char *a, const unsigned char *b) { - int i; + unsigned int i; for (i = 0; i < B; i++) out[i] = a[i] ^ b[i]; } @@ -96,7 +96,7 @@ xor (unsigned char *out, const unsigned char *a, const unsigned char *b) static void ecb_enc (unsigned char *out, unsigned char *in, unsigned int len) { - int i, r; + unsigned int i, r; for (i = 0; i < len; i += 16) { r = aes_enc_blk (in + i, out + i, &ctx); if (!r) fprintf(stderr, "error, line %d\n", __LINE__), exit(1); @@ -107,7 +107,7 @@ ecb_enc (unsigned char *out, unsigned char *in, unsigned int len) static void ecb_dec (unsigned char *out, unsigned char *in, unsigned int len) { - int i, r; + unsigned int i, r; for (i = 0; i < len; i += 16) { r = aes_dec_blk (in + i, out + i, &dctx); if (!r) fprintf(stderr, "error, line %d\n", __LINE__), exit(1); @@ -124,7 +124,7 @@ static void cbc_enc (unsigned char *out, unsigned char *in, unsigned char *iv, unsigned int len) { - int i, r; + unsigned int i, r; unsigned char tmp[B]; D(iv); memcpy (tmp, iv, B); @@ -144,7 +144,7 @@ static void cbc_dec (unsigned char *out, unsigned char *in, unsigned char *iv, unsigned int len) { - int i, r; + unsigned int i, r; unsigned char tmp[B]; memcpy (tmp, iv, B); for (i = 0; i < len; i += B) { @@ -230,7 +230,7 @@ cts_dec (unsigned char *out, unsigned char *in, unsigned char *iv, static void ecb_test () { - int testno; + unsigned int testno; unsigned char tmp[4*B]; printf ("ECB tests:\n"); @@ -261,7 +261,7 @@ unsigned char ivec[16] = { 0 }; static void cbc_test () { - int testno; + unsigned int testno; unsigned char tmp[4*B]; printf ("CBC tests:\n"); @@ -290,7 +290,7 @@ static void cbc_test () static void cts_test () { - int testno; + unsigned int testno; unsigned char tmp[4*B]; printf ("CTS tests:\n"); diff --git a/src/lib/crypto/builtin/sha1/t_shs3.c b/src/lib/crypto/builtin/sha1/t_shs3.c index d05ac6d793..ca985fbcfd 100644 --- a/src/lib/crypto/builtin/sha1/t_shs3.c +++ b/src/lib/crypto/builtin/sha1/t_shs3.c @@ -350,11 +350,11 @@ unsigned char results6[SHS_DIGESTSIZE] = { static void test6(void) { struct { - long pad1; + unsigned long pad1; SHS_INFO si1; - long pad2; + unsigned long pad2; SHS_INFO si2; - long pad3; + unsigned long pad3; } sdata; unsigned char digest[SHS_DIGESTSIZE]; int failed; @@ -481,11 +481,11 @@ unsigned int kfsize[] = {0,1,31,32,33,55,56,63}; static void test7(void) { struct { - long pad1; + unsigned long pad1; SHS_INFO si1; - long pad2; + unsigned long pad2; SHS_INFO si2; - long pad3; + unsigned long pad3; } sdata; unsigned char digest[SHS_DIGESTSIZE]; int failed; diff --git a/src/lib/crypto/crypto_tests/t_crc.c b/src/lib/crypto/crypto_tests/t_crc.c index 7161fb0838..190773252d 100644 --- a/src/lib/crypto/crypto_tests/t_crc.c +++ b/src/lib/crypto/crypto_tests/t_crc.c @@ -148,7 +148,7 @@ static void gethexstr(char *data, size_t *outlen, unsigned char *outbuf, inlen = strlen(data); *outlen = 0; - for (cp = data; cp - data < inlen; cp += 2) { + for (cp = data; (size_t) (cp - data) < inlen; cp += 2) { strncpy(buf, cp, 2); buf[2] = '\0'; n = strtol(buf, NULL, 16); |