diff options
author | lloyd <[email protected]> | 2008-09-28 20:49:38 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-09-28 20:49:38 +0000 |
commit | f5ebea8d593d2f6d5b536ddb978f44d80d4e873f (patch) | |
tree | 77f832e660d6e64b83aebbee9ad6958c2941d1d3 /checks/pk.cpp | |
parent | 3ed23593a56fdb6f98516d99ab738e2f7675b4ec (diff) |
Compliation fixes
Diffstat (limited to 'checks/pk.cpp')
-rw-r--r-- | checks/pk.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/checks/pk.cpp b/checks/pk.cpp index 2ebd739d3..618ba8f25 100644 --- a/checks/pk.cpp +++ b/checks/pk.cpp @@ -19,7 +19,7 @@ #include <botan/dh.h> #endif -#if defined(BOTAN_HAS_RN) +#if defined(BOTAN_HAS_NR) #include <botan/nr.h> #endif @@ -176,7 +176,7 @@ u32bit validate_rsa_enc_pkcs8(const std::string& algo, std::auto_ptr<Private_Key> privkey(PKCS8::load_key(keysource, rng, pass)); - RSA_PrivateKey* rsapriv = dynamic_cast<RSA_PrivateKey*>(privkey); + RSA_PrivateKey* rsapriv = dynamic_cast<RSA_PrivateKey*>(privkey.get()); if(!rsapriv) throw Invalid_Argument("Bad key load for RSA key"); @@ -315,7 +315,7 @@ u32bit validate_rsa_ver_x509(const std::string& algo, std::auto_ptr<Public_Key> key(X509::load_key(keysource)); - RSA_PublicKey* rsakey = dynamic_cast<RSA_PublicKey*>(key); + RSA_PublicKey* rsakey = dynamic_cast<RSA_PublicKey*>(key.get()); if(!rsakey) throw Invalid_Argument("Bad key load for RSA public key"); @@ -402,7 +402,7 @@ u32bit validate_dsa_sig(const std::string& algo, std::auto_ptr<Private_Key> privkey(PKCS8::load_key(keysource, rng, pass)); - DSA_PrivateKey* dsapriv = dynamic_cast<DSA_PrivateKey*>(privkey); + DSA_PrivateKey* dsapriv = dynamic_cast<DSA_PrivateKey*>(privkey.get()); if(!dsapriv) throw Invalid_Argument("Bad key load for DSA private key"); @@ -414,7 +414,6 @@ u32bit validate_dsa_sig(const std::string& algo, PK_Signer* s = get_pk_signer(*dsapriv, emsa); validate_signature(v, s, algo, str[1], str[2], str[3], failure); - delete privkey; #endif return (failure ? 1 : 0); @@ -434,7 +433,7 @@ u32bit validate_dsa_ver(const std::string& algo, #if defined(BOTAN_HAS_DSA) std::auto_ptr<Public_Key> key(X509::load_key(keysource)); - DSA_PublicKey* dsakey = dynamic_cast<DSA_PublicKey*>(key); + DSA_PublicKey* dsakey = dynamic_cast<DSA_PublicKey*>(key.get()); if(!dsakey) throw Invalid_Argument("Bad key load for DSA public key"); |