RFR: JDK-8300416 java.security.MessageDigestSpi clone can result in thread-unsafe clones [v4]

Sean Mullan mullan at openjdk.org
Tue Feb 7 13:44:45 UTC 2023


On Thu, 2 Feb 2023 22:24:48 GMT, Mark Powers <mpowers at openjdk.org> wrote:

>> I think you mean line 126? :
>> 
>> `                tempArray = new byte[n];  `
>
> You are correct. How did I come up with 220?

@mcpowers can you also add a comment to the test, maybe right before line 95, with something like I said above: 

"Random is producing the same sequence of bytes for each thread, and thus each MessageDigest should be equal. When the memory is shared, they inevitably overwrite each other's tempArray and you get different results."

@mcpowers can you also add a comment to the test, maybe right before line 95, with something like I said above: 

"Random is producing the same sequence of bytes for each thread, and thus each MessageDigest should be equal. When the memory is shared, they inevitably overwrite each other's tempArray and you get different results."

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

PR: https://git.openjdk.org/jdk/pull/12348



More information about the security-dev mailing list