mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8217835: Remove the experimental SunJSSE FIPS compliant mode
Reviewed-by: mullan
This commit is contained in:
parent
5d0ff15a58
commit
fca0af0487
46 changed files with 364 additions and 2350 deletions
|
@ -29,6 +29,7 @@ import java.io.ByteArrayOutputStream;
|
|||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import javax.crypto.SecretKey;
|
||||
|
@ -269,8 +270,13 @@ final class HandshakeHash {
|
|||
private final ByteArrayOutputStream baos;
|
||||
|
||||
S30HandshakeHash(CipherSuite cipherSuite) {
|
||||
this.mdMD5 = JsseJce.getMessageDigest("MD5");
|
||||
this.mdSHA = JsseJce.getMessageDigest("SHA");
|
||||
try {
|
||||
this.mdMD5 = MessageDigest.getInstance("MD5");
|
||||
this.mdSHA = MessageDigest.getInstance("SHA");
|
||||
} catch (NoSuchAlgorithmException nsae) {
|
||||
throw new RuntimeException(
|
||||
"Hash algorithm MD5 or SHA is not available", nsae);
|
||||
}
|
||||
|
||||
boolean hasArchived = false;
|
||||
if (mdMD5 instanceof Cloneable) {
|
||||
|
@ -379,7 +385,12 @@ final class HandshakeHash {
|
|||
"MessageDigest does no support clone operation");
|
||||
}
|
||||
} else {
|
||||
md5Clone = JsseJce.getMessageDigest("MD5");
|
||||
try {
|
||||
md5Clone = MessageDigest.getInstance("MD5");
|
||||
} catch (NoSuchAlgorithmException nsae) {
|
||||
throw new RuntimeException(
|
||||
"Hash algorithm MD5 is not available", nsae);
|
||||
}
|
||||
md5Clone.update(md5.archived());
|
||||
}
|
||||
|
||||
|
@ -396,7 +407,12 @@ final class HandshakeHash {
|
|||
"MessageDigest does no support clone operation");
|
||||
}
|
||||
} else {
|
||||
shaClone = JsseJce.getMessageDigest("SHA");
|
||||
try {
|
||||
shaClone = MessageDigest.getInstance("SHA");
|
||||
} catch (NoSuchAlgorithmException nsae) {
|
||||
throw new RuntimeException(
|
||||
"Hash algorithm SHA is not available", nsae);
|
||||
}
|
||||
shaClone.update(sha.archived());
|
||||
}
|
||||
|
||||
|
@ -447,8 +463,15 @@ final class HandshakeHash {
|
|||
private final ByteArrayOutputStream baos;
|
||||
|
||||
T10HandshakeHash(CipherSuite cipherSuite) {
|
||||
MessageDigest mdMD5 = JsseJce.getMessageDigest("MD5");
|
||||
MessageDigest mdSHA = JsseJce.getMessageDigest("SHA");
|
||||
MessageDigest mdMD5;
|
||||
MessageDigest mdSHA;
|
||||
try {
|
||||
mdMD5 = MessageDigest.getInstance("MD5");
|
||||
mdSHA = MessageDigest.getInstance("SHA");
|
||||
} catch (NoSuchAlgorithmException nsae) {
|
||||
throw new RuntimeException(
|
||||
"Hash algorithm MD5 or SHA is not available", nsae);
|
||||
}
|
||||
|
||||
boolean hasArchived = false;
|
||||
if (mdMD5 instanceof Cloneable) {
|
||||
|
@ -514,8 +537,15 @@ final class HandshakeHash {
|
|||
private final ByteArrayOutputStream baos;
|
||||
|
||||
T12HandshakeHash(CipherSuite cipherSuite) {
|
||||
MessageDigest md =
|
||||
JsseJce.getMessageDigest(cipherSuite.hashAlg.name);
|
||||
MessageDigest md;
|
||||
try {
|
||||
md = MessageDigest.getInstance(cipherSuite.hashAlg.name);
|
||||
} catch (NoSuchAlgorithmException nsae) {
|
||||
throw new RuntimeException(
|
||||
"Hash algorithm " +
|
||||
cipherSuite.hashAlg.name + " is not available", nsae);
|
||||
}
|
||||
|
||||
if (md instanceof Cloneable) {
|
||||
transcriptHash = new CloneableHash(md);
|
||||
this.baos = new ByteArrayOutputStream();
|
||||
|
@ -552,8 +582,15 @@ final class HandshakeHash {
|
|||
private final TranscriptHash transcriptHash;
|
||||
|
||||
T13HandshakeHash(CipherSuite cipherSuite) {
|
||||
MessageDigest md =
|
||||
JsseJce.getMessageDigest(cipherSuite.hashAlg.name);
|
||||
MessageDigest md;
|
||||
try {
|
||||
md = MessageDigest.getInstance(cipherSuite.hashAlg.name);
|
||||
} catch (NoSuchAlgorithmException nsae) {
|
||||
throw new RuntimeException(
|
||||
"Hash algorithm " +
|
||||
cipherSuite.hashAlg.name + " is not available", nsae);
|
||||
}
|
||||
|
||||
if (md instanceof Cloneable) {
|
||||
transcriptHash = new CloneableHash(md);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue