Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeException: Cipher Cipher.ChaCha20-Poly1305, mode: decryption, algorithm from: SunJCE, in: 1024, expOut: 6128, actual: 1008 #9079

Closed
JasonFengJ9 opened this issue Apr 1, 2020 · 12 comments
Assignees

Comments

@JasonFengJ9
Copy link
Member

Failure link

From an internal build Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/71:

22:57:00  openjdk version "14-internal" 2020-03-17
22:57:00  OpenJDK Runtime Environment (build 14-internal+0-adhoc.jenkins.BuildJDK14x86-64linuxNightly)
22:57:00  Eclipse OpenJ9 VM (build ibm_sdk-6524ef4426, JRE 14 Linux amd64-64-Bit Compressed References 20200331_75 (JIT enabled, AOT enabled)
22:57:00  OpenJ9   - 6524ef4426
22:57:00  OMR      - f719b35c8
22:57:00  JCL      - 77c5e421a5e based on jdk-14+36)

Optional info

Failure output (captured from console output)

23:32:34  STDERR:
23:32:34  java.lang.RuntimeException: Cipher Cipher.ChaCha20-Poly1305, mode: decryption, algorithm from: SunJCE, in: 1024, expOut: 6128, actual: 1008
23:32:34  	at OutputSizeTest.testOutLen(OutputSizeTest.java:170)
23:32:34  	at OutputSizeTest.testCC20P1305GetOutSize(OutputSizeTest.java:118)
23:32:34  	at OutputSizeTest.main(OutputSizeTest.java:48)
23:32:34  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
23:32:34  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
23:32:34  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
23:32:34  	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
23:32:34  	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
23:32:34  	at java.base/java.lang.Thread.run(Thread.java:835)
23:32:34  
23:32:34  JavaTest Message: Test threw exception: java.lang.RuntimeException
23:32:34  JavaTest Message: shutting down test
23:32:34  
23:32:34  
23:32:34  TEST RESULT: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Cipher Cipher.ChaCha20-Poly1305, mode: decryption, algorithm from: SunJCE, in: 1024, expOut: 6128, actual: 1008
23:32:34  --------------------------------------------------
23:32:45  Test results: passed: 91; failed: 1

To rebuild the failed tests in =https://hyc-runtimes-jenkins.swg-devops.com/job/Grinder, use the following links: https://hyc-runtimes-jenkins.swg-devops.com/job/Grinder/parambuild/?JDK_VERSION=14&JDK_IMPL=openj9&BUILD_LIST=openjdk&PLATFORM=x86-64_linux&TARGET=jdk11_tier1_cipher_0

@pshipton
Copy link
Member

pshipton commented Apr 2, 2020

@ashbm5 pls investigate.

Investigation of a similar failure (javanext/issues/180) showed it only failed on internal ub16 machines, however the failure reported above is on cent6x64rt3-1.
With the similar failure -Djdk.nativeChaCha20=false appeared to fix the failure.

@samasri
Copy link

samasri commented Apr 2, 2020

I will look into this

@pshipton
Copy link
Member

pshipton commented Apr 2, 2020

@JasonFengJ9 you don't actually provide the failed test name. It would be helpful to include this in future issues.
i.e. com/sun/crypto/provider/Cipher/ChaCha20/OutputSizeTest.java

@pshipton
Copy link
Member

pshipton commented Apr 2, 2020

.jtr output from the failure artifact.

#Test Results (version 2)
#Tue Mar 31 20:32:31 PDT 2020
#-----testdescription-----
$file=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/OutputSizeTest.java
$root=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk
keywords=bug8224997
library=/test/lib
run=USER_SPECIFIED build jdk.test.lib.Convert\nUSER_SPECIFIED main OutputSizeTest\n
source=OutputSizeTest.java
title=ChaCha20-Poly1305 TLS cipher suite decryption throws ShortBufferException

#-----environment-----

#-----testresult-----
description=file\:/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/OutputSizeTest.java
elapsed=259 0\:00\:00.259
end=Tue Mar 31 20\:32\:31 PDT 2020
environment=regtest
execStatus=Failed. Execution failed\: `main' threw exception\: java.lang.RuntimeException\: Cipher Cipher.ChaCha20-Poly1305, mode\: decryption, algorithm from\: SunJCE, in\: 1024, expOut\: 6128, actual\: 1008
harnessLoaderMode=Classpath Loader
harnessVariety=Full Bundle
hostname=torfyre3201.canlab.ibm.com
javatestOS=Linux 2.6.32-754.27.1.el6.x86_64 (amd64)
javatestVersion=6.0-ea+b08-2020-03-31
jtregVersion=jtreg 5.0 dev 774
script=com.sun.javatest.regtest.exec.RegressionScript
sections=script_messages build build compile main
start=Tue Mar 31 20\:32\:31 PDT 2020
test=com/sun/crypto/provider/Cipher/ChaCha20/OutputSizeTest.java
testJDK=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdkbinary/j2sdk-image
totalTime=262
user.name=jenkins
work=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/com/sun/crypto/provider/Cipher/ChaCha20

#section:script_messages
----------messages:(10/836)----------
JDK under test: /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdkbinary/j2sdk-image
openjdk version "14-internal" 2020-03-17
OpenJDK Runtime Environment (build 14-internal+0-adhoc.jenkins.BuildJDK14x86-64linuxNightly)
Eclipse OpenJ9 VM (build ibm_sdk-6524ef4426, JRE 14 Linux amd64-64-Bit Compressed References 20200331_75 (JIT enabled, AOT enabled)
OpenJ9   - 6524ef4426
OMR      - f719b35c8
JCL      - 77c5e421a5e based on jdk-14+36)
Library /test/lib; kind: packages
   source directory: /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/lib
   class directory: /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/classes/0/test/lib

#section:build
----------messages:(3/127)----------
command: build jdk.test.lib.Convert
reason: User specified action: run build jdk.test.lib.Convert 
elapsed time (seconds): 0.0
result: Passed. All files up to date

#section:build
----------messages:(5/141)----------
command: build OutputSizeTest
reason: Named class compiled on demand
Test directory:
  compile: OutputSizeTest
elapsed time (seconds): 0.206
result: Passed. Build successful

#section:compile
----------messages:(5/304)----------
command: compile /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/OutputSizeTest.java
reason: .class file out of date or does not exist
Mode: agentvm
Agent id: 2
elapsed time (seconds): 0.205
----------configuration:(12/1425)----------
Boot Layer (javac runtime environment)
  class path: /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/jvmtest/openjdk/jtreg/lib/javatest.jar 
              /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/jvmtest/openjdk/jtreg/lib/jtreg.jar 
  patch:      java.base /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/patches/java.base

javac compilation environment
  source path: /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20
               /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/lib
  class path:  /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20
               /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/classes/0/com/sun/crypto/provider/Cipher/ChaCha20/OutputSizeTest.d
               /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/classes/0/test/lib

----------rerun:(27/4341)*----------
cd /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/scratch/0 && \\
DISPLAY=:0 \\
HOME=/home/jenkins \\
LANG=en_US.UTF-8 \\
PATH=/bin:/usr/bin:/usr/sbin \\
    /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdkbinary/j2sdk-image/bin/javac \\
        -J-ea \\
        -J-esa \\
        -J-Xmx512m \\
        -J-Xcompressedrefs \\
        -J-Dtest.class.path.prefix=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/classes/0/com/sun/crypto/provider/Cipher/ChaCha20/OutputSizeTest.d:/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20:/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/classes/0/test/lib \\
        -J-Dtest.file=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/OutputSizeTest.java \\
        -J-Dtest.src=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20 \\
        -J-Dtest.src.path=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20:/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/lib \\
        -J-Dtest.classes=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/classes/0/com/sun/crypto/provider/Cipher/ChaCha20/OutputSizeTest.d \\
        -J-Dtest.class.path=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/classes/0/com/sun/crypto/provider/Cipher/ChaCha20/OutputSizeTest.d:/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/classes/0/test/lib \\
        -J-Dtest.vm.opts='-ea -esa -Xmx512m -Xcompressedrefs' \\
        -J-Dtest.tool.vm.opts='-J-ea -J-esa -J-Xmx512m -J-Xcompressedrefs' \\
        -J-Dtest.compiler.opts= \\
        -J-Dtest.java.opts= \\
        -J-Dtest.jdk=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdkbinary/j2sdk-image \\
        -J-Dcompile.jdk=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdkbinary/j2sdk-image \\
        -J-Dtest.timeout.factor=8.0 \\
        -J-Dtest.root=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk \\
        -d /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/classes/0/com/sun/crypto/provider/Cipher/ChaCha20/OutputSizeTest.d \\
        -sourcepath /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20:/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/lib \\
        -classpath /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20:/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/classes/0/com/sun/crypto/provider/Cipher/ChaCha20/OutputSizeTest.d:/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/classes/0/test/lib /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/OutputSizeTest.java
result: Passed. Compilation successful

#section:main
----------messages:(5/141)----------
command: main OutputSizeTest
reason: User specified action: run main OutputSizeTest 
Mode: agentvm
Agent id: 2
elapsed time (seconds): 0.051
----------configuration:(11/1198)----------
Boot Layer
  class path: /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/jvmtest/openjdk/jtreg/lib/javatest.jar 
              /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/jvmtest/openjdk/jtreg/lib/jtreg.jar 
  patch:      java.base /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/patches/java.base

Test Layer
  class path: /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/classes/0/com/sun/crypto/provider/Cipher/ChaCha20/OutputSizeTest.d
              /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20
              /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/classes/0/test/lib
              /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/lib

----------rerun:(22/3887)*----------
cd /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/scratch/0 && \\
DISPLAY=:0 \\
HOME=/home/jenkins \\
LANG=en_US.UTF-8 \\
PATH=/bin:/usr/bin:/usr/sbin \\
    /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdkbinary/j2sdk-image/bin/java \\
        -Dtest.class.path.prefix=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/classes/0/com/sun/crypto/provider/Cipher/ChaCha20/OutputSizeTest.d:/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20:/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/classes/0/test/lib \\
        -Dtest.file=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/OutputSizeTest.java \\
        -Dtest.src=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20 \\
        -Dtest.src.path=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20:/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/lib \\
        -Dtest.classes=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/classes/0/com/sun/crypto/provider/Cipher/ChaCha20/OutputSizeTest.d \\
        -Dtest.class.path=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/classes/0/com/sun/crypto/provider/Cipher/ChaCha20/OutputSizeTest.d:/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/classes/0/test/lib \\
        -Dtest.vm.opts='-ea -esa -Xmx512m -Xcompressedrefs' \\
        -Dtest.tool.vm.opts='-J-ea -J-esa -J-Xmx512m -J-Xcompressedrefs' \\
        -Dtest.compiler.opts= \\
        -Dtest.java.opts= \\
        -Dtest.jdk=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdkbinary/j2sdk-image \\
        -Dcompile.jdk=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdkbinary/j2sdk-image \\
        -Dtest.timeout.factor=8.0 \\
        -Dtest.root=/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk \\
        -classpath /home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/classes/0/com/sun/crypto/provider/Cipher/ChaCha20/OutputSizeTest.d:/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20:/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/TKG/test_output_15857099282589/jdk11_tier1_cipher_0/work/classes/0/test/lib:/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/openjdk-tests/openjdk/openjdk-jdk/test/lib:/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/jvmtest/openjdk/jtreg/lib/javatest.jar:/home/jenkins/workspace/Test_openjdk14_j9_sanity.openjdk_x86-64_linux_Nightly/jvmtest/openjdk/jtreg/lib/jtreg.jar \\
        OutputSizeTest
----------System.err:(14/924)----------
java.lang.RuntimeException: Cipher Cipher.ChaCha20-Poly1305, mode: decryption, algorithm from: SunJCE, in: 1024, expOut: 6128, actual: 1008
	at OutputSizeTest.testOutLen(OutputSizeTest.java:170)
	at OutputSizeTest.testCC20P1305GetOutSize(OutputSizeTest.java:118)
	at OutputSizeTest.main(OutputSizeTest.java:48)
	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:564)
	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
	at java.base/java.lang.Thread.run(Thread.java:835)

JavaTest Message: Test threw exception: java.lang.RuntimeException
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Cipher Cipher.ChaCha20-Poly1305, mode: decryption, algorithm from: SunJCE, in: 1024, expOut: 6128, actual: 1008


test result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Cipher Cipher.ChaCha20-Poly1305, mode: decryption, algorithm from: SunJCE, in: 1024, expOut: 6128, actual: 1008

@pshipton
Copy link
Member

pshipton commented Apr 2, 2020

Note in the duplicate opened for the same failure in Adopt builds, it failed on Windows.
#9085

@JasonFengJ9
Copy link
Member Author

It would be helpful to include this in future issues.
i.e. com/sun/crypto/provider/Cipher/ChaCha20/OutputSizeTest.java

I was hoping the rebuild link is sufficient. Will add such test names in the future.

@pshipton
Copy link
Member

pshipton commented Apr 2, 2020

The rebuild link targets the entire suite jdk11_tier1_cipher_0

@pshipton
Copy link
Member

pshipton commented Apr 4, 2020

@samasri
Copy link

samasri commented Apr 7, 2020

I've been looking more into this and the issue is basically a contradiction between the test expectations and the getOutputSize intention; the comments in the test case contradict the ones in the getOutputSize implementation (in the JDK).

  • The test comments essentially imply the following: outputLen = max(unprocessedInputLen + inputLen - 16, 0)
  • The JDK implementation comments essentially imply the following: outputLen = max(inputLen - 16,0)

The first factors in the length of unprocessed input whereas the second does not.

I inspected the AEAD decrypt update function; it buffers the input and does not process it. Based on that, the first solution seems to be more reasonable. Hence, I will be editing the implementation to follow the description in the test case.

@samasri
Copy link

samasri commented Apr 7, 2020

The implementation is in this commit. I will run other tests on it and then open a PR.

@pshipton
Copy link
Member

pshipton commented Apr 8, 2020

It's too late to put any fixes into the 0.20.0 release, moving forward.

@pshipton
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants