diff options
Diffstat (limited to 'src/lib/stream')
-rw-r--r-- | src/lib/stream/rc4/rc4.cpp | 5 | ||||
-rw-r--r-- | src/lib/stream/stream_cipher.cpp | 7 |
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") { |