Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
24785a49
Commit
24785a49
authored
Apr 26, 2017
by
Guus der Kinderen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-1322: Preventing a NPE, removing an unneeded nullcheck.
parent
a469be3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
9 deletions
+7
-9
SASLAuthentication.java
...ava/org/jivesoftware/openfire/net/SASLAuthentication.java
+6
-8
CertificateManager.java
src/java/org/jivesoftware/util/CertificateManager.java
+1
-1
No files found.
src/java/org/jivesoftware/openfire/net/SASLAuthentication.java
View file @
24785a49
...
...
@@ -195,14 +195,12 @@ public class SASLAuthentication {
boolean
trustedCert
=
false
;
if
(
session
.
isSecure
())
{
final
LocalClientSession
localClientSession
=
(
LocalClientSession
)
session
;
if
(
localClientSession
!=
null
)
{
final
Connection
connection
=
localClientSession
.
getConnection
();
final
KeyStore
keyStore
=
connection
.
getConfiguration
().
getIdentityStore
().
getStore
();
final
KeyStore
trustStore
=
connection
.
getConfiguration
().
getTrustStore
().
getStore
();
final
X509Certificate
trusted
=
CertificateManager
.
getEndEntityCertificate
(
connection
.
getPeerCertificates
(),
keyStore
,
trustStore
);
if
(
trusted
!=
null
)
{
trustedCert
=
true
;
}
final
Connection
connection
=
localClientSession
.
getConnection
();
final
KeyStore
keyStore
=
connection
.
getConfiguration
().
getIdentityStore
().
getStore
();
final
KeyStore
trustStore
=
connection
.
getConfiguration
().
getTrustStore
().
getStore
();
final
X509Certificate
trusted
=
CertificateManager
.
getEndEntityCertificate
(
connection
.
getPeerCertificates
(),
keyStore
,
trustStore
);
if
(
trusted
!=
null
)
{
trustedCert
=
true
;
}
}
if
(
trustedCert
==
false
)
{
...
...
src/java/org/jivesoftware/util/CertificateManager.java
View file @
24785a49
...
...
@@ -184,7 +184,7 @@ public class CertificateManager {
*/
public
static
X509Certificate
getEndEntityCertificate
(
Certificate
chain
[],
KeyStore
certStore
,
KeyStore
trustStore
)
{
if
(
chain
.
length
==
0
)
{
if
(
chain
==
null
||
chain
.
length
==
0
)
{
return
null
;
}
X509Certificate
first
=
(
X509Certificate
)
chain
[
0
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment