------------------------------------------------------------------------
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.
ticket: 6505
version_fixed: 1.7.1
status: resolved
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-7@22794
dc483132-0cff-0310-8789-
dd5450dbe970
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];
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");