diff options
author | lloyd <[email protected]> | 2011-02-10 22:51:11 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2011-02-10 22:51:11 +0000 |
commit | 5f4f1294b1cf1784f4fd14840a9e0824f4fa8742 (patch) | |
tree | 3cdedbe87099c18e289bc140bef69e86dddf8b8d /checks | |
parent | f49d55a1e4bcd3e33ba8eee6afa92438ef61f0b3 (diff) |
Remove inclusions of unused headers.
Avoid using auto_ptr in the CVC headers.
Diffstat (limited to 'checks')
-rw-r--r-- | checks/cvc_tests.cpp | 19 | ||||
-rw-r--r-- | checks/ec_tests.cpp | 2 | ||||
-rw-r--r-- | checks/ecdsa.cpp | 1 |
3 files changed, 12 insertions, 10 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" |