Skip to content

Commit 8baade2

Browse files
Add additional debug message to show contents of authentication reply message
1 parent fc8b0b9 commit 8baade2

File tree

1 file changed

+17
-0
lines changed
  • src/java.security.jgss/share/classes/sun/security/krb5/internal

1 file changed

+17
-0
lines changed

src/java.security.jgss/share/classes/sun/security/krb5/internal/KDCRep.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,23 @@ protected void init(DerValue encoding, int req_type)
136136
"encoding tag is " +
137137
encoding.getTag() +
138138
" req type is " + req_type);
139+
140+
System.out.println(">>> KDCRep: Message in bytes is =>");
141+
byte[] dataBytes = encoding.getDataBytes();
142+
StringBuilder sb = new StringBuilder();
143+
for (int i = 0; i < dataBytes.length; i++) {
144+
if ((i % 16) == 0) {
145+
sb.append(String.format("%06X", i));
146+
}
147+
sb.append(String.format(" %02X", dataBytes[i] & 0xFF));
148+
if ((i % 16) == 15) {
149+
System.out.println(sb.toString());
150+
sb.setLength(0);
151+
}
152+
}
153+
if (sb.length() > 0) {
154+
System.out.println(sb.toString());
155+
}
139156
}
140157
throw new Asn1Exception(Krb5.ASN1_BAD_ID);
141158
}

0 commit comments

Comments
 (0)