Use a separate variable to index through the hash digest, not the
variable used to index through the packet.
Make some variables holding one-byte quantities u_int rather than u_char
while we're at it - not much use in *requiring* them to fit into 8 bits
(the code might be better if we don't, and that eliminates a warning).
i = 0;
while(i < bodylen) {
const u_char *message;
- u_char type, len;
+ u_int type, len;
message = cp + 4 + i;
TCHECK2(*message, 2);
if(!vflag)
printf(" hd");
else {
- unsigned i;
+ unsigned j;
printf("\n\tHash Digest ");
if(len < 18) goto corrupt;
printf("key ID %u digest-%u '", EXTRACT_16BITS(message + 2), len - 2);
- for (i = 0; i < len - 2; i++)
- printf ("%02X", message[4 + i]);
+ for (j = 0; j < len - 2; j++)
+ printf ("%02X", message[4 + j]);
printf("'");
}
}