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
c0713608
Commit
c0713608
authored
Apr 26, 2017
by
Dave Cridland
Committed by
Guus der Kinderen
Apr 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-1322 Do not do EXTERNAL without trusted cert (#786)
parent
560261c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
SASLAuthentication.java
...ava/org/jivesoftware/openfire/net/SASLAuthentication.java
+18
-0
No files found.
src/java/org/jivesoftware/openfire/net/SASLAuthentication.java
View file @
c0713608
...
@@ -192,6 +192,24 @@ public class SASLAuthentication {
...
@@ -192,6 +192,24 @@ public class SASLAuthentication {
{
{
final
Element
result
=
DocumentHelper
.
createElement
(
new
QName
(
"mechanisms"
,
new
Namespace
(
""
,
SASL_NAMESPACE
)
)
);
final
Element
result
=
DocumentHelper
.
createElement
(
new
QName
(
"mechanisms"
,
new
Namespace
(
""
,
SASL_NAMESPACE
)
)
);
for
(
String
mech
:
getSupportedMechanisms
())
{
for
(
String
mech
:
getSupportedMechanisms
())
{
if
(
mech
.
equals
(
"EXTERNAL"
))
{
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
;
}
}
}
if
(
trustedCert
==
false
)
{
continue
;
// Do not offer EXTERNAL.
}
}
final
Element
mechanism
=
result
.
addElement
(
"mechanism"
);
final
Element
mechanism
=
result
.
addElement
(
"mechanism"
);
mechanism
.
setText
(
mech
);
mechanism
.
setText
(
mech
);
}
}
...
...
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