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
b724b3fa
Commit
b724b3fa
authored
Nov 14, 2014
by
Dave Cridland
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #108 from wmz7year/fixCertificateManager
Update CertificateManager.java
parents
6bc0ac29
eb9144d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
CertificateManager.java
src/java/org/jivesoftware/util/CertificateManager.java
+10
-4
No files found.
src/java/org/jivesoftware/util/CertificateManager.java
View file @
b724b3fa
...
@@ -377,15 +377,20 @@ public class CertificateManager {
...
@@ -377,15 +377,20 @@ public class CertificateManager {
return
Collections
.
emptyList
();
return
Collections
.
emptyList
();
}
}
// Use the type OtherName to search for the certified server name
// Use the type OtherName to search for the certified server name
for
(
List
item
:
altNames
)
{
for
(
List
<?>
item
:
altNames
)
{
Integer
type
=
(
Integer
)
item
.
get
(
0
);
Integer
type
=
(
Integer
)
item
.
get
(
0
);
if
(
type
==
0
)
{
if
(
type
==
0
)
{
// Type OtherName found so return the associated value
// Type OtherName found so return the associated value
try
{
try
{
// Value is encoded using ASN.1 so decode it to get the server's identity
// Value is encoded using ASN.1 so decode it to get the server's identity
ASN1InputStream
decoder
=
new
ASN1InputStream
((
byte
[])
item
.
get
(
1
));
ASN1InputStream
decoder
=
new
ASN1InputStream
((
byte
[])
item
.
get
(
1
));
ASN1Sequence
otherNameSeq
=
(
ASN1Sequence
)
decoder
.
readObject
();
Object
object
=
decoder
.
readObject
();
ASN1Sequence
otherNameSeq
=
null
;
if
(
object
!=
null
&&
object
instanceof
ASN1Sequence
)
{
otherNameSeq
=
(
ASN1Sequence
)
object
;
}
else
{
continue
;
}
// Check the object identifier
// Check the object identifier
ASN1ObjectIdentifier
objectId
=
(
ASN1ObjectIdentifier
)
otherNameSeq
.
getObjectAt
(
0
);
ASN1ObjectIdentifier
objectId
=
(
ASN1ObjectIdentifier
)
otherNameSeq
.
getObjectAt
(
0
);
Log
.
debug
(
"Parsing otherName for subject alternative names: "
+
objectId
.
toString
()
);
Log
.
debug
(
"Parsing otherName for subject alternative names: "
+
objectId
.
toString
()
);
...
@@ -406,13 +411,14 @@ public class CertificateManager {
...
@@ -406,13 +411,14 @@ public class CertificateManager {
// TODO: there's bound to be a better way...
// TODO: there's bound to be a better way...
identity
=
ato
.
toString
().
substring
(
ato
.
toString
().
lastIndexOf
(
']'
)+
1
).
trim
();
identity
=
ato
.
toString
().
substring
(
ato
.
toString
().
lastIndexOf
(
']'
)+
1
).
trim
();
}
else
{
}
else
{
DERUTF8String
derStr
=
DERUTF8String
.
getInstance
(
o
);
DERUTF8String
derStr
=
DERUTF8String
.
getInstance
(
o
);
identity
=
derStr
.
getString
();
identity
=
derStr
.
getString
();
}
}
if
(
identity
!=
null
&&
identity
.
length
()
>
0
)
{
if
(
identity
!=
null
&&
identity
.
length
()
>
0
)
{
// Add the decoded server name to the list of identities
// Add the decoded server name to the list of identities
identities
.
add
(
identity
);
identities
.
add
(
identity
);
}
}
decoder
.
close
();
}
catch
(
IllegalArgumentException
ex
)
{
}
catch
(
IllegalArgumentException
ex
)
{
// OF-517: othername formats are extensible. If we don't recognize the format, skip it.
// OF-517: othername formats are extensible. If we don't recognize the format, skip it.
Log
.
debug
(
"Cannot parse altName, likely because of unknown record format."
,
ex
);
Log
.
debug
(
"Cannot parse altName, likely because of unknown record format."
,
ex
);
...
...
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