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

.NET implementation uses fixed buffer size #114

Closed
kentcb opened this issue Jul 13, 2014 · 3 comments
Closed

.NET implementation uses fixed buffer size #114

kentcb opened this issue Jul 13, 2014 · 3 comments

Comments

@kentcb
Copy link
Contributor

kentcb commented Jul 13, 2014

The .NET implementation uses a buffer size specified by Secur32.MAX_TOKEN_SIZE, which is currently set to 12KB. For tokens that exceed this size, an exception is raised:

System.ComponentModel.Win32Exception (0x80004005): The buffers supplied to a function was too small
   at Waffle.Windows.AuthProvider.WindowsSecurityContext..ctor(String username, WindowsCredentialsHandle credentials, String securityPackage, Int32 fContextReq, Int32 targetDataRep)
   at Waffle.Windows.AuthProvider.WindowsSecurityContext.GetCurrent(String package, String targetName, Int32 fContextReq, Int32 targetDataRep)

A similar issue in the Java implementation was fixed around a year ago (see ebedaf7). The .NET implementation should take the same approach.

@hazendaz
Copy link
Member

@kentcb Is it possible that you can do a pull request for this? I see where i think the issue is and understand what you need fixed, however, I'm not a .net developer nor have anything setup to run tests verifying the fix so need a little help.

@kentcb
Copy link
Contributor Author

kentcb commented Jul 20, 2014

@hazendaz yes, I plan on doing this once I return to Australia later this week.

kentcb added a commit to kentcb/waffle that referenced this issue Jul 29, 2014
Where relevant, tokens are obtained in a loop with an increasing buffer size as long as SEC_E_BUFFER_TOO_SMALL or SEC_E_INSUFFICIENT_MEMORY is returned.
@dblock dblock closed this as completed in 6a8bd45 Jul 31, 2014
@dblock
Copy link
Collaborator

dblock commented Jul 31, 2014

Fixed via 6a8bd45, thanks @kentcb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants