aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/botan/src/lib/stream/stream_cipher.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-11-23 11:07:57 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2018-12-13 15:10:11 +0000
commitd7178b88c4b2572fb83b28f8178940766216deed (patch)
tree861eb8069fb97c8e8e79f56cb8f88f05126639fc /src/libs/3rdparty/botan/src/lib/stream/stream_cipher.cpp
parent030d4d01084b04af361f07dd6360dfad8e2cc19c (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/stream/stream_cipher.cpp')
-rw-r--r--src/libs/3rdparty/botan/src/lib/stream/stream_cipher.cpp149
1 files changed, 0 insertions, 149 deletions
diff --git a/src/libs/3rdparty/botan/src/lib/stream/stream_cipher.cpp b/src/libs/3rdparty/botan/src/lib/stream/stream_cipher.cpp
deleted file mode 100644
index 692464723c..0000000000
--- a/src/libs/3rdparty/botan/src/lib/stream/stream_cipher.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
-* Stream Ciphers
-* (C) 2015,2016 Jack Lloyd
-*
-* Botan is released under the Simplified BSD License (see license.txt)
-*/
-
-#include <botan/stream_cipher.h>
-#include <botan/scan_name.h>
-#include <botan/exceptn.h>
-
-#if defined(BOTAN_HAS_CHACHA)
- #include <botan/chacha.h>
-#endif
-
-#if defined(BOTAN_HAS_SALSA20)
- #include <botan/salsa20.h>
-#endif
-
-#if defined(BOTAN_HAS_SHAKE_CIPHER)
- #include <botan/shake_cipher.h>
-#endif
-
-#if defined(BOTAN_HAS_CTR_BE)
- #include <botan/ctr.h>
-#endif
-
-#if defined(BOTAN_HAS_OFB)
- #include <botan/ofb.h>
-#endif
-
-#if defined(BOTAN_HAS_RC4)
- #include <botan/rc4.h>
-#endif
-
-#if defined(BOTAN_HAS_OPENSSL)
- #include <botan/internal/openssl.h>
-#endif
-
-namespace Botan {
-
-std::unique_ptr<StreamCipher> StreamCipher::create(const std::string& algo_spec,
- const std::string& provider)
- {
- const SCAN_Name req(algo_spec);
-
-#if defined(BOTAN_HAS_CTR_BE)
- if((req.algo_name() == "CTR-BE" || req.algo_name() == "CTR") && req.arg_count_between(1,2))
- {
- if(provider.empty() || provider == "base")
- {
- auto cipher = BlockCipher::create(req.arg(0));
- if(cipher)
- {
- size_t ctr_size = req.arg_as_integer(1, cipher->block_size());
- return std::unique_ptr<StreamCipher>(new CTR_BE(cipher.release(), ctr_size));
- }
- }
- }
-#endif
-
-#if defined(BOTAN_HAS_CHACHA)
- if(req.algo_name() == "ChaCha")
- {
- if(provider.empty() || provider == "base")
- return std::unique_ptr<StreamCipher>(new ChaCha(req.arg_as_integer(0, 20)));
- }
-
- if(req.algo_name() == "ChaCha20")
- {
- if(provider.empty() || provider == "base")
- return std::unique_ptr<StreamCipher>(new ChaCha(20));
- }
-#endif
-
-#if defined(BOTAN_HAS_SALSA20)
- if(req.algo_name() == "Salsa20")
- {
- if(provider.empty() || provider == "base")
- return std::unique_ptr<StreamCipher>(new Salsa20);
- }
-#endif
-
-#if defined(BOTAN_HAS_SHAKE_CIPHER)
- if(req.algo_name() == "SHAKE-128")
- {
- if(provider.empty() || provider == "base")
- return std::unique_ptr<StreamCipher>(new SHAKE_128_Cipher);
- }
-#endif
-
-#if defined(BOTAN_HAS_OFB)
- if(req.algo_name() == "OFB" && req.arg_count() == 1)
- {
- if(provider.empty() || provider == "base")
- {
- if(auto c = BlockCipher::create(req.arg(0)))
- return std::unique_ptr<StreamCipher>(new OFB(c.release()));
- }
- }
-#endif
-
-#if defined(BOTAN_HAS_RC4)
-
- if(req.algo_name() == "RC4" ||
- req.algo_name() == "ARC4" ||
- req.algo_name() == "MARK-4")
- {
- const size_t skip = (req.algo_name() == "MARK-4") ? 256 : req.arg_as_integer(0, 0);
-
-#if defined(BOTAN_HAS_OPENSSL)
- if(provider.empty() || provider == "openssl")
- {
- return std::unique_ptr<StreamCipher>(make_openssl_rc4(skip));
- }
-#endif
-
- if(provider.empty() || provider == "base")
- {
- return std::unique_ptr<StreamCipher>(new RC4(skip));
- }
- }
-
-#endif
-
- BOTAN_UNUSED(req);
- BOTAN_UNUSED(provider);
-
- return nullptr;
- }
-
-//static
-std::unique_ptr<StreamCipher>
-StreamCipher::create_or_throw(const std::string& algo,
- const std::string& provider)
- {
- if(auto sc = StreamCipher::create(algo, provider))
- {
- return sc;
- }
- throw Lookup_Error("Stream cipher", algo, provider);
- }
-
-std::vector<std::string> StreamCipher::providers(const std::string& algo_spec)
- {
- return probe_providers_of<StreamCipher>(algo_spec, {"base", "openssl"});
- }
-
-}