summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-05-11 15:39:42 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-05-11 15:39:42 +0700
commit54819555ec7c3118eda4973102947d0ecd488263 (patch)
tree622941132a2011d9d9f687ff4d868ec87b36ffc5
parent(D)TLS: now defaults to offering (D)TLS 1.2, TLS 13 (diff)
downloadBouncyCastle.NET-ed25519-54819555ec7c3118eda4973102947d0ecd488263.tar.xz
Check EncryptionAlgorithm explicitly
-rw-r--r--crypto/src/tls/crypto/impl/bc/BcTlsCrypto.cs31
1 files changed, 27 insertions, 4 deletions
diff --git a/crypto/src/tls/crypto/impl/bc/BcTlsCrypto.cs b/crypto/src/tls/crypto/impl/bc/BcTlsCrypto.cs
index d8a46ad41..38062829e 100644
--- a/crypto/src/tls/crypto/impl/bc/BcTlsCrypto.cs
+++ b/crypto/src/tls/crypto/impl/bc/BcTlsCrypto.cs
@@ -233,16 +233,39 @@ namespace Org.BouncyCastle.Tls.Crypto.Impl.BC
         {
             switch (encryptionAlgorithm)
             {
-            case EncryptionAlgorithm.DES40_CBC:
+            case EncryptionAlgorithm.AES_128_CBC:
+            case EncryptionAlgorithm.AES_128_CCM:
+            case EncryptionAlgorithm.AES_128_CCM_8:
+            case EncryptionAlgorithm.AES_128_GCM:
+            case EncryptionAlgorithm.AES_256_CBC:
+            case EncryptionAlgorithm.AES_256_CCM:
+            case EncryptionAlgorithm.AES_256_CCM_8:
+            case EncryptionAlgorithm.AES_256_GCM:
+            case EncryptionAlgorithm.ARIA_128_CBC:
+            case EncryptionAlgorithm.ARIA_128_GCM:
+            case EncryptionAlgorithm.ARIA_256_CBC:
+            case EncryptionAlgorithm.ARIA_256_GCM:
+            case EncryptionAlgorithm.CAMELLIA_128_CBC:
+            case EncryptionAlgorithm.CAMELLIA_128_GCM:
+            case EncryptionAlgorithm.CAMELLIA_256_CBC:
+            case EncryptionAlgorithm.CAMELLIA_256_GCM:
+            case EncryptionAlgorithm.CHACHA20_POLY1305:
+            case EncryptionAlgorithm.cls_3DES_EDE_CBC:
+            case EncryptionAlgorithm.NULL:
+            case EncryptionAlgorithm.SEED_CBC:
+            case EncryptionAlgorithm.SM4_CBC:
+            case EncryptionAlgorithm.SM4_CCM:
+            case EncryptionAlgorithm.SM4_GCM:
+                return true;
+
             case EncryptionAlgorithm.DES_CBC:
+            case EncryptionAlgorithm.DES40_CBC:
             case EncryptionAlgorithm.IDEA_CBC:
             case EncryptionAlgorithm.RC2_CBC_40:
             case EncryptionAlgorithm.RC4_128:
             case EncryptionAlgorithm.RC4_40:
-                return false;
-
             default:
-                return true;
+                return false;
             }
         }