Farhan Khan created DIRKRB-734:
----------------------------------

             Summary: Miss-calculation of Bytes Read For Entry in Keytab
                 Key: DIRKRB-734
                 URL: https://issues.apache.org/jira/browse/DIRKRB-734
             Project: Directory Kerberos
          Issue Type: Bug
            Reporter: Farhan Khan


When using to read principal from a keytab file generated by a heimdal-kdc 
(version 7.5.0), it is throwing error because of miss-calculation of number of 
bytes read for an entry. The error is as follows:
{code:java}
java.io.IOException: Unexpected octets len: 16716
    at 
org.apache.kerby.kerberos.kerb.KrbInputStream.readCountedOctets(KrbInputStream.java:72)
    at 
org.apache.kerby.kerberos.kerb.KrbInputStream.readKey(KrbInputStream.java:48)
    at 
org.apache.kerby.kerberos.kerb.keytab.KeytabEntry.load(KeytabEntry.java:55)
    at org.apache.kerby.kerberos.kerb.keytab.Keytab.readEntry(Keytab.java:203)
    at org.apache.kerby.kerberos.kerb.keytab.Keytab.readEntries(Keytab.java:189)
    at org.apache.kerby.kerberos.kerb.keytab.Keytab.doLoad(Keytab.java:161)
    at org.apache.kerby.kerberos.kerb.keytab.Keytab.load(Keytab.java:155)
    at org.apache.kerby.kerberos.kerb.keytab.Keytab.load(Keytab.java:143)
    at org.apache.kerby.kerberos.kerb.keytab.Keytab.loadKeytab(Keytab.java:55)
{code}
The part of the code which is responsible for this error is 
[https://github.com/apache/directory-kerby/blob/507c74bc3547e80b7102d3b7e5c753e67b60fb9a/kerby-kerb/kerb-util/src/main/java/org/apache/kerby/kerberos/kerb/keytab/Keytab.java#L199.]
 Here, we are trying to calculate the number of bytes read for an entry. But we 
are not considering the number of bytes denoting the size, which should be 
excluded from the calculation of bytes read for an entry.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to