diff options
author | lloyd <[email protected]> | 2010-03-04 04:12:01 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-03-04 04:12:01 +0000 |
commit | 75f888fc3776519d41ac242a2559e4c7e78f86a0 (patch) | |
tree | a2e9ac31e2fb5bfd81f7832b9c848e74af32fc4e /src/cert/cvc | |
parent | 280ed6b255770be9608acbf3afa3e14f5824778a (diff) |
Changes to CVC to deal with the fact that you can't create an uninitialized
ECDSA_PublicKey object anymore.
Diffstat (limited to 'src/cert/cvc')
-rw-r--r-- | src/cert/cvc/cvc_cert.cpp | 5 | ||||
-rw-r--r-- | src/cert/cvc/cvc_cert.h | 4 | ||||
-rw-r--r-- | src/cert/cvc/cvc_gen_cert.h | 9 |
3 files changed, 10 insertions, 8 deletions
diff --git a/src/cert/cvc/cvc_cert.cpp b/src/cert/cvc/cvc_cert.cpp index a31981ef5..9cc2bb7e5 100644 --- a/src/cert/cvc/cvc_cert.cpp +++ b/src/cert/cvc/cvc_cert.cpp @@ -88,10 +88,11 @@ bool EAC1_1_CVC::operator==(EAC1_1_CVC const& rhs) const && get_concat_sig() == rhs.get_concat_sig()); } -ECDSA_PublicKey decode_eac1_1_key(const MemoryRegion<byte>& enc_key, - AlgorithmIdentifier& sig_algo) +ECDSA_PublicKey* decode_eac1_1_key(const MemoryRegion<byte>&, + AlgorithmIdentifier&) { throw Internal_Error("decode_eac1_1_key: Unimplemented"); + return 0; } EAC1_1_CVC make_cvc_cert(PK_Signer& signer, diff --git a/src/cert/cvc/cvc_cert.h b/src/cert/cvc/cvc_cert.h index 6e2966a6f..12bc41a9c 100644 --- a/src/cert/cvc/cvc_cert.h +++ b/src/cert/cvc/cvc_cert.h @@ -106,8 +106,8 @@ EAC1_1_CVC BOTAN_DLL make_cvc_cert(PK_Signer& signer, /** * Decode an EAC encoding ECDSA key */ -ECDSA_PublicKey BOTAN_DLL decode_eac1_1_key(const MemoryRegion<byte>& enc_key, - AlgorithmIdentifier& sig_algo); +BOTAN_DLL ECDSA_PublicKey* decode_eac1_1_key(const MemoryRegion<byte>& enc_key, + AlgorithmIdentifier& sig_algo); } diff --git a/src/cert/cvc/cvc_gen_cert.h b/src/cert/cvc/cvc_gen_cert.h index 48cc73d86..4ad8cfaac 100644 --- a/src/cert/cvc/cvc_gen_cert.h +++ b/src/cert/cvc/cvc_gen_cert.h @@ -78,10 +78,10 @@ class EAC1_1_gen_CVC : public EAC1_1_obj<Derived> // CRTP continuation from EAC1 RandomNumberGenerator& rng); virtual ~EAC1_1_gen_CVC<Derived>() - {} + { delete m_pk; } protected: - ECDSA_PublicKey m_pk; // public key + ECDSA_PublicKey* m_pk; ASN1_Chr m_chr; bool self_signed; @@ -117,9 +117,10 @@ MemoryVector<byte> EAC1_1_gen_CVC<Derived>::make_signed( .get_contents(); } -template<typename Derived> std::auto_ptr<Public_Key> EAC1_1_gen_CVC<Derived>::subject_public_key() const +template<typename Derived> +std::auto_ptr<Public_Key> EAC1_1_gen_CVC<Derived>::subject_public_key() const { - return std::auto_ptr<Public_Key>(new ECDSA_PublicKey(m_pk)); + return std::auto_ptr<Public_Key>(new ECDSA_PublicKey(*m_pk)); } template<typename Derived> SecureVector<byte> EAC1_1_gen_CVC<Derived>::build_cert_body(MemoryRegion<byte> const& tbs) |