Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase Sspi#MAX_TOKEN_SIZE on Windows 8/Server 2012 and later #1398

Merged
merged 1 commit into from
Nov 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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