Repository: randombit/botan
Pull request #2195 (2019-11-14 10:58:33)

BSI TLS policy update TR-02102-2 version 2019-01
Updates the BSI TLS policy to version 2019-01 of the underlying technical guideline [BSI TR-02102-2](https://www.bsi.bund.de/EN/Publications/TechnicalGuidelines/tr02102/tr02102_node.html).

* Add CCM ciphersuites
* Add SHA-512 as permitted signature hash algorithm
* Remove FFDHE groups ffdhe6144 and ffdhe8192, as these are not explicitly listed in sec. 3.3.2
* Remove non-ephemeral TLS_PSK_* ciphersuites, they are explicitly not permitted


Patch:
diff --git a/src/lib/tls/tls_policy.h b/src/lib/tls/tls_policy.h
index b076d5f9d..4fbbd7545 100644
--- a/src/lib/tls/tls_policy.h
+++ b/src/lib/tls/tls_policy.h
@@ -420,12 +420,12 @@ class BOTAN_PUBLIC_API(2,0) BSI_TR_02102_2 : public Policy
    public:
       std::vector<std::string> allowed_ciphers() const override
          {
-         return std::vector<std::string>({"AES-256/GCM", "AES-128/GCM", "AES-256", "AES-128" });
+         return std::vector<std::string>({"AES-256/GCM", "AES-128/GCM", "AES-256/CCM", "AES-128/CCM", "AES-256", "AES-128"});
          }
 
       std::vector<std::string> allowed_signature_hashes() const override
          {
-         return std::vector<std::string>({"SHA-384", "SHA-256"});
+         return std::vector<std::string>({"SHA-512", "SHA-384", "SHA-256"});
          }
 
       std::vector<std::string> allowed_macs() const override
@@ -435,7 +435,7 @@ class BOTAN_PUBLIC_API(2,0) BSI_TR_02102_2 : public Policy
 
       std::vector<std::string> allowed_key_exchange_methods() const override
          {
-         return std::vector<std::string>({"ECDH", "DH", "PSK", "ECDHE_PSK", "DHE_PSK"});
+         return std::vector<std::string>({"ECDH", "DH", "ECDHE_PSK", "DHE_PSK"});
          }
 
       std::vector<std::string> allowed_signature_methods() const override
@@ -451,8 +451,6 @@ class BOTAN_PUBLIC_API(2,0) BSI_TR_02102_2 : public Policy
             Group_Params::BRAINPOOL256R1,
             Group_Params::SECP384R1,
             Group_Params::SECP256R1,
-            Group_Params::FFDHE_8192,
-            Group_Params::FFDHE_6144,
             Group_Params::FFDHE_4096,
             Group_Params::FFDHE_3072,
             Group_Params::FFDHE_2048


Test patch:
diff --git a/src/tests/data/tls-policy/bsi.txt b/src/tests/data/tls-policy/bsi.txt
index c62777472..935141812 100644
--- a/src/tests/data/tls-policy/bsi.txt
+++ b/src/tests/data/tls-policy/bsi.txt
@@ -4,12 +4,12 @@ allow_tls12 = true
 allow_dtls10 = false
 allow_dtls12 = false
 
-ciphers = AES-256/GCM AES-128/GCM AES-256 AES-128
-signature_hashes = SHA-384 SHA-256
+ciphers = AES-256/GCM AES-128/GCM AES-256/CCM AES-128/CCM AES-256 AES-128
+signature_hashes = SHA-512 SHA-384 SHA-256
 macs = AEAD SHA-384 SHA-256
-key_exchange_methods = ECDH DH PSK ECDHE_PSK DHE_PSK
+key_exchange_methods = ECDH DH ECDHE_PSK DHE_PSK
 signature_methods = ECDSA RSA DSA
-key_exchange_groups = brainpool512r1 brainpool384r1 brainpool256r1 secp384r1 secp256r1 ffdhe/ietf/8192 ffdhe/ietf/6144 ffdhe/ietf/4096 ffdhe/ietf/3072 ffdhe/ietf/2048
+key_exchange_groups = brainpool512r1 brainpool384r1 brainpool256r1 secp384r1 secp256r1 ffdhe/ietf/4096 ffdhe/ietf/3072 ffdhe/ietf/2048
 minimum_dh_group_size = 2000
 minimum_dsa_group_size = 2000
 minimum_ecdh_group_size = 250