aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-11-17 16:25:51 +0000
committerlloyd <[email protected]>2009-11-17 16:25:51 +0000
commit49b20f4e4ff3b8e3141905871ccae9fc70e77a1d (patch)
treec00201a612018adb51278ad095721d45ab3766af /src
parent57199e2a8ec339c9cccb5c837416f91119936213 (diff)
Use the new support for explicitly deleting functions instead of hiding
them as private variables for operator= and copy constructors that shouldn't be used.
Diffstat (limited to 'src')
-rw-r--r--src/asn1/ber_dec.h4
-rw-r--r--src/block/block_cipher.h15
-rw-r--r--src/cert/x509/x509_ca.h6
-rw-r--r--src/cert/x509/x509stor.h4
-rw-r--r--src/filters/data_snk.h6
-rw-r--r--src/filters/data_src.h5
-rw-r--r--src/filters/filter.h11
-rw-r--r--src/filters/pipe.h5
-rw-r--r--src/libstate/libstate.h6
-rw-r--r--src/s2k/s2k.h7
10 files changed, 27 insertions, 42 deletions
diff --git a/src/asn1/ber_dec.h b/src/asn1/ber_dec.h
index 2e38af301..7de7f3753 100644
--- a/src/asn1/ber_dec.h
+++ b/src/asn1/ber_dec.h
@@ -55,14 +55,14 @@ class BOTAN_DLL BER_Decoder
BER_Decoder& decode_optional_string(MemoryRegion<byte>&,
ASN1_Tag, u16bit);
+ BER_Decoder& operator=(const BER_Decoder&) = delete;
+
BER_Decoder(DataSource&);
BER_Decoder(const byte[], u32bit);
BER_Decoder(const MemoryRegion<byte>&);
BER_Decoder(const BER_Decoder&);
~BER_Decoder();
private:
- BER_Decoder& operator=(const BER_Decoder&) { return (*this); }
-
BER_Decoder* parent;
DataSource* source;
BER_Object pushed;
diff --git a/src/block/block_cipher.h b/src/block/block_cipher.h
index 1dcdde7c7..e97eebf0f 100644
--- a/src/block/block_cipher.h
+++ b/src/block/block_cipher.h
@@ -14,21 +14,6 @@ namespace Botan {
/**
* This class represents a block cipher object.
-*
-* It would be very useful to extend this interface to support the
-* encryption of multiple blocks at a time. This could help
-* performance, wrt cache effects in the software implementations, and
-* could be a big deal when supporting block ciphers implemented as
-* hardware devices. It could be used by implementations of ECB, and
-* more importantly counter mode (which most designs are moving to, due
-* to the parallelism possible in counter mode which is not the case
-* with feedback-based modes like CBC).
-*
-* Probable future API here:
-* virtual void encrypt_n(const byte in[], byte out[],
-* u32bit blocks) const = 0;
-* virtual void decrypt_n(const byte in[], byte out[],
-* u32bit blocks) const = 0;
*/
class BOTAN_DLL BlockCipher : public SymmetricAlgorithm
{
diff --git a/src/cert/x509/x509_ca.h b/src/cert/x509/x509_ca.h
index 6eb4bbbef..b680bd0e4 100644
--- a/src/cert/x509/x509_ca.h
+++ b/src/cert/x509/x509_ca.h
@@ -97,11 +97,11 @@ class BOTAN_DLL X509_CA
const Private_Key& key,
const std::string& hash_fn);
+ X509_CA(const X509_CA&) = delete;
+ X509_CA& operator=(const X509_CA&) = delete;
+
~X509_CA();
private:
- X509_CA(const X509_CA&) {}
- X509_CA& operator=(const X509_CA&) { return (*this); }
-
X509_CRL make_crl(const std::vector<CRL_Entry>& entries,
u32bit crl_number, u32bit next_update,
RandomNumberGenerator& rng) const;
diff --git a/src/cert/x509/x509stor.h b/src/cert/x509/x509stor.h
index ab31663ed..958b6da0f 100644
--- a/src/cert/x509/x509stor.h
+++ b/src/cert/x509/x509stor.h
@@ -94,14 +94,14 @@ class BOTAN_DLL X509_Store
static X509_Code check_sig(const X509_Object&, Public_Key*);
+ X509_Store& operator=(const X509_Store&) = delete;
+
X509_Store(u32bit time_slack = 24*60*60,
u32bit cache_results = 30*60);
X509_Store(const X509_Store&);
~X509_Store();
private:
- X509_Store& operator=(const X509_Store&) { return (*this); }
-
class BOTAN_DLL Cert_Info
{
public:
diff --git a/src/filters/data_snk.h b/src/filters/data_snk.h
index 61ddf6e0d..fda06e492 100644
--- a/src/filters/data_snk.h
+++ b/src/filters/data_snk.h
@@ -22,9 +22,9 @@ class BOTAN_DLL DataSink : public Filter
bool attachable() { return false; }
DataSink() {}
virtual ~DataSink() {}
- private:
- DataSink& operator=(const DataSink&) { return (*this); }
- DataSink(const DataSink&);
+
+ DataSink& operator=(const DataSink&) = delete;
+ DataSink(const DataSink&) = delete;
};
/**
diff --git a/src/filters/data_src.h b/src/filters/data_src.h
index e16217e0f..dea46584c 100644
--- a/src/filters/data_src.h
+++ b/src/filters/data_src.h
@@ -78,9 +78,8 @@ class BOTAN_DLL DataSource
DataSource() {}
virtual ~DataSource() {}
- private:
- DataSource& operator=(const DataSource&) { return (*this); }
- DataSource(const DataSource&);
+ DataSource& operator=(const DataSource&) = delete;
+ DataSource(const DataSource&) = delete;
};
/**
diff --git a/src/filters/filter.h b/src/filters/filter.h
index b13a36650..8fc114db7 100644
--- a/src/filters/filter.h
+++ b/src/filters/filter.h
@@ -19,6 +19,8 @@ namespace Botan {
class BOTAN_DLL Filter
{
public:
+ friend class Pipe;
+ friend class Fanout_Filter;
/**
* Write a portion of a message to this filter.
@@ -56,6 +58,9 @@ class BOTAN_DLL Filter
*/
void finish_msg();
+ Filter(const Filter&) = delete;
+ Filter& operator=(const Filter&) = delete;
+
virtual ~Filter() {}
protected:
void send(const byte[], u32bit);
@@ -63,12 +68,6 @@ class BOTAN_DLL Filter
void send(const MemoryRegion<byte>& in) { send(in.begin(), in.size()); }
Filter();
private:
- Filter(const Filter&) {}
- Filter& operator=(const Filter&) { return (*this); }
-
- friend class Pipe;
- friend class Fanout_Filter;
-
u32bit total_ports() const;
u32bit current_port() const { return port_num; }
void set_port(u32bit);
diff --git a/src/filters/pipe.h b/src/filters/pipe.h
index 7cf7d6df2..58bb6d22a 100644
--- a/src/filters/pipe.h
+++ b/src/filters/pipe.h
@@ -244,10 +244,11 @@ class BOTAN_DLL Pipe : public DataSource
*/
Pipe(std::initializer_list<Filter*> filters);
+ Pipe(const Pipe&) = delete;
+ Pipe& operator=(const Pipe&) = delete;
+
~Pipe();
private:
- Pipe(const Pipe&) : DataSource() {}
- Pipe& operator=(const Pipe&) { return (*this); }
void init();
void destruct(Filter*);
void find_endpoints(Filter*);
diff --git a/src/libstate/libstate.h b/src/libstate/libstate.h
index 91fd58dff..e9a08b74b 100644
--- a/src/libstate/libstate.h
+++ b/src/libstate/libstate.h
@@ -28,6 +28,9 @@ class BOTAN_DLL Library_State
Library_State();
~Library_State();
+ Library_State(const Library_State&) = delete;
+ Library_State& operator=(const Library_State&) = delete;
+
void initialize();
Algorithm_Factory& algorithm_factory();
@@ -96,9 +99,6 @@ class BOTAN_DLL Library_State
private:
void load_default_config();
- Library_State(const Library_State&) {}
- Library_State& operator=(const Library_State&) { return (*this); }
-
std::mutex config_lock;
std::map<std::string, std::string> config;
diff --git a/src/s2k/s2k.h b/src/s2k/s2k.h
index 7af92519b..ca86ab77a 100644
--- a/src/s2k/s2k.h
+++ b/src/s2k/s2k.h
@@ -87,12 +87,13 @@ class BOTAN_DLL S2K
S2K() { iter = 0; }
virtual ~S2K() {}
- private:
- S2K(const S2K&) {}
- S2K& operator=(const S2K&) { return (*this); }
+ S2K(const S2K&) = delete;
+ S2K& operator=(const S2K&) = delete;
+ private:
virtual OctetString derive(u32bit, const std::string&,
const byte[], u32bit, u32bit) const = 0;
+
SecureVector<byte> salt;
u32bit iter;
};