-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8362268 : NPE thrown from SASL GSSAPI impl when TLS is used with QOP auth-int against Active Directory #26566
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
base: master
Are you sure you want to change the base?
Changes from all commits
ea2d289
c44693c
20eba8f
1bd7c0f
c7c0662
3b9b1ba
a33666e
f5a13b0
0852897
666dfe0
765a467
dd21da3
e849f21
0d6e178
ae1ca7d
c3a135f
95228ac
ee8ebf6
a92365a
77b418d
fab7226
eb7042b
0ae8e02
d0601e6
9b71e67
4dd2066
c69d484
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,11 +27,7 @@ | |
| import javax.net.SocketFactory; | ||
| import java.net.InetAddress; | ||
| import java.net.Socket; | ||
| import java.net.SocketAddress; | ||
| import java.io.ByteArrayInputStream; | ||
| import java.io.IOException; | ||
| import java.io.InputStream; | ||
| import java.io.OutputStream; | ||
| import java.util.Hashtable; | ||
|
|
||
| import jdk.test.lib.process.OutputAnalyzer; | ||
|
|
@@ -65,6 +61,7 @@ public void runCloseSocketScenario() throws Exception { | |
| props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); | ||
| props.put(Context.PROVIDER_URL, "ldap://localhost:1389/o=example"); | ||
| props.put("java.naming.ldap.factory.socket", CustomSocketFactory.class.getName()); | ||
| props.put("com.sun.jndi.ldap.connect.timeout", 100+""); | ||
| try { | ||
| final DirContext ctx = new InitialDirContext(props); | ||
| } catch (Exception e) { | ||
|
|
@@ -112,48 +109,8 @@ public Socket createSocket(InetAddress address, int port, | |
| } | ||
| } | ||
|
|
||
| private static class LdapInputStream extends InputStream { | ||
| private ByteArrayInputStream bos; | ||
|
|
||
| public LdapInputStream() { | ||
| } | ||
|
|
||
| @Override | ||
| public int read() throws IOException { | ||
| bos = new ByteArrayInputStream(BIND_RESPONSE); | ||
| return bos.read(); | ||
| } | ||
| } | ||
|
|
||
| private static class LdapOutputStream extends OutputStream { | ||
|
|
||
| @Override | ||
| public void write(int b) throws IOException { | ||
| System.out.println("output stream writing"); | ||
| } | ||
|
|
||
| @Override | ||
| public void flush() throws IOException { | ||
| System.out.println(BAD_FLUSH); | ||
| throw new IOException(BAD_FLUSH); | ||
| } | ||
| } | ||
|
|
||
| private static class CustomSocket extends Socket { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: could you please cleanup unused imports after this change? |
||
| private int closeMethodCalled = 0; | ||
| private LdapOutputStream output = new LdapOutputStream(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe these are local objects which are no longer used after removal of this. I'd personally remove the |
||
| private LdapInputStream input = new LdapInputStream(); | ||
|
|
||
| public void connect(SocketAddress address, int timeout) { | ||
| } | ||
|
|
||
| public InputStream getInputStream() { | ||
| return input; | ||
| } | ||
|
|
||
| public OutputStream getOutputStream() { | ||
| return output; | ||
| } | ||
|
|
||
| public int closeMethodCalledCount() { | ||
| return closeMethodCalled; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be worth keeping a comment here about why
sockis not closed, or at least mentioning 8362268?