-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fix AES cipher output size issue for z/OS and LOZ #240
Comments
farshadasl
assigned farshadasl, jasonkatonica and johnpeck-us-ibm and unassigned farshadasl
Oct 8, 2024
farshadasl
changed the title
Fix AES/CBC output size issue for z/OS
Fix AES output size issue for z/OS
Oct 9, 2024
farshadasl
changed the title
Fix AES output size issue for z/OS
Fix AES cipher output size issue for z/OS
Oct 9, 2024
jasonkatonica
added a commit
to jasonkatonica/OpenJCEPlus
that referenced
this issue
Oct 14, 2024
When the fast z command is available the AES cipher does not return the correct output size on platform z. Platform z uses a different buffer and output size calculation. The method `engineGetOutputSize` when running on platform z should return and take this into account. A new test was added to exercise byte buffers and various combinations of encryption, decryption, and orders of doFinal and update operations which can be used to recreate the problem. Closes IBM#240 Signed-off-by: Jason Katonica <[email protected]>
jasonkatonica
added a commit
to jasonkatonica/OpenJCEPlus
that referenced
this issue
Oct 14, 2024
When the fast z command is available the AES cipher does not return the correct output size on platform z. Platform z uses a different buffer and output size calculation. The method `engineGetOutputSize` when running on platform z should return and take this into account. A new test was added to exercise byte buffers and various combinations of encryption, decryption, and orders of doFinal and update operations which can be used to recreate the problem. Closes IBM#240 Signed-off-by: Jason Katonica <[email protected]>
jasonkatonica
changed the title
Fix AES cipher output size issue for z/OS
Fix AES cipher output size issue for z/OS and LOZ
Oct 16, 2024
jasonkatonica
added a commit
to jasonkatonica/OpenJCEPlus
that referenced
this issue
Oct 17, 2024
When the fast z command is available the AES cipher does not return the correct output size on platform z. Platform z uses a different buffer and output size calculation. The method `engineGetOutputSize` when running on platform z should return and take this into account. A new test was added to exercise byte buffers and various combinations of encryption, decryption, and orders of doFinal and update operations which can be used to recreate the problem. Closes IBM#240 Signed-off-by: Jason Katonica <[email protected]>
jasonkatonica
added a commit
to jasonkatonica/OpenJCEPlus
that referenced
this issue
Oct 17, 2024
When the fast z command is available the AES cipher does not return the correct output size on platform z. Platform z uses a different buffer and output size calculation. The method `engineGetOutputSize` when running on platform z should return and take this into account. A new test was added to exercise byte buffers and various combinations of encryption, decryption, and orders of doFinal and update operations which can be used to recreate the problem. Closes IBM#240 Signed-off-by: Jason Katonica <[email protected]>
jasonkatonica
added a commit
to jasonkatonica/OpenJCEPlus
that referenced
this issue
Oct 17, 2024
When the fast z command is available the AES cipher does not return the correct output size on platform z. Platform z uses a different buffer and output size calculation. The method `engineGetOutputSize` when running on platform z should return and take this into account. A new test was added to exercise byte buffers and various combinations of encryption, decryption, and orders of doFinal and update operations which can be used to recreate the problem. Closes IBM#240 Signed-off-by: Jason Katonica <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When the fast command is enabled, the AES cipher does not return the correct output size on z/OS.
The simplified failing test on z/OS and LoZ:
The failing JDK test: https://github.com/openjdk/jdk/blob/master/test/jdk/javax/crypto/CipherSpi/ResetByteBuffer.java
Root Cause:
The issue happens when the
use_z_fast_command
is enabled for z platforms only.It uses a different buffer and the
engineGetOutputSize2
method.However, the AESCipher getOutputSize was not using that method, causing the issue and returning the wrong output size on z platforms.
Fix:
The
engineGetOutputSize2
should be renamed to thegetOutputSizeForZ
.Then in the
engineGetOutputSize
method, theuse_z_fast_command
should be checked.If it is true, then it should return
getOutputSizeForZ
.Otherwise, it returns
symmetricCipher.getOutputSize
.The text was updated successfully, but these errors were encountered: