aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-09-05 12:01:52 -0400
committerJack Lloyd <[email protected]>2016-09-05 12:01:52 -0400
commit743320d7007cc66f3ebeebeaafb7b42f1a0362ff (patch)
tree0d9395f8341f5dc98d9f5c9dce4cca7fb298ba91
parent29046be988a4101596478ba53e01a0752cd9e920 (diff)
parentf3e258aa81cd2d83927183d63a9d23eb8f4d7598 (diff)
Merge GH #624 Use compiler generated operators in X509_Certificate
-rw-r--r--src/lib/cert/x509/x509cert.cpp26
-rw-r--r--src/lib/cert/x509/x509cert.h4
-rw-r--r--src/tests/unit_x509.cpp4
3 files changed, 4 insertions, 30 deletions
diff --git a/src/lib/cert/x509/x509cert.cpp b/src/lib/cert/x509/x509cert.cpp
index ffedf43f0..8166e43ef 100644
--- a/src/lib/cert/x509/x509cert.cpp
+++ b/src/lib/cert/x509/x509cert.cpp
@@ -72,32 +72,6 @@ X509_Certificate::X509_Certificate(const std::vector<byte>& in) :
do_decode();
}
-X509_Certificate::X509_Certificate(const X509_Certificate& other) :
- X509_Object(other)
- {
- m_subject = other.m_subject;
- m_issuer = other.m_issuer;
- m_self_signed = other.m_self_signed;
- m_v3_extensions = other.m_v3_extensions;
- }
-
-X509_Certificate& X509_Certificate::operator=(const X509_Certificate& other)
- {
- if(&other == this)
- {
- return *this;
- }
- else
- {
- m_subject = other.m_subject;
- m_issuer = other.m_issuer;
- m_self_signed = other.m_self_signed;
- m_v3_extensions = other.m_v3_extensions;
- }
- return *this;
- }
-
-
/*
* Decode the TBSCertificate data
*/
diff --git a/src/lib/cert/x509/x509cert.h b/src/lib/cert/x509/x509cert.h
index eb98f9c3d..d64d8fd2b 100644
--- a/src/lib/cert/x509/x509cert.h
+++ b/src/lib/cert/x509/x509cert.h
@@ -274,9 +274,9 @@ class BOTAN_DLL X509_Certificate : public X509_Object
explicit X509_Certificate(const std::vector<byte>& in);
- X509_Certificate(const X509_Certificate& other);
+ X509_Certificate(const X509_Certificate& other) = default;
- X509_Certificate& operator=(const X509_Certificate& other);
+ X509_Certificate& operator=(const X509_Certificate& other) = default;
private:
void force_decode() override;
diff --git a/src/tests/unit_x509.cpp b/src/tests/unit_x509.cpp
index 4d3c63a1b..8449beba4 100644
--- a/src/tests/unit_x509.cpp
+++ b/src/tests/unit_x509.cpp
@@ -308,8 +308,8 @@ Test::Result test_x509_cert(const std::string& sig_algo, const std::string& hash
Botan::X509_Certificate user1_cert_copy(user1_cert);
result.test_eq("certificate copy", user1_cert == user1_cert_copy, true);
- user1_cert_copy = user1_cert;
- result.test_eq("certificate assignment", user1_cert == user1_cert_copy, true);
+ user1_cert_copy = user2_cert;
+ result.test_eq("certificate assignment", user2_cert == user1_cert_copy, true);
Botan::X509_Certificate user1_cert_differ =
ca.sign_request(user1_req, Test::rng(),