You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Colm O hEigeartaigh (Jira)" <ji...@apache.org> on 2025/07/31 10:52:00 UTC

[jira] [Assigned] (DIRKRB-777) Cannot decode HostAddress using CredCacheInputStream

     [ https://issues.apache.org/jira/browse/DIRKRB-777?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colm O hEigeartaigh reassigned DIRKRB-777:
------------------------------------------

    Assignee: Colm O hEigeartaigh

> Cannot decode HostAddress using CredCacheInputStream
> ----------------------------------------------------
>
>                 Key: DIRKRB-777
>                 URL: https://issues.apache.org/jira/browse/DIRKRB-777
>             Project: Directory Kerberos
>          Issue Type: Bug
>    Affects Versions: 2.1.0
>            Reporter: Guotao Yu
>            Assignee: Colm O hEigeartaigh
>            Priority: Blocker
>
> In CredCacheOutputStream, HostAddress is serialized in this way.
>  
> {code:java}
> public void writeAddress(HostAddress address) throws IOException {
>     write(address.getAddrType().getValue());
>     write(address.getAddress().length);
>     write(address.getAddress(), 0,
>           address.getAddress().length);
> } {code}
> HostAddrType is serialized as an int type, However, in CredCacheInputStream, it is read as a short type.
> {code:java}
> public HostAddress readAddress() throws IOException {
>     int typeValue = readShort();
>     HostAddrType addrType = HostAddrType.fromValue(typeValue);
>     if (addrType == HostAddrType.NONE) {
>         throw new IOException("Invalid host address type");
>     }
>     byte[] addrData = readCountedOctets();
>     if (addrData == null) {
>         throw new IOException("Invalid host address data");
>     }
>     HostAddress addr = new HostAddress();
>     addr.setAddrType(addrType);
>     addr.setAddress(addrData);
>     return addr;
> } {code}
> This results in the deserialized HostAddrType being an illegal type.
> So for me the library is unusable.
> h4. 
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org
For additional commands, e-mail: dev-help@directory.apache.org