mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8214321: Misleading code in SSLCipher
Reviewed-by: ascarpino
This commit is contained in:
parent
b1c4b461f1
commit
23ecdbbc1d
1 changed files with 5 additions and 5 deletions
|
@ -530,22 +530,22 @@ enum SSLCipher {
|
||||||
ProtocolVersion protocolVersion,
|
ProtocolVersion protocolVersion,
|
||||||
SecretKey key, IvParameterSpec iv,
|
SecretKey key, IvParameterSpec iv,
|
||||||
SecureRandom random) throws GeneralSecurityException {
|
SecureRandom random) throws GeneralSecurityException {
|
||||||
if (readCipherGenerators.length == 0) {
|
if (writeCipherGenerators.length == 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteCipherGenerator rcg = null;
|
WriteCipherGenerator wcg = null;
|
||||||
for (Map.Entry<WriteCipherGenerator,
|
for (Map.Entry<WriteCipherGenerator,
|
||||||
ProtocolVersion[]> me : writeCipherGenerators) {
|
ProtocolVersion[]> me : writeCipherGenerators) {
|
||||||
for (ProtocolVersion pv : me.getValue()) {
|
for (ProtocolVersion pv : me.getValue()) {
|
||||||
if (protocolVersion == pv) {
|
if (protocolVersion == pv) {
|
||||||
rcg = me.getKey();
|
wcg = me.getKey();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rcg != null) {
|
if (wcg != null) {
|
||||||
return rcg.createCipher(this, authenticator,
|
return wcg.createCipher(this, authenticator,
|
||||||
protocolVersion, transformation, key, iv, random);
|
protocolVersion, transformation, key, iv, random);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue