RFR: 8357466: Create test for Ciphers that are using ByteBuffers backed by MemorySegments

Matthew Donovan mdonovan at openjdk.org
Thu Aug 28 11:44:42 UTC 2025


On Wed, 27 Aug 2025 19:47:03 GMT, Francesco Andreuzzi <duke at openjdk.org> wrote:

>> This PR extends security tests to use ByteBuffers backed by MemorySegments. Tests in the areas of Signature, Cipher, MessageDigest, and Mac are updated.
>
> test/jdk/javax/crypto/CipherSpi/CipherByteBufferOverwriteTest.java line 127:
> 
>> 125:             System.out.println("All Tests Passed");
>> 126:         } finally {
>> 127:             arena.close();
> 
> Would it make sense to initialize `arena` in a try-with-resources, so you can get rid of the explicit `.close()`?

I considered that for a while but I couldn't see a way to make it work without completely refactoring the whole test.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/26967#discussion_r2307147933


More information about the security-dev mailing list