aboutsummaryrefslogtreecommitdiffstats
path: root/jrt
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@oath.com>2021-06-16 10:22:37 +0000
committerHåvard Pettersen <havardpe@oath.com>2021-06-16 10:22:37 +0000
commit9127e177ee46f1ac1b60ed7928650faf6f7f3633 (patch)
treea21e1217acf18826095cdbbb642f1d8a9b7a289d /jrt
parent335bb432c5befa014f8616ffa07328e46f52aba1 (diff)
start with zero size buffers
Diffstat (limited to 'jrt')
-rw-r--r--jrt/src/com/yahoo/jrt/TlsCryptoSocket.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/jrt/src/com/yahoo/jrt/TlsCryptoSocket.java b/jrt/src/com/yahoo/jrt/TlsCryptoSocket.java
index 7ba83d6718e..09bb584c983 100644
--- a/jrt/src/com/yahoo/jrt/TlsCryptoSocket.java
+++ b/jrt/src/com/yahoo/jrt/TlsCryptoSocket.java
@@ -51,11 +51,13 @@ public class TlsCryptoSocket implements CryptoSocket {
public TlsCryptoSocket(SocketChannel channel, SSLEngine sslEngine) {
this.channel = channel;
this.sslEngine = sslEngine;
+ this.wrapBuffer = new Buffer(0);
+ this.unwrapBuffer = new Buffer(0);
SSLSession nullSession = sslEngine.getSession();
- this.wrapBuffer = new Buffer(Math.max(0x8000, nullSession.getPacketBufferSize()));
- this.unwrapBuffer = new Buffer(Math.max(0x8000, nullSession.getPacketBufferSize()));
+ sessionApplicationBufferSize = nullSession.getApplicationBufferSize();
+ sessionPacketBufferSize = nullSession.getPacketBufferSize();
// Note: Dummy buffer as unwrap requires a full size application buffer even though no application data is unwrapped
- this.handshakeDummyBuffer = ByteBuffer.allocate(nullSession.getApplicationBufferSize());
+ this.handshakeDummyBuffer = ByteBuffer.allocate(sessionApplicationBufferSize);
this.handshakeState = HandshakeState.NOT_STARTED;
log.fine(() -> "Initialized with " + sslEngine.toString());
}