diff options
author | lloyd <[email protected]> | 2012-01-27 15:38:53 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-01-27 15:38:53 +0000 |
commit | 2d31f3fc1b1c88739e5babbd6a9e8cb3b80263de (patch) | |
tree | 59eeaeae4d678f3d251fb3bdf6b9d25aa79140b0 /src/tls/tls_policy.cpp | |
parent | 3d3c7f45e64c2dab1b9558fc9da80cdd30175063 (diff) |
Add client-side support for PSK kex. Tested against OpenSSL.
Diffstat (limited to 'src/tls/tls_policy.cpp')
-rw-r--r-- | src/tls/tls_policy.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/tls/tls_policy.cpp b/src/tls/tls_policy.cpp index 870afc6d0..a547e8fd5 100644 --- a/src/tls/tls_policy.cpp +++ b/src/tls/tls_policy.cpp @@ -63,6 +63,7 @@ std::vector<std::string> Policy::allowed_signature_methods() const allowed.push_back("ECDSA"); allowed.push_back("RSA"); allowed.push_back("DSA"); + allowed.push_back(""); return allowed; } @@ -159,7 +160,8 @@ std::vector<u16bit> Policy::ciphersuite_list(bool have_srp) const if(!have_srp) { - std::vector<std::string>::iterator i = std::find(kex.begin(), kex.end(), "SRP"); + std::vector<std::string>::iterator i = + std::find(kex.begin(), kex.end(), "SRP"); if(i != kex.end()) kex.erase(i); @@ -167,14 +169,16 @@ std::vector<u16bit> Policy::ciphersuite_list(bool have_srp) const Ciphersuite_Preference_Ordering order(ciphers, hashes, kex, sigs); - std::map<Ciphersuite, u16bit, Ciphersuite_Preference_Ordering> ciphersuites(order); + std::map<Ciphersuite, u16bit, Ciphersuite_Preference_Ordering> + ciphersuites(order); // When in doubt use brute force :) for(u32bit i = 0; i != 65536; ++i) { Ciphersuite suite = Ciphersuite::lookup_ciphersuite(i); - if(suite.cipher_keylen() == 0) - continue; // not a ciphersuite we know + + if(!suite.valid()) + continue; // not a ciphersuite we know, skip if(value_exists(ciphers, suite.cipher_algo()) && value_exists(hashes, suite.mac_algo()) && |