mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8241960: The SHA3 message digests impl of SUN provider are not thread safe after cloned
Fix sun.security.provider.SHA3 class to correctly clone its lanes field Reviewed-by: valeriep
This commit is contained in:
parent
512644de06
commit
76d534986b
2 changed files with 164 additions and 1 deletions
|
@ -62,7 +62,7 @@ abstract class SHA3 extends DigestBase {
|
|||
};
|
||||
|
||||
private byte[] state = new byte[WIDTH];
|
||||
private final long[] lanes = new long[DM*DM];
|
||||
private long[] lanes = new long[DM*DM];
|
||||
|
||||
/**
|
||||
* Creates a new SHA-3 object.
|
||||
|
@ -259,6 +259,7 @@ abstract class SHA3 extends DigestBase {
|
|||
public Object clone() throws CloneNotSupportedException {
|
||||
SHA3 copy = (SHA3) super.clone();
|
||||
copy.state = copy.state.clone();
|
||||
copy.lanes = new long[DM*DM];
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue