8172273: SSLEngine.unwrap fails with ArrayIndexOutOfBoundsException

Reviewed-by: wetmore
This commit is contained in:
Xue-Lei Andrew Fan 2017-01-06 01:09:03 +00:00
parent 03b01bf748
commit ad76f31ded
2 changed files with 18 additions and 2 deletions

View File

@ -242,8 +242,9 @@ class InputRecord implements Record, Closeable {
// 2: ClientHello.client_version
// 32: ClientHello.random
// 1: length byte of ClientHello.session_id
// 2: length bytes of ClientHello.cipher_suites
// 2: empty ClientHello.compression_methods
int requiredSize = 46 + sessionIdLen + ((cipherSpecLen * 2 ) / 3 );
int requiredSize = 48 + sessionIdLen + ((cipherSpecLen * 2 ) / 3 );
byte[] converted = new byte[requiredSize];
/*

View File

@ -22,7 +22,7 @@
/*
* @test
* @bug 8049429
* @bug 8049429 8172273
* @modules java.management
* jdk.crypto.ec/sun.security.ec
* @summary Test that all cipher suites work in all versions and all client
@ -30,6 +30,21 @@
* and all checking is done on the client side.
* @compile CipherTestUtils.java JSSEClient.java JSSEServer.java
* @run main/othervm
* -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2
* -DCLIENT_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2
* -DCIPHER=SSL_RSA_WITH_RC4_128_MD5
* TestJSSE
* @run main/othervm
* -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2
* -DCLIENT_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2
* -DCIPHER=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
* TestJSSE
* @run main/othervm
* -DSERVER_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2
* -DCLIENT_PROTOCOL=SSLv2Hello,SSLv3,TLSv1,TLSv1.1,TLSv1.2
* -DCIPHER=TLS_DHE_RSA_WITH_AES_128_CBC_SHA
* TestJSSE
* @run main/othervm
* -DSERVER_PROTOCOL=SSLv3
* -DCLIENT_PROTOCOL=SSLv3
* -DCIPHER=SSL_RSA_WITH_RC4_128_MD5