[security-dev 01537]: Code review request: 6917791 KeyTabEntry, when the byte value smaller then 16, the string drop '0'.

Max (Weijun) Wang Weijun.Wang at Sun.COM
Tue Jan 19 01:31:32 UTC 2010


Please take a review:

    http://cr.openjdk.java.net/~weijun/6917791/webrev.00

Before the fix, the hexdump of a keytab only encodes one character for  
byte smaller than 16. This means 0x12 can be {1,2} or {12}. After the  
fix, a byte is always encoded in 2 characters.

Thanks
Max

Begin forwarded message:

> *Synopsis*: KeyTabEntry, when the  byte value smaller then 16, the  
> string drop '0'.
>
> *Change Request ID*: 6917791
>
> *Synopsis*: KeyTabEntry, when the  byte value smaller then 16, the  
> string drop '0'.
>
>  Product: java
>  Category: jgss
>  Subcategory: krb5plugin
>  Type: Defect
>
> === *Description*  
> ============================================================
> FULL PRODUCT VERSION :
>
> A DESCRIPTION OF THE PROBLEM :
> sun.security.krb5.internal.ktab.KeyTabEntry
>
> public String getKeyString() {
>  StringBuffer sb = new StringBuffer("0x");
>  for (int i = 0; i < keyblock.length; i++) {
>   sb.append(Integer.toHexString(keyblock[i] & 0xff));
>  }
>  return sb.toString();
> }
>
> when the  byte value smaller then 16, the string drop '0'.
>
>
> REPRODUCIBILITY :
> This bug can be reproduced always.




More information about the security-dev mailing list