Skip to content

Commit

Permalink
Merge pull request #1398 from dbwiddis/maxtokensize
Browse files Browse the repository at this point in the history
Increase Sspi#MAX_TOKEN_SIZE on Windows 8/Server 2012 and later
  • Loading branch information
dblock committed Nov 28, 2021
2 parents ba80848 + de853f3 commit 7dbbf4b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
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
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 7dbbf4b

Please sign in to comment.