Skip to content

Commit 38df347

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/master'
2 parents 54f34b3 + 693ad38 commit 38df347

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

tls/src/main/java/org/bouncycastle/tls/TlsUtils.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4395,9 +4395,22 @@ public static int[] getSupportedCipherSuites(TlsCrypto crypto, int[] suites, int
43954395

43964396
public static boolean isSupportedCipherSuite(TlsCrypto crypto, int cipherSuite)
43974397
{
4398-
return isSupportedKeyExchange(crypto, getKeyExchangeAlgorithm(cipherSuite))
4399-
&& crypto.hasEncryptionAlgorithm(getEncryptionAlgorithm(cipherSuite))
4400-
&& crypto.hasMacAlgorithm(getMACAlgorithm(cipherSuite));
4398+
int keyExchangeAlgorithm = getKeyExchangeAlgorithm(cipherSuite);
4399+
if (!isSupportedKeyExchange(crypto, keyExchangeAlgorithm))
4400+
return false;
4401+
4402+
int encryptionAlgorithm = getEncryptionAlgorithm(cipherSuite);
4403+
if (encryptionAlgorithm < 0 || !crypto.hasEncryptionAlgorithm(encryptionAlgorithm))
4404+
return false;
4405+
4406+
int macAlgorithm = getMACAlgorithm(cipherSuite);
4407+
if (macAlgorithm != MACAlgorithm._null)
4408+
{
4409+
if (macAlgorithm < 0 || !crypto.hasMacAlgorithm(macAlgorithm))
4410+
return false;
4411+
}
4412+
4413+
return true;
44014414
}
44024415

44034416
public static boolean isSupportedKeyExchange(TlsCrypto crypto, int keyExchangeAlgorithm)

0 commit comments

Comments
 (0)