aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/prov/openssl
diff options
context:
space:
mode:
authorRenĂ© Korthaus <[email protected]>2016-07-19 15:28:09 +0200
committerRenĂ© Korthaus <[email protected]>2016-07-20 09:04:05 +0200
commitadfc3e082d176f2f5141374f507a13d575898cff (patch)
treee13bc9adb3989bf907359be93916a7d15accf5af /src/lib/prov/openssl
parent308c7d5eda678566edd26e9ab20edbe772f46363 (diff)
Make Stream_Cipher::set_iv() pure virtual
It provided a default implementation that only checked that the length was correct, but ignored the actual data and did not notify the caller, which seemed like a rather odd behaviour. The only implementation that used this default implementation, RC4, now throws an exception.
Diffstat (limited to 'src/lib/prov/openssl')
-rw-r--r--src/lib/prov/openssl/openssl_rc4.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/prov/openssl/openssl_rc4.cpp b/src/lib/prov/openssl/openssl_rc4.cpp
index 070cdb14d..d6246e4ab 100644
--- a/src/lib/prov/openssl/openssl_rc4.cpp
+++ b/src/lib/prov/openssl/openssl_rc4.cpp
@@ -12,6 +12,7 @@
#include <botan/internal/algo_registry.h>
#include <botan/internal/openssl.h>
#include <botan/parsing.h>
+#include <botan/exceptn.h>
#include <openssl/rc4.h>
namespace Botan {
@@ -46,6 +47,11 @@ 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
+ {
+ throw Exception("RC4 does not support an IV");
+ }
+
void seek(u64bit) override
{
throw Exception("RC4 does not support seeking");