> `AuthorizationData.writeAuth()` writes entries one by one but does not write 
> the entry count before them. On the read side, `CCacheInputStream.readAuth()` 
> always reads the count first.
> 
> This mismatch does not affect JDK's normal `kinit` command (which never sets 
> auth data), but it causes incorrect ccache content when a `Credentials` 
> object with non-empty auth data is written.
> 
> This fix writes `entry.length` before the loop in `writeAuth()`.
> 
> Testing:
> - Added a regression test that constructs `AuthorizationData` with multiple 
> entries, writes it to an in-memory ccache, reads it back, and verifies the 
> entry count and types match.
> - The test uses internal classes (`sun.security.krb5.internal.*`, 
> `sun.security.krb5.internal.ccache.*`) via `@modules`.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

xiaotaonan has updated the pull request incrementally with two additional 
commits since the last revision:

 - fix: Modify according to the review comments.
 - fix: Modify according to the review comments.

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/34152/files
  - new: https://git.openjdk.org/jdk/pull/34152/files/4dd3bc11..33e596bc

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=34152&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=34152&range=02-03

  Stats: 5 lines in 1 file changed: 2 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/34152.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/34152/head:pull/34152

PR: https://git.openjdk.org/jdk/pull/34152

Reply via email to