aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/stream
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-10-17 06:05:37 -0400
committerJack Lloyd <[email protected]>2016-10-21 16:53:17 -0400
commitdf64fb318acbfee7911bee4fd021100f1d6532ed (patch)
tree20238e6f96c7d6e31539389c398255850177d970 /src/lib/stream
parent558808900bffc3c48da5e6d79ba602e88e619154 (diff)
Remove alias logic from SCAN_Name
This required taking a global lock and doing a map lookup each time an algorithm was requested (and so many times during a TLS handshake).
Diffstat (limited to 'src/lib/stream')
-rw-r--r--src/lib/stream/rc4/rc4.cpp5
-rw-r--r--src/lib/stream/stream_cipher.cpp7
2 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/stream/rc4/rc4.cpp b/src/lib/stream/rc4/rc4.cpp
index 7200288b6..47dc1ce29 100644
--- a/src/lib/stream/rc4/rc4.cpp
+++ b/src/lib/stream/rc4/rc4.cpp
@@ -27,9 +27,10 @@ void RC4::cipher(const byte in[], byte out[], size_t length)
m_position += length;
}
-void RC4::set_iv(const byte*, size_t)
+void RC4::set_iv(const byte*, size_t length)
{
- throw Exception("RC4 does not support an IV");
+ if(length > 0)
+ throw Exception("RC4 does not support an IV");
}
/*
diff --git a/src/lib/stream/stream_cipher.cpp b/src/lib/stream/stream_cipher.cpp
index 74b9db9e7..4b27caafe 100644
--- a/src/lib/stream/stream_cipher.cpp
+++ b/src/lib/stream/stream_cipher.cpp
@@ -91,9 +91,12 @@ std::unique_ptr<StreamCipher> StreamCipher::create(const std::string& algo_spec,
#if defined(BOTAN_HAS_RC4)
- if(req.algo_name() == "RC4")
+ if(req.algo_name() == "RC4" ||
+ req.algo_name() == "ARC4" ||
+ req.algo_name() == "MARK-4")
{
- const size_t skip = req.arg_as_integer(0, 0);
+ 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")
{