svn rev #22794: branches/krb5-1-7/src/lib/crypto/

tlyu@MIT.EDU tlyu at MIT.EDU
Mon Sep 28 16:06:58 EDT 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=22794
Commit By: tlyu
Log Message:
ticket: 6505
version_fixed: 1.7.1
status: resolved

pull up r22392 from trunk

 ------------------------------------------------------------------------
 r22392 | raeburn | 2009-05-27 16:03:46 -0400 (Wed, 27 May 2009) | 10 lines

 ticket: 6505
 target_version: 1.7
 tags: pullup
 subject: fix t_prf test code properly

 Correction to patch in r22364: "i" was used in two places, one of
 which required an int-sized value and the other of which required a
 size_t.  Instead of changing the type, split the two uses into
 separate variables.


Changed Files:
U   branches/krb5-1-7/src/lib/crypto/t_prf.c
Modified: branches/krb5-1-7/src/lib/crypto/t_prf.c
===================================================================
--- branches/krb5-1-7/src/lib/crypto/t_prf.c	2009-09-28 15:52:02 UTC (rev 22793)
+++ branches/krb5-1-7/src/lib/crypto/t_prf.c	2009-09-28 20:06:57 UTC (rev 22794)
@@ -40,7 +40,9 @@
   krb5_data input, output;
   krb5_keyblock *key = NULL;
   unsigned int in_length;
-  size_t i;
+  unsigned int i;
+  size_t prfsz;
+
   while (1) {
       krb5_enctype enctype;
       char s[1025];
@@ -65,17 +67,17 @@
 	      input.data[in_length-lc] = (unsigned) (i&0xff);
 	  }
 	  input.length = in_length;
-	  assert (krb5_c_prf_length(0, enctype, &i) == 0);
-	  assert (output.data = malloc(i));
-	  output.length = i;
+	  assert (krb5_c_prf_length(0, enctype, &prfsz) == 0);
+	  assert (output.data = malloc(prfsz));
+	  output.length = prfsz;
 	  assert (krb5_c_prf(0, key, &input, &output) == 0);
       
 	  free (input.data);
 	  input.data = NULL;
       }
-      for (; i > 0; i--) {
+      for (; prfsz > 0; prfsz--) {
 	  printf ("%02x",
-		  (unsigned int) ((unsigned char ) output.data[output.length-i]));
+		  (unsigned int) ((unsigned char ) output.data[output.length-prfsz]));
       }
       printf ("\n");
 




More information about the cvs-krb5 mailing list