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

Enhance SSPI function converage and bugfix SecBufferDesc #844

Merged
merged 36 commits into from
Aug 10, 2017

Conversation

matthiasblaesing
Copy link
Member

(Re-)Bind SSPI functions:

  • InitializeSecurityContext
  • AcceptSecurityContext
  • QueryCredentialsAttributes
  • QuerySecurityPackageInfo
  • EncryptMessage
  • DecryptMessage
  • MakeSignature
  • VerifySignature

Add binding for SEC_WINNT_AUTH_IDENTITY structure.

The existing SecBufferDesc binding is replaced as the binding does
not correctly map the native structure. The pBuffers member is not
an array of SecBuffer.ByReference, but a pointer to an array of
SecBuffer's. This manifests when more than one buffer is specified.

The SecBufferDesc structure is the literal transliteration of the
native C header. In addition a ManagedSecBufferDesc was introduced, that
allows easy access to its members, as long, as the structure is managed
from the java side.

Closes: #843

matthiasblaesing and others added 30 commits May 17, 2017 20:37
…nalyser_fix_version

The ant-elfanalyser helper ant task should be compiled with source/target version
When native interface is changed the files under lib/native are
invalidated and replace with out-of-date.jar. This will cause the
ELFAnalyserTest to fail.

It is expected, that the dist files will be more stable than the
lib/native files.
…es-get-env

Get JNIEnv pointer and support direct mapping with OPTION_ALLOW_OBJECTS
The ELFAnalyser analyses the java binary to determine, whether the
hardfloat/softfloat flags are set. This causes issues if a security
manager is in place and limits file accessibility.

The JNA code base needs read access on the /proc/self/exe symlink and
the referenced binary.

This change reduces the cases where the executing binary is read. On
platforms, that don't need it, the detection step is skipped.

Close: java-native-access#825
…e_security_manager_exposure

Only analyse binary to determine hardfloat vs. softfloat on arm
matthiasblaesing and others added 6 commits August 5, 2017 12:19
- MonitorFromPoint takes a structure, not a reference to a structure,
  so function definition was wrong
- The last to "KnownFolters" don't resolve on Win10
(unmappable character for encoding ascii)
…nittests

 Fix unittests (IShellFolderTest#testEnumObjects) still fails on amd64)
…ncoding

Compilation of unittests fails in debian squeeze chroot
(Re-)Bind SSPI functions:
- InitializeSecurityContext
- AcceptSecurityContext
- QueryCredentialsAttributes
- QuerySecurityPackageInfo
- EncryptMessage
- DecryptMessage
- MakeSignature
- VerifySignature

Add binding for SEC_WINNT_AUTH_IDENTITY structure.

The existing SecBufferDesc binding is replaced as the binding does
not correctly map the native structure. The pBuffers member is not
an array of SecBuffer.ByReference, but a pointer to an array of
SecBuffer's. This manifests when more than one buffer is specified.

The SecBufferDesc structure is the literal transliteration of the
native C header. In addition a ManagedSecBufferDesc was introduced, that
allows easy access to its members, as long, as the structure is managed
from the java side.

Closes: java-native-access#843
@matthiasblaesing
Copy link
Member Author

@dblock @twall Please have another look at this. Don't be irritated by the number of commits - I merged master into jna-5.0.0 and rebased the SSPI enhancements on that. The interesting part is 9771b59, everything else comes from master.

I'm still not convinced that breaking API is a good idea, I just think that having this out-of-tree is even worse. I'd have preferred #839.

@dblock
Copy link
Member

dblock commented Aug 9, 2017

Lets get master -> jna-5.0.0 merged first? Maybe just go for it?

I can look at the rest later.

@dblock
Copy link
Member

dblock commented Aug 9, 2017

9771b59 looks good to me! I would merge it to JNA master right now, too ;)

@matthiasblaesing matthiasblaesing merged commit b6bed2d into java-native-access:jna-5.0.0 Aug 10, 2017
@matthiasblaesing
Copy link
Member Author

Merged - thank you for looking into this.

@dblock
Copy link
Member

dblock commented Aug 11, 2017

I am glad these important fixes are making it into JNA, thanks for hanging on @matthiasblaesing, great work! Say hi if ever in NYC.

@matthiasblaesing matthiasblaesing deleted the sspi2 branch August 12, 2017 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants