JNA 3.4.0

Mar 29, 2012 at 6:39 PM

Hi there,

I've recently upgraded to WAFFLE 1.4.  I automatically picked up the latest JNA 3.4.0 (and 'platform' component too).  This combination does not function correctly -- all log on attempts fail in Secur32.AcceptSecurityContext().  JNA 3.3.0 works just fine.

FYI, I'm using the NegotiateSecurityFilter with latest Jetty 8 and a standard set of servlets.

I've debugged this in parallel in two environments, one with 3.3.0 and the other with 3.4.0, and all the steps are identical, and the parameters to the above method appear to be the same.

I've had a look at the deltas between the two versions, and cannot see anything obvious that would have changed.

It's no big deal to downgrade to JNA 3.3.0, but I'd be interested to find out what is causing it.

Thanks in advance!

Coordinator
Mar 29, 2012 at 8:55 PM

Looks weird. I'd say there's really no reason why it would not work with JNA 3.4.0.

Developer
Apr 1, 2012 at 1:22 AM

Hi,

I had the same issue and had to go back to JNA 3.3.0, however in my case I got a specific exception.

I can't remember the details now and I'll try to reproduce it when I'm back at work, but I think it was a NoSuchMethodError on some utility class from JNA.

Coordinator
Apr 3, 2012 at 11:05 AM

A specific error would be nice. Otherwise build waffle with JNA 3.4.0 and make sure tests pass.

Apr 3, 2012 at 5:15 PM

Sorry, I've been rather snowed under with other work, and unable to do any investigation.

The error message is:

error logging in user: The token supplied to the function is invalid

This occurs whether integrated security is enabled or not.

As I say, the values passed into Secur32.AcceptSecurityContext() *look* identical with both JNA 3.3.0 and 3.4.0 (even the same token bytes).  It's the return result (OK for 3.3.0, some error for 3.4.0) that differs.

I'm running Windows 7 x64.

I'll look at the unit tests for WAFFLE soon.

Apr 3, 2012 at 5:50 PM

OK, I've had a look at the unit tests.

With JNA 3.3.0, the main unit tests pass.  (I have some failure, e.g. testImpersonateEnabled fails in its setUp, but I'm not so bothered about that.)

With JNA 3.4.0, the following tests fail:

waffle.servlet.NegoatiateSecurityFilterLoadTests.testLoad

waffle.windows.auth.WindowsSecurityContextTests.testNegotiate

waffle.windows.auth.WindowsAuthProviderLoadTests.testLoad

waffle.servlet.NegoatiateSecurityFilterTests.testNegotiate, testChallengePOST, testChallengeNTLMPOST, testChallengeNTLMPUT

waffle.servlet.windows.auth.WindowsAuthProviderTests.<most>

Those that fail with an uncaught exception are failing with "The token supplied to the function is invalid".  (No big surprise.)  Those that fail because of assertion errors look like (from a casual glance at your unit tests) they have expected to have been authenticated, but are not authenticating now.

Can you reproduce that behaviour on your system?

Coordinator
Apr 3, 2012 at 11:44 PM

There were quite a few changes in JNA 3.4.0 around DLL loading. Let me know if you find anything tangible. I would otherwise bring it up on the JNA list with a very small repro. 

Developer
Apr 3, 2012 at 11:54 PM

Hm sorry the Exception I mentionned earlier was because I had both JNA 3.3.0 and 3.4.0 on the classpath.

With JNA 3.4.0 only I got the same issue: The token supplied to the function is invalid.

I'm also running Win7 x64.

Coordinator
Jul 9, 2012 at 8:15 PM

To close this thread here, it's a bug in JNA 3.4.0. I fixed it in https://github.com/twall/jna/commit/6439e364647807b6479e9bc99e65c08904ef041c, it will ship with Waffle 1.5.