Skip to content

Commit

Permalink
Increase Sspi#MAX_TOKEN_SIZE on Windows 8/Server 2012 and later
Browse files Browse the repository at this point in the history
  • Loading branch information
dbwiddis committed Nov 26, 2021
1 parent ba80848 commit de853f3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Next Release (5.11.0)

Features
--------
* [#1398](https://github.com/java-native-access/jna/pull/1398): Increase `c.s.j.p.win32.Sspi#MAX_TOKEN_SIZE` on Windows 8/Server 2012 and later - [@dbwiddis](https://github.com/dbwiddis).

Bug Fixes
---------
Expand Down
14 changes: 12 additions & 2 deletions contrib/platform/src/com/sun/jna/platform/win32/Sspi.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,19 @@
public interface Sspi {

/**
* Maximum size in bytes of a security token.
* Maximum size in bytes of a security token. {@code MAX_TOKEN_SIZE} has the
* following default value, depending on the version of Windows that builds the
* token:
* <p>
* Windows Server 2008 R2 and earlier versions, and Windows 7 and earlier
* versions: 12,000 bytes. Windows Server 2012 and later versions, and Windows 8
* and later versions: 48,000 bytes
*
* @see <a href=
* "https://docs.microsoft.com/en-us/troubleshoot/windows-server/windows-security/kerberos-authentication-problems-if-user-belongs-to-groups">Problems
* with Kerberos authentication when a user belongs to many groups</a>
*/
int MAX_TOKEN_SIZE = 12288;
int MAX_TOKEN_SIZE = VersionHelpers.IsWindows8OrGreater() ? 48000 : 12000;

// Flags for the fCredentialUse parameter of AcquireCredentialsHandle

Expand Down

0 comments on commit de853f3

Please sign in to comment.