JDK-8176259 : sun/security/ssl/DHKeyExchange/DHEKeySizing.java failed with "Invalid TLS padding data"
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.net.ssl
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • Submitted: 2017-03-07
  • Updated: 2019-02-11
  • Resolved: 2017-09-27
Related Reports
Relates :  
Description
Test: sun/security/ssl/DHKeyExchange/DHEKeySizing.java

Occurred in: SunOS 5.12 (sparcv9)

Log:
There is not much help from the log except the exception stack:
Mode: othervm [/othervm specified]
elapsed time (seconds): 2.606
----------configuration:(0/0)----------
----------System.out:(19/476)----------
AppOut1 = java.nio.HeapByteBuffer[pos=0 lim=26 cap=26]
AppOut2 = java.nio.HeapByteBuffer[pos=0 lim=29 cap=29]

======================================
===================
client hello
running delegated task...
===================
ServerHello
Message length of ServerHello series: 1255
running delegated task...
===================
Key Exchange
Message length of ClientKeyExchange: 75
running delegated task...
===================
Client CCS
===================
Client Finished
----------System.err:(30/2056)----------
javax.net.ssl.SSLHandshakeException: Invalid TLS padding data
	at java.base/sun.security.ssl.Alerts.getSSLException(Alerts.java:198)
	at java.base/sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1830)
	at java.base/sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1735)
	at java.base/sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:994)
	at java.base/sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:902)
	at java.base/sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:680)
	at java.base/javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:626)
	at DHEKeySizing.test(DHEKeySizing.java:333)
	at DHEKeySizing.main(DHEKeySizing.java:393)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:547)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110)
	at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: javax.crypto.BadPaddingException: Invalid TLS padding data
	at java.base/sun.security.ssl.CipherBox.removePadding(CipherBox.java:802)
	at java.base/sun.security.ssl.CipherBox.decrypt(CipherBox.java:574)
	at java.base/sun.security.ssl.InputRecord.decrypt(InputRecord.java:404)
	at java.base/sun.security.ssl.InputRecord.decrypt(InputRecord.java:378)
	at java.base/sun.security.ssl.SSLEngineInputRecord.decodeInputRecord(SSLEngineInputRecord.java:253)
	at java.base/sun.security.ssl.SSLEngineInputRecord.decode(SSLEngineInputRecord.java:199)
	at java.base/sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:975)
	... 11 more

JavaTest Message: Test threw exception: javax.net.ssl.SSLHandshakeException: Invalid TLS padding data
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: javax.net.ssl.SSLHandshakeException: Invalid TLS padding data
Comments
This failures looks to be related to JDK-8172005. Should we merge those bugs?
07-03-2017

Siba, On what machine did it fail? Aurora should provide all the details about machine. You can find all this info in Aurora report. Could you please provide this link? Is it reproducible on that machine? On what machine did the test pass? What's Solaris installed on those machines?
07-03-2017