mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8246077: Cloneable test in HmacCore seems questionable
Updated java.security.MessageDigest and Signature classes to return Cloneable obj for Cloneable spi obj Reviewed-by: weijun, xuelei, coffeys
This commit is contained in:
parent
c55b06a4d5
commit
f968f32789
7 changed files with 377 additions and 32 deletions
|
@ -75,6 +75,7 @@ abstract class HmacCore extends MacSpi implements Cloneable {
|
|||
} else {
|
||||
String noCloneProv = md.getProvider().getName();
|
||||
// if no Sun provider, use provider list
|
||||
md = null;
|
||||
Provider[] provs = Security.getProviders();
|
||||
for (Provider p : provs) {
|
||||
try {
|
||||
|
@ -90,6 +91,10 @@ abstract class HmacCore extends MacSpi implements Cloneable {
|
|||
continue;
|
||||
}
|
||||
}
|
||||
if (md == null) {
|
||||
throw new NoSuchAlgorithmException
|
||||
("No Cloneable digest found for " + digestAlgo);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.md = md;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue