Commit f262e973 authored by Guus der Kinderen's avatar Guus der Kinderen

OF-1322: Preventing a NPE, removing an unneeded nullcheck.

parent b60b6bf9
...@@ -200,7 +200,6 @@ public class SASLAuthentication { ...@@ -200,7 +200,6 @@ public class SASLAuthentication {
boolean trustedCert = false; boolean trustedCert = false;
if (session.isSecure()) { if (session.isSecure()) {
final LocalClientSession localClientSession = (LocalClientSession)session; final LocalClientSession localClientSession = (LocalClientSession)session;
if (localClientSession != null) {
final Connection connection = localClientSession.getConnection(); final Connection connection = localClientSession.getConnection();
final KeyStore keyStore = connection.getConfiguration().getIdentityStore().getStore(); final KeyStore keyStore = connection.getConfiguration().getIdentityStore().getStore();
final KeyStore trustStore = connection.getConfiguration().getTrustStore().getStore(); final KeyStore trustStore = connection.getConfiguration().getTrustStore().getStore();
...@@ -209,7 +208,6 @@ public class SASLAuthentication { ...@@ -209,7 +208,6 @@ public class SASLAuthentication {
trustedCert = true; trustedCert = true;
} }
} }
}
if (trustedCert == false) { if (trustedCert == false) {
continue; // Do not offer EXTERNAL. continue; // Do not offer EXTERNAL.
} }
......
...@@ -184,7 +184,7 @@ public class CertificateManager { ...@@ -184,7 +184,7 @@ public class CertificateManager {
*/ */
public static X509Certificate getEndEntityCertificate(Certificate chain[], public static X509Certificate getEndEntityCertificate(Certificate chain[],
KeyStore certStore, KeyStore trustStore) { KeyStore certStore, KeyStore trustStore) {
if (chain.length == 0) { if (chain == null || chain.length == 0) {
return null; return null;
} }
X509Certificate first = (X509Certificate) chain[0]; X509Certificate first = (X509Certificate) chain[0];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment