diff options
author | lloyd <[email protected]> | 2010-03-21 23:30:14 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-03-21 23:30:14 +0000 |
commit | f8a77dd91e8b3aed644c2c206ff9b8822fb3ae02 (patch) | |
tree | 315cbc118a8ba2afda674154e7c65e8900a00cb8 /checks/ecdsa.cpp | |
parent | 572c106e868821da13447ca7349523ef4a90ec2c (diff) | |
parent | 634f3d27f7faad1dc558821382f71ecc2194637d (diff) |
propagate from branch 'net.randombit.botan' (head 96d0a1885774b624812fd143d541c8bcda319217)
to branch 'net.randombit.botan.c++0x' (head e14368ab9d7976f3e111c6bc0adf24eebeb7c114)
Diffstat (limited to 'checks/ecdsa.cpp')
-rw-r--r-- | checks/ecdsa.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/checks/ecdsa.cpp b/checks/ecdsa.cpp index 3d2ee37f3..277239e72 100644 --- a/checks/ecdsa.cpp +++ b/checks/ecdsa.cpp @@ -126,7 +126,7 @@ void test_decode_ecdsa_X509() CHECK_MESSAGE(to_hex(cert.authority_key_id()) == "0096452DE588F966C4CCDF161DD1F3F5341B71E7", "error reading authority key id from x509 ecdsa certificate"); CHECK_MESSAGE(to_hex(cert.subject_key_id()) == "0096452DE588F966C4CCDF161DD1F3F5341B71E7", "error reading Subject key id from x509 ecdsa certificate"); - std::auto_ptr<X509_PublicKey> pubkey(cert.subject_public_key()); + std::unique_ptr<X509_PublicKey> pubkey(cert.subject_public_key()); bool ver_ec = cert.check_signature(*pubkey); CHECK_MESSAGE(ver_ec, "could not positively verify correct selfsigned x509-ecdsa certificate"); } @@ -138,7 +138,7 @@ void test_decode_ver_link_SHA256() X509_Certificate root_cert(TEST_DATA_DIR "/root2_SHA256.cer"); X509_Certificate link_cert(TEST_DATA_DIR "/link_SHA256.cer"); - std::auto_ptr<X509_PublicKey> pubkey(root_cert.subject_public_key()); + std::unique_ptr<X509_PublicKey> pubkey(root_cert.subject_public_key()); bool ver_ec = link_cert.check_signature(*pubkey); CHECK_MESSAGE(ver_ec, "could not positively verify correct SHA256 link x509-ecdsa certificate"); @@ -150,7 +150,7 @@ void test_decode_ver_link_SHA1() X509_Certificate root_cert(TEST_DATA_DIR "/root_SHA1.163.crt"); X509_Certificate link_cert(TEST_DATA_DIR "/link_SHA1.166.crt"); - std::auto_ptr<X509_PublicKey> pubkey(root_cert.subject_public_key()); + std::unique_ptr<X509_PublicKey> pubkey(root_cert.subject_public_key()); bool ver_ec = link_cert.check_signature(*pubkey); CHECK_MESSAGE(ver_ec, "could not positively verify correct SHA1 link x509-ecdsa certificate"); } @@ -273,11 +273,11 @@ void test_create_and_verify(RandomNumberGenerator& rng) std::ofstream priv_key(TEST_DATA_DIR "/dompar_private.pkcs8.pem"); priv_key << PKCS8::PEM_encode(key); - std::auto_ptr<PKCS8_PrivateKey> loaded_key(PKCS8::load_key(TEST_DATA_DIR "/wo_dompar_private.pkcs8.pem", rng)); + std::unique_ptr<PKCS8_PrivateKey> loaded_key(PKCS8::load_key(TEST_DATA_DIR "/wo_dompar_private.pkcs8.pem", rng)); ECDSA_PrivateKey* loaded_ec_key = dynamic_cast<ECDSA_PrivateKey*>(loaded_key.get()); CHECK_MESSAGE(loaded_ec_key, "the loaded key could not be converted into an ECDSA_PrivateKey"); - std::auto_ptr<PKCS8_PrivateKey> loaded_key_1(PKCS8::load_key(TEST_DATA_DIR "/rsa_private.pkcs8.pem", rng)); + std::unique_ptr<PKCS8_PrivateKey> loaded_key_1(PKCS8::load_key(TEST_DATA_DIR "/rsa_private.pkcs8.pem", rng)); ECDSA_PrivateKey* loaded_rsa_key = dynamic_cast<ECDSA_PrivateKey*>(loaded_key_1.get()); CHECK_MESSAGE(!loaded_rsa_key, "the loaded key is ECDSA_PrivateKey -> shouldn't be, is a RSA-Key"); @@ -311,7 +311,7 @@ void test_create_and_verify(RandomNumberGenerator& rng) std::string key_odd_oid_str = PKCS8::PEM_encode(key_odd_oid); DataSource_Memory key_data_src(key_odd_oid_str); - std::auto_ptr<PKCS8_PrivateKey> loaded_key2(PKCS8::load_key(key_data_src, rng)); + std::unique_ptr<PKCS8_PrivateKey> loaded_key2(PKCS8::load_key(key_data_src, rng)); if(!dynamic_cast<ECDSA_PrivateKey*>(loaded_key.get())) { @@ -387,7 +387,7 @@ void test_read_pkcs8(RandomNumberGenerator& rng) try { - std::auto_ptr<PKCS8_PrivateKey> loaded_key(PKCS8::load_key(TEST_DATA_DIR "/wo_dompar_private.pkcs8.pem", rng)); + std::unique_ptr<PKCS8_PrivateKey> loaded_key(PKCS8::load_key(TEST_DATA_DIR "/wo_dompar_private.pkcs8.pem", rng)); ECDSA_PrivateKey* ecdsa = dynamic_cast<ECDSA_PrivateKey*>(loaded_key.get()); CHECK_MESSAGE(ecdsa, "the loaded key could not be converted into an ECDSA_PrivateKey"); @@ -407,7 +407,7 @@ void test_read_pkcs8(RandomNumberGenerator& rng) try { - std::auto_ptr<PKCS8_PrivateKey> loaded_key_nodp(PKCS8::load_key(TEST_DATA_DIR "/nodompar_private.pkcs8.pem", rng)); + std::unique_ptr<PKCS8_PrivateKey> loaded_key_nodp(PKCS8::load_key(TEST_DATA_DIR "/nodompar_private.pkcs8.pem", rng)); // anew in each test with unregistered domain-parameters ECDSA_PrivateKey* ecdsa_nodp = dynamic_cast<ECDSA_PrivateKey*>(loaded_key_nodp.get()); CHECK_MESSAGE(ecdsa_nodp, "the loaded key could not be converted into an ECDSA_PrivateKey"); @@ -422,7 +422,7 @@ void test_read_pkcs8(RandomNumberGenerator& rng) try { - std::auto_ptr<PKCS8_PrivateKey> loaded_key_withdp( + std::unique_ptr<PKCS8_PrivateKey> loaded_key_withdp( PKCS8::load_key(TEST_DATA_DIR "/withdompar_private.pkcs8.pem", rng)); std::cout << "Unexpected success: loaded key with unknown OID\n"; |