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

Matthew Donovan duke at openjdk.org
Wed Feb 1 15:16:52 UTC 2023


On Tue, 31 Jan 2023 16:54:03 GMT, Mark Powers <mpowers at openjdk.org> wrote:

> https://bugs.openjdk.org/browse/JDK-8300416

test/jdk/java/security/MessageDigest/TestCloneable.java line 95:

> 93: 
> 94:         System.out.println(": Shared data check");
> 95:         if (!Arrays.equals(d1.digest(), d2.digest())) {

If d1 and d2 don't share memory and each thread processes random bytes, how can the digests be equal?

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

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



More information about the security-dev mailing list