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
7a28ee14
Commit
7a28ee14
authored
Nov 30, 2015
by
Guus der Kinderen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix NPE in S2S.
parent
cbab2458
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
15 deletions
+8
-15
TLSWrapper.java
src/java/org/jivesoftware/openfire/net/TLSWrapper.java
+8
-15
No files found.
src/java/org/jivesoftware/openfire/net/TLSWrapper.java
View file @
7a28ee14
...
...
@@ -32,7 +32,6 @@ import javax.net.ssl.SSLEngineResult.Status;
import
org.jivesoftware.openfire.Connection
;
import
org.jivesoftware.openfire.spi.ConnectionConfiguration
;
import
org.jivesoftware.openfire.spi.ConnectionType
;
import
org.jivesoftware.openfire.spi.EncryptionArtifactFactory
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -77,17 +76,16 @@ public class TLSWrapper {
try
{
final
EncryptionArtifactFactory
factory
=
new
EncryptionArtifactFactory
(
configuration
);
final
SSLEngine
sslEngine
;
if
(
clientMode
)
{
ssl
Engine
=
factory
.
createClientModeSSLEngine
();
tls
Engine
=
factory
.
createClientModeSSLEngine
();
}
else
{
ssl
Engine
=
factory
.
createServerModeSSLEngine
();
tls
Engine
=
factory
.
createServerModeSSLEngine
();
}
final
SSLSession
sslSession
=
ssl
Engine
.
getSession
();
final
SSLSession
sslSession
=
tls
Engine
.
getSession
();
netBuffSize
=
sslSession
.
getPacketBufferSize
();
appBuffSize
=
sslSession
.
getApplicationBufferSize
();
...
...
@@ -187,27 +185,22 @@ public class TLSWrapper {
* @return the current TLSStatus
*/
public
TLSStatus
getStatus
()
{
TLSStatus
status
=
null
;
if
(
tlsEngineResult
!=
null
&&
tlsEngineResult
.
getStatus
()
==
Status
.
BUFFER_UNDERFLOW
)
{
status
=
TLSStatus
.
UNDERFLOW
;
return
TLSStatus
.
UNDERFLOW
;
}
else
{
if
(
tlsEngineResult
!=
null
&&
tlsEngineResult
.
getStatus
()
==
Status
.
CLOSED
)
{
status
=
TLSStatus
.
CLOSED
;
return
TLSStatus
.
CLOSED
;
}
else
{
switch
(
tlsEngine
.
getHandshakeStatus
())
{
case
NEED_WRAP:
status
=
TLSStatus
.
NEED_WRITE
;
break
;
return
TLSStatus
.
NEED_WRITE
;
case
NEED_UNWRAP:
status
=
TLSStatus
.
NEED_READ
;
break
;
return
TLSStatus
.
NEED_READ
;
default
:
status
=
TLSStatus
.
OK
;
break
;
return
TLSStatus
.
OK
;
}
}
}
return
status
;
}
private
ByteBuffer
resizeApplicationBuffer
(
ByteBuffer
app
)
{
...
...
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