diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-11-23 11:07:57 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-12-13 15:10:11 +0000 |
commit | d7178b88c4b2572fb83b28f8178940766216deed (patch) | |
tree | 861eb8069fb97c8e8e79f56cb8f88f05126639fc /src/libs/3rdparty/botan/src/lib/pubkey/ecdh/ecdh.cpp | |
parent | 030d4d01084b04af361f07dd6360dfad8e2cc19c (diff) |
SSH: Use OpenSSH tools
... instead of our own SSH library.
Advantages:
- Full compatibility with OpenSSH behavior guaranteed.
- Minimal maintenance effort.
- Less code to build.
- Big chunk of 3rd party sources can be removed from our repository.
One the downside, Windows users now need to install OpenSSH for
RemoteLinux support. Hoewever, people doing embedded development
probably have it installed anyway.
[ChangeLog] Switched SSH backend to OpenSSH
Fixes: QTCREATORBUG-15744
Fixes: QTCREATORBUG-15807
Fixes: QTCREATORBUG-19306
Fixes: QTCREATORBUG-20210
Change-Id: Ifcfefdd39401e45ba1f4aca35d2c5bf7046c7aab
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/libs/3rdparty/botan/src/lib/pubkey/ecdh/ecdh.cpp')
-rw-r--r-- | src/libs/3rdparty/botan/src/lib/pubkey/ecdh/ecdh.cpp | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/src/libs/3rdparty/botan/src/lib/pubkey/ecdh/ecdh.cpp b/src/libs/3rdparty/botan/src/lib/pubkey/ecdh/ecdh.cpp deleted file mode 100644 index e7e49a74fdf..00000000000 --- a/src/libs/3rdparty/botan/src/lib/pubkey/ecdh/ecdh.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* -* ECDH implemenation -* (C) 2007 Manuel Hartl, FlexSecure GmbH -* 2007 Falko Strenzke, FlexSecure GmbH -* 2008-2010 Jack Lloyd -* -* Botan is released under the Simplified BSD License (see license.txt) -*/ - -#include <botan/ecdh.h> -#include <botan/numthry.h> -#include <botan/internal/pk_ops_impl.h> - -#if defined(BOTAN_HAS_OPENSSL) - #include <botan/internal/openssl.h> -#endif - -namespace Botan { - -namespace { - -/** -* ECDH operation -*/ -class ECDH_KA_Operation final : public PK_Ops::Key_Agreement_with_KDF - { - public: - - ECDH_KA_Operation(const ECDH_PrivateKey& key, const std::string& kdf, RandomNumberGenerator& rng) : - PK_Ops::Key_Agreement_with_KDF(kdf), - m_group(key.domain()), - m_rng(rng) - { - m_l_times_priv = m_group.inverse_mod_order(m_group.get_cofactor()) * key.private_value(); - } - - size_t agreed_value_size() const override { return m_group.get_p_bytes(); } - - secure_vector<uint8_t> raw_agree(const uint8_t w[], size_t w_len) override - { - PointGFp input_point = m_group.get_cofactor() * m_group.OS2ECP(w, w_len); - input_point.randomize_repr(m_rng); - - const PointGFp S = m_group.blinded_var_point_multiply( - input_point, m_l_times_priv, m_rng, m_ws); - - if(S.on_the_curve() == false) - throw Internal_Error("ECDH agreed value was not on the curve"); - return BigInt::encode_1363(S.get_affine_x(), m_group.get_p_bytes()); - } - private: - const EC_Group m_group; - BigInt m_l_times_priv; - RandomNumberGenerator& m_rng; - std::vector<BigInt> m_ws; - }; - -} - -std::unique_ptr<PK_Ops::Key_Agreement> -ECDH_PrivateKey::create_key_agreement_op(RandomNumberGenerator& rng, - const std::string& params, - const std::string& provider) const - { -#if defined(BOTAN_HAS_OPENSSL) - if(provider == "openssl" || provider.empty()) - { - try - { - return make_openssl_ecdh_ka_op(*this, params); - } - catch(Lookup_Error&) - { - if(provider == "openssl") - throw; - } - } -#endif - - if(provider == "base" || provider.empty()) - return std::unique_ptr<PK_Ops::Key_Agreement>(new ECDH_KA_Operation(*this, params, rng)); - - throw Provider_Not_Found(algo_name(), provider); - } - - -} |