aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2011-02-10 22:51:11 +0000
committerlloyd <[email protected]>2011-02-10 22:51:11 +0000
commit5f4f1294b1cf1784f4fd14840a9e0824f4fa8742 (patch)
tree3cdedbe87099c18e289bc140bef69e86dddf8b8d
parentf49d55a1e4bcd3e33ba8eee6afa92438ef61f0b3 (diff)
Remove inclusions of unused headers.
Avoid using auto_ptr in the CVC headers.
-rw-r--r--checks/cvc_tests.cpp19
-rw-r--r--checks/ec_tests.cpp2
-rw-r--r--checks/ecdsa.cpp1
-rw-r--r--src/cert/cvc/cvc_gen_cert.h7
-rw-r--r--src/cert/cvc/cvc_self.cpp7
-rw-r--r--src/entropy/entropy_src.h1
-rw-r--r--src/libstate/scan_name.h1
-rw-r--r--src/pubkey/ecc_key/ecc_key.h1
-rw-r--r--src/utils/time.h1
9 files changed, 19 insertions, 21 deletions
diff --git a/checks/cvc_tests.cpp b/checks/cvc_tests.cpp
index d6f5e1312..acc6b91cb 100644
--- a/checks/cvc_tests.cpp
+++ b/checks/cvc_tests.cpp
@@ -16,6 +16,7 @@
#include <algorithm>
#include <fstream>
#include <vector>
+#include <memory>
#include <botan/ecdsa.h>
#include <botan/rsa.h>
@@ -161,8 +162,8 @@ void test_enc_gen_selfsigned(RandomNumberGenerator& rng)
}
CHECK(ill_date_exc2);
//cout << "readable = '" << cert_in.get_ced().readable_string() << "'\n";
- std::auto_ptr<Public_Key> p_pk = cert_in.subject_public_key();
- //auto_ptr<ECDSA_PublicKey> ecdsa_pk = dynamic_cast<auto_ptr<ECDSA_PublicKey> >(p_pk);
+ std::auto_ptr<Public_Key> p_pk(cert_in.subject_public_key());
+ //auto_ptr<ECDSA_PublicKey> ecdsa_pk(dynamic_cast<auto_ptr<ECDSA_PublicKey> >(p_pk));
ECDSA_PublicKey* p_ecdsa_pk = dynamic_cast<ECDSA_PublicKey*>(p_pk.get());
// let´s see if encoding is truely implicitca, because this is what the key should have
// been set to when decoding (see above)(because it has no domain params):
@@ -180,7 +181,7 @@ void test_enc_gen_selfsigned(RandomNumberGenerator& rng)
CHECK(exc);
// set them and try again
//cert_in.set_domain_parameters(dom_pars);
- std::auto_ptr<Public_Key> p_pk2 = cert_in.subject_public_key();
+ std::auto_ptr<Public_Key> p_pk2(cert_in.subject_public_key());
ECDSA_PublicKey* p_ecdsa_pk2 = dynamic_cast<ECDSA_PublicKey*>(p_pk2.get());
//p_ecdsa_pk2->set_domain_parameters(dom_pars);
CHECK(p_ecdsa_pk2->domain().get_order() == dom_pars.get_order());
@@ -211,7 +212,7 @@ void test_enc_gen_req(RandomNumberGenerator& rng)
// read and check signature...
EAC1_1_Req req_in(TEST_DATA_DIR "/my_cv_req.ber");
//req_in.set_domain_parameters(dom_pars);
- std::auto_ptr<Public_Key> p_pk = req_in.subject_public_key();
+ std::auto_ptr<Public_Key> p_pk(req_in.subject_public_key());
ECDSA_PublicKey* p_ecdsa_pk = dynamic_cast<ECDSA_PublicKey*>(p_pk.get());
//p_ecdsa_pk->set_domain_parameters(dom_pars);
CHECK(p_ecdsa_pk->domain().get_order() == dom_pars.get_order());
@@ -226,7 +227,7 @@ void test_cvc_req_ext(RandomNumberGenerator&)
EAC1_1_Req req_in(TEST_DATA_DIR "/DE1_flen_chars_cvcRequest_ECDSA.der");
EC_Domain_Params dom_pars(OID("1.3.36.3.3.2.8.1.1.5")); // "german curve"
//req_in.set_domain_parameters(dom_pars);
- std::auto_ptr<Public_Key> p_pk = req_in.subject_public_key();
+ std::auto_ptr<Public_Key> p_pk(req_in.subject_public_key());
ECDSA_PublicKey* p_ecdsa_pk = dynamic_cast<ECDSA_PublicKey*>(p_pk.get());
//p_ecdsa_pk->set_domain_parameters(dom_pars);
CHECK(p_ecdsa_pk->domain().get_order() == dom_pars.get_order());
@@ -388,11 +389,11 @@ void test_ver_cvca(RandomNumberGenerator&)
EAC1_1_CVC req_in(TEST_DATA_DIR "/cvca01.cv.crt");
- //auto_ptr<ECDSA_PublicKey> ecdsa_pk = dynamic_cast<auto_ptr<ECDSA_PublicKey> >(p_pk);
+ //auto_ptr<ECDSA_PublicKey> ecdsa_pk(dynamic_cast<auto_ptr<ECDSA_PublicKey> >(p_pk));
//ECDSA_PublicKey* p_ecdsa_pk = dynamic_cast<ECDSA_PublicKey*>(p_pk.get());
bool exc = false;
- std::auto_ptr<Public_Key> p_pk2 = req_in.subject_public_key();
+ std::auto_ptr<Public_Key> p_pk2(req_in.subject_public_key());
ECDSA_PublicKey* p_ecdsa_pk2 = dynamic_cast<ECDSA_PublicKey*>(p_pk2.get());
bool ver_ec = req_in.check_signature(*p_pk2);
CHECK_MESSAGE(ver_ec, "could not positively verify correct selfsigned cvca certificate");
@@ -510,7 +511,7 @@ void test_cvc_chain(RandomNumberGenerator& rng)
CHECK(link12.check_signature(cvca_privk));
EAC1_1_CVC link12_reloaded(TEST_DATA_DIR "/cvc_chain_link12.cer");
EAC1_1_CVC cvca1_reloaded(TEST_DATA_DIR "/cvc_chain_cvca.cer");
- std::auto_ptr<Public_Key> cvca1_rel_pk = cvca1_reloaded.subject_public_key();
+ std::auto_ptr<Public_Key> cvca1_rel_pk(cvca1_reloaded.subject_public_key());
CHECK(link12_reloaded.check_signature(*cvca1_rel_pk));
// create first round dvca-req
@@ -540,7 +541,7 @@ void test_cvc_chain(RandomNumberGenerator& rng)
// verify the ado and sign the request too
- std::auto_ptr<Public_Key> ap_pk = dvca_cert1.subject_public_key();
+ std::auto_ptr<Public_Key> ap_pk(dvca_cert1.subject_public_key());
ECDSA_PublicKey* cert_pk = dynamic_cast<ECDSA_PublicKey*>(ap_pk.get());
//cert_pk->set_domain_parameters(dom_pars);
diff --git a/checks/ec_tests.cpp b/checks/ec_tests.cpp
index 979414ed4..e299fbcc0 100644
--- a/checks/ec_tests.cpp
+++ b/checks/ec_tests.cpp
@@ -16,7 +16,7 @@
using namespace Botan;
#include <iostream>
-#include <assert.h>
+#include <memory>
#include "getopt.h"
#include "validate.h"
diff --git a/checks/ecdsa.cpp b/checks/ecdsa.cpp
index 91ea8cfbb..819b10dfb 100644
--- a/checks/ecdsa.cpp
+++ b/checks/ecdsa.cpp
@@ -19,6 +19,7 @@
#include <iostream>
#include <fstream>
+#include <memory>
#include "common.h"
diff --git a/src/cert/cvc/cvc_gen_cert.h b/src/cert/cvc/cvc_gen_cert.h
index 61861df41..ad61b85bf 100644
--- a/src/cert/cvc/cvc_gen_cert.h
+++ b/src/cert/cvc/cvc_gen_cert.h
@@ -13,7 +13,6 @@
#include <botan/eac_asn_obj.h>
#include <botan/ecdsa.h>
#include <botan/pubkey.h>
-#include <memory>
namespace Botan {
@@ -31,7 +30,7 @@ class EAC1_1_gen_CVC : public EAC1_1_obj<Derived> // CRTP continuation from EAC1
* Get this certificates public key.
* @result this certificates public key
*/
- std::auto_ptr<Public_Key> subject_public_key() const;
+ Public_Key* subject_public_key() const;
/**
* Find out whether this object is self signed.
@@ -121,9 +120,9 @@ MemoryVector<byte> EAC1_1_gen_CVC<Derived>::make_signed(
}
template<typename Derived>
-std::auto_ptr<Public_Key> EAC1_1_gen_CVC<Derived>::subject_public_key() const
+Public_Key* EAC1_1_gen_CVC<Derived>::subject_public_key() const
{
- return std::auto_ptr<Public_Key>(new ECDSA_PublicKey(*m_pk));
+ return new ECDSA_PublicKey(*m_pk);
}
template<typename Derived> SecureVector<byte> EAC1_1_gen_CVC<Derived>::build_cert_body(MemoryRegion<byte> const& tbs)
diff --git a/src/cert/cvc/cvc_self.cpp b/src/cert/cvc/cvc_self.cpp
index f1d539923..1097d45d1 100644
--- a/src/cert/cvc/cvc_self.cpp
+++ b/src/cert/cvc/cvc_self.cpp
@@ -11,6 +11,7 @@
#include <botan/time.h>
#include <botan/oids.h>
#include <sstream>
+#include <memory>
namespace Botan {
@@ -231,7 +232,7 @@ EAC1_1_CVC link_cvca(EAC1_1_CVC const& signer,
AlgorithmIdentifier sig_algo = signer.signature_algorithm();
std::string padding_and_hash = padding_and_hash_from_oid(sig_algo.oid);
PK_Signer pk_signer(*priv_key, padding_and_hash);
- std::auto_ptr<Public_Key> pk = signee.subject_public_key();
+ std::auto_ptr<Public_Key> pk(signee.subject_public_key());
ECDSA_PublicKey* subj_pk = dynamic_cast<ECDSA_PublicKey*>(pk.get());
subj_pk->set_parameter_encoding(EC_DOMPAR_ENC_EXPLICIT);
@@ -265,9 +266,9 @@ EAC1_1_CVC sign_request(EAC1_1_CVC const& signer_cert,
ASN1_Chr chr(chr_str);
std::string padding_and_hash = padding_and_hash_from_oid(signee.signature_algorithm().oid);
PK_Signer pk_signer(*priv_key, padding_and_hash);
- std::auto_ptr<Public_Key> pk = signee.subject_public_key();
+ std::auto_ptr<Public_Key> pk(signee.subject_public_key());
ECDSA_PublicKey* subj_pk = dynamic_cast<ECDSA_PublicKey*>(pk.get());
- std::auto_ptr<Public_Key> signer_pk = signer_cert.subject_public_key();
+ std::auto_ptr<Public_Key> signer_pk(signer_cert.subject_public_key());
// for the case that the domain parameters are not set...
// (we use those from the signer because they must fit)
diff --git a/src/entropy/entropy_src.h b/src/entropy/entropy_src.h
index d713598d9..3f15b5907 100644
--- a/src/entropy/entropy_src.h
+++ b/src/entropy/entropy_src.h
@@ -10,7 +10,6 @@
#include <botan/buf_comp.h>
#include <string>
-#include <utility>
namespace Botan {
diff --git a/src/libstate/scan_name.h b/src/libstate/scan_name.h
index 0d30dc44c..3e1728f29 100644
--- a/src/libstate/scan_name.h
+++ b/src/libstate/scan_name.h
@@ -11,7 +11,6 @@
#include <botan/types.h>
#include <string>
#include <vector>
-#include <set>
namespace Botan {
diff --git a/src/pubkey/ecc_key/ecc_key.h b/src/pubkey/ecc_key/ecc_key.h
index 8155543da..a20516ec6 100644
--- a/src/pubkey/ecc_key/ecc_key.h
+++ b/src/pubkey/ecc_key/ecc_key.h
@@ -14,7 +14,6 @@
#include <botan/pk_keys.h>
#include <botan/x509_key.h>
#include <botan/pkcs8.h>
-#include <memory>
namespace Botan {
diff --git a/src/utils/time.h b/src/utils/time.h
index 56d15513c..fcc956df2 100644
--- a/src/utils/time.h
+++ b/src/utils/time.h
@@ -9,7 +9,6 @@
#define BOTAN_TIME_H__
#include <botan/types.h>
-#include <ctime>
namespace Botan {