svn rev #24689: trunk/src/lib/crypto/crypto_tests/

epeisach@MIT.EDU epeisach at MIT.EDU
Sun Mar 6 08:30:35 EST 2011


http://src.mit.edu/fisheye/changelog/krb5/?cs=24689
Commit By: epeisach
Log Message:
Fix up signed/unsigned warnings in this directory.  There are still 
a few more - but these were the obvious ones.




Changed Files:
U   trunk/src/lib/crypto/crypto_tests/t_crc.c
U   trunk/src/lib/crypto/crypto_tests/t_cts.c
U   trunk/src/lib/crypto/crypto_tests/t_hmac.c
U   trunk/src/lib/crypto/crypto_tests/t_mddriver.c
U   trunk/src/lib/crypto/crypto_tests/t_nfold.c
Modified: trunk/src/lib/crypto/crypto_tests/t_crc.c
===================================================================
--- trunk/src/lib/crypto/crypto_tests/t_crc.c	2011-03-06 13:29:54 UTC (rev 24688)
+++ trunk/src/lib/crypto/crypto_tests/t_crc.c	2011-03-06 13:30:35 UTC (rev 24689)
@@ -105,11 +105,12 @@
 
 #define NTRIALS (sizeof(trials) / sizeof(trials[0]))
 
+#if 0
 static void
 timetest(unsigned int nblk, unsigned int blksiz)
 {
     char *block;
-    int i;
+    unsigned int i;
     struct tms before, after;
     unsigned long cksum;
 
@@ -135,6 +136,7 @@
 
     free(block);
 }
+#endif
 
 static void gethexstr(char *data, size_t *outlen, unsigned char *outbuf,
                       size_t buflen)
@@ -158,7 +160,7 @@
 static void
 verify(void)
 {
-    int i;
+    unsigned int i;
     struct crc_trial trial;
     unsigned char buf[4];
     size_t len;

Modified: trunk/src/lib/crypto/crypto_tests/t_cts.c
===================================================================
--- trunk/src/lib/crypto/crypto_tests/t_cts.c	2011-03-06 13:29:54 UTC (rev 24688)
+++ trunk/src/lib/crypto/crypto_tests/t_cts.c	2011-03-06 13:30:35 UTC (rev 24689)
@@ -75,7 +75,7 @@
 #endif
 
 static void printd (const char *descr, krb5_data *d) {
-    int i, j;
+    unsigned int i, j;
     const int r = 16;
 
     printf("%s:", descr);
@@ -98,7 +98,7 @@
 }
 static void printk(const char *descr, krb5_keyblock *k) {
     krb5_data d;
-    d.data = k->contents;
+    d.data = (char *) k->contents;
     d.length = k->length;
     printd(descr, &d);
 }
@@ -110,7 +110,7 @@
     static const unsigned char aeskey[16] = "chicken teriyaki";
     static const int lengths[] = { 17, 31, 32, 47, 48, 64 };
 
-    int i;
+    unsigned int i;
     char outbuf[64], encivbuf[16], decivbuf[16];
     krb5_crypto_iov iov;
     krb5_data in, enciv, deciv;

Modified: trunk/src/lib/crypto/crypto_tests/t_hmac.c
===================================================================
--- trunk/src/lib/crypto/crypto_tests/t_hmac.c	2011-03-06 13:29:54 UTC (rev 24688)
+++ trunk/src/lib/crypto/crypto_tests/t_hmac.c	2011-03-06 13:30:35 UTC (rev 24689)
@@ -57,7 +57,7 @@
 #endif
 
 static void printd (const char *descr, krb5_data *d) {
-    int i, j;
+    unsigned int i, j;
     const int r = 16;
 
     printf("%s (%d bytes):", descr, d->length);
@@ -139,7 +139,7 @@
     char outbuf[20];
     char stroutbuf[80];
     krb5_error_code err;
-    int i, j;
+    unsigned int i, j;
     int lose = 0;
     struct k5buf buf;
 

Modified: trunk/src/lib/crypto/crypto_tests/t_mddriver.c
===================================================================
--- trunk/src/lib/crypto/crypto_tests/t_mddriver.c	2011-03-06 13:29:54 UTC (rev 24688)
+++ trunk/src/lib/crypto/crypto_tests/t_mddriver.c	2011-03-06 13:30:35 UTC (rev 24689)
@@ -202,7 +202,7 @@
 {
 #ifdef HAVE_TEST_SUITE
     struct md_test_entry *entry;
-    int i, num_tests = 0, num_failed = 0;
+    int num_tests = 0, num_failed = 0;
     unsigned char digest[16];
 
     printf ("MD%d test suite:\n\n", MD);

Modified: trunk/src/lib/crypto/crypto_tests/t_nfold.c
===================================================================
--- trunk/src/lib/crypto/crypto_tests/t_nfold.c	2011-03-06 13:29:54 UTC (rev 24688)
+++ trunk/src/lib/crypto/crypto_tests/t_nfold.c	2011-03-06 13:30:35 UTC (rev 24689)
@@ -51,7 +51,7 @@
 
 static void rfc_tests ()
 {
-    int i;
+    unsigned i;
     struct {
         char *input;
         unsigned int n;
@@ -101,7 +101,7 @@
 static void fold_kerberos(unsigned int nbytes)
 {
     unsigned char cipher_text[300];
-    int j;
+    unsigned int j;
 
     if (nbytes > 300)
         abort();
@@ -136,7 +136,7 @@
     char *argv[];
 {
     unsigned char cipher_text[64];
-    int i, j;
+    unsigned int i, j;
 
     printf("N-fold\n");
     for (i=0; i<sizeof(nfold_in)/sizeof(char *); i++) {




More information about the cvs-krb5 mailing list