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

Mark Powers mpowers at openjdk.org
Tue Feb 7 15:58:33 UTC 2023


On Tue, 7 Feb 2023 13:41:37 GMT, Sean Mullan <mullan at openjdk.org> wrote:

>> 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."

Good idea. It's not obvious what's going on.

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

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



More information about the security-dev mailing list