diff options
Diffstat (limited to 'src/lib/prov/openssl/openssl_rc4.cpp')
-rw-r--r-- | src/lib/prov/openssl/openssl_rc4.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/prov/openssl/openssl_rc4.cpp b/src/lib/prov/openssl/openssl_rc4.cpp index 3db62c32a..b43d801ed 100644 --- a/src/lib/prov/openssl/openssl_rc4.cpp +++ b/src/lib/prov/openssl/openssl_rc4.cpp @@ -9,7 +9,6 @@ #if defined(BOTAN_HAS_OPENSSL) && defined(BOTAN_HAS_RC4) -#include <botan/internal/algo_registry.h> #include <botan/internal/openssl.h> #include <botan/parsing.h> #include <botan/exceptn.h> @@ -49,9 +48,10 @@ class OpenSSL_RC4 : public StreamCipher explicit OpenSSL_RC4(size_t skip = 0) : m_skip(skip) { clear(); } ~OpenSSL_RC4() { clear(); } - void set_iv(const byte*, size_t) override + void set_iv(const byte*, size_t len) override { - throw Exception("RC4 does not support an IV"); + if(len > 0) + throw Exception("RC4 does not support an IV"); } void seek(u64bit) override @@ -78,8 +78,12 @@ class OpenSSL_RC4 : public StreamCipher } -BOTAN_REGISTER_TYPE(StreamCipher, OpenSSL_RC4, "RC4", (make_new_T_1len<OpenSSL_RC4,0>), - "openssl", BOTAN_OPENSSL_RC4_PRIO); +std::unique_ptr<StreamCipher> +make_openssl_rc4(size_t skip) + { + return std::unique_ptr<StreamCipher>(new OpenSSL_RC4(skip)); + } + } |