diff options
author | Jack Lloyd <[email protected]> | 2016-07-04 18:41:21 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-07-04 18:41:21 -0400 |
commit | 5b1b69e2b6907bb30a1a310a4daf97e90b628a03 (patch) | |
tree | e3ac9941a517017d82e3a2dec2d3762304b63d72 /src | |
parent | 360a3a50cda6b9eb7e2c001eb2bc397a0ed7b975 (diff) | |
parent | 8d66358264377ff4fe17427490b79276d205e742 (diff) |
Merge GH #522 Update BSI policy, fix TLS
Diffstat (limited to 'src')
-rw-r--r-- | src/build-data/policy/bsi.txt | 12 | ||||
-rw-r--r-- | src/lib/tls/info.txt | 2 | ||||
-rw-r--r-- | src/lib/tls/tls_handshake_hash.cpp | 9 | ||||
-rw-r--r-- | src/tests/test_ecies.cpp | 3 |
4 files changed, 23 insertions, 3 deletions
diff --git a/src/build-data/policy/bsi.txt b/src/build-data/policy/bsi.txt index ce05cc19d..d0b443d62 100644 --- a/src/build-data/policy/bsi.txt +++ b/src/build-data/policy/bsi.txt @@ -19,6 +19,11 @@ keccak cmac hmac +# kdf +kdf1_iso18033 +sp800_108 +sp800_56c + # pk_pad eme_oaep emsa_pssr @@ -31,6 +36,8 @@ rsa dsa ecdsa ecgdsa +ecies +eckcdsa ecdh # rng @@ -113,6 +120,11 @@ ofb rc4 salsa20 +# kdf +kdf1 +kdf2 +prf_x942 + # pubkey curve25519 elgamal diff --git a/src/lib/tls/info.txt b/src/lib/tls/info.txt index a43d5619a..cd9f78a26 100644 --- a/src/lib/tls/info.txt +++ b/src/lib/tls/info.txt @@ -43,8 +43,8 @@ eme_pkcs1 emsa_pkcs1 gcm hmac -kdf2 md5 +par_hash prf_tls rng rsa diff --git a/src/lib/tls/tls_handshake_hash.cpp b/src/lib/tls/tls_handshake_hash.cpp index 00b8d744c..4f78bebbc 100644 --- a/src/lib/tls/tls_handshake_hash.cpp +++ b/src/lib/tls/tls_handshake_hash.cpp @@ -21,14 +21,19 @@ secure_vector<byte> Handshake_Hash::final(Protocol_Version version, { auto choose_hash = [=]() { if(!version.supports_ciphersuite_specific_prf()) - return "Parallel(MD5,SHA-160)";; + return "Parallel(MD5,SHA-160)"; if(mac_algo == "MD5" || mac_algo == "SHA-1") return "SHA-256"; return mac_algo.c_str(); }; - std::unique_ptr<HashFunction> hash(HashFunction::create(choose_hash())); + const std::string hash_algo = choose_hash(); + std::unique_ptr<HashFunction> hash(HashFunction::create(hash_algo)); + if(!hash) + { + throw Algorithm_Not_Found(hash_algo); + } hash->update(m_data); return hash->final(); } diff --git a/src/tests/test_ecies.cpp b/src/tests/test_ecies.cpp index 0ef7ca317..68edf71be 100644 --- a/src/tests/test_ecies.cpp +++ b/src/tests/test_ecies.cpp @@ -101,6 +101,8 @@ void check_encrypt_decrypt(Test::Result& result, const Botan::ECDH_PrivateKey& p plaintext, std::vector<byte>()); } +#if defined(BOTAN_HAS_KDF1_18033) + class ECIES_ISO_Tests : public Text_Based_Test { public: @@ -197,6 +199,7 @@ class ECIES_ISO_Tests : public Text_Based_Test BOTAN_REGISTER_TEST("ecies-iso", ECIES_ISO_Tests); +#endif class ECIES_Tests : public Text_Based_Test { |