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

smbj v0.12.0 breaks Kerberos authentication #775

Closed
bjoernlohrmann opened this issue Jul 13, 2023 · 4 comments · Fixed by frankframework/frankframework#5129
Closed

smbj v0.12.0 breaks Kerberos authentication #775

bjoernlohrmann opened this issue Jul 13, 2023 · 4 comments · Fixed by frankframework/frankframework#5129

Comments

@bjoernlohrmann
Copy link

bjoernlohrmann commented Jul 13, 2023

We will soon be rolling out smbj v0.12.0 as part of our software product. During testing we unfortunately found that the v0.12.0 release breaks Kerberos authentication.

This code results in a NullPointerException (in previous smbj versions this code works):

var builder = SmbConfig.builder() //
    .withMultiProtocolNegotiate(true);

var authContext = new GSSAuthenticationContext(...);

var client = new SMBClient(builder.build())//
    .connect(host, config.getFileserverPort()) //
    .authenticate(authContext);

java.lang.NullPointerException: Cannot read the array length because "buf" is null
	at com.hierynomus.protocol.commons.buffer.Buffer.putRawBytes(Buffer.java:316)
	at com.hierynomus.spnego.RawToken.write(RawToken.java:38)
	at com.hierynomus.smbj.connection.SMBSessionBuilder.processAuthenticationToken(SMBSessionBuilder.java:200)
	at com.hierynomus.smbj.connection.SMBSessionBuilder.setupSession(SMBSessionBuilder.java:165)
	at com.hierynomus.smbj.connection.SMBSessionBuilder.establish(SMBSessionBuilder.java:119)
	at com.hierynomus.smbj.connection.Connection.authenticate(Connection.java:202)

If have (only) tested this against ActitveDirectory and with file share (hosted by the ActiveDirectory DC).

I can offer support in testing bugfix branches against our setup but I am a little out of depth with regard to fixing the SMB protocol implementation myself.

@hierynomus
Copy link
Owner

Oops... let me fix that!

@hierynomus
Copy link
Owner

Fixed it by checking the null-ness of the token.

@hierynomus
Copy link
Owner

0.12.1 is coming up!

@bjoernlohrmann
Copy link
Author

Thank you for the fast bugfix! I can confirm that for our tests v0.12.1 fixes the Kerberos issue.

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 a pull request may close this issue.

2 participants