diff options
author | lloyd <[email protected]> | 2010-03-02 19:23:27 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-03-02 19:23:27 +0000 |
commit | b43cc46149b6d653fb403b2f4c6b28483b6b975a (patch) | |
tree | 4a3762c6223a51ac0be4e6cbb77127de9ef56be6 /src/cert | |
parent | 200e88602c2f5d3b09ee6f1caaac3d14da6c8860 (diff) |
CVC assumed sigs were DER encoded by default. Not true
Diffstat (limited to 'src/cert')
-rw-r--r-- | src/cert/cvc/cvc_ado.cpp | 3 | ||||
-rw-r--r-- | src/cert/cvc/cvc_gen_cert.h | 3 | ||||
-rw-r--r-- | src/cert/cvc/eac_obj.h | 18 | ||||
-rw-r--r-- | src/cert/cvc/signed_obj.cpp | 8 |
4 files changed, 7 insertions, 25 deletions
diff --git a/src/cert/cvc/cvc_ado.cpp b/src/cert/cvc/cvc_ado.cpp index 5ff27020d..8c38e90ae 100644 --- a/src/cert/cvc/cvc_ado.cpp +++ b/src/cert/cvc/cvc_ado.cpp @@ -49,8 +49,7 @@ MemoryVector<byte> EAC1_1_ADO::make_signed(PK_Signer& signer, const MemoryRegion<byte>& tbs_bits, RandomNumberGenerator& rng) { - SecureVector<byte> concat_sig = - EAC1_1_obj<EAC1_1_ADO>::make_signature(signer, tbs_bits, rng); + SecureVector<byte> concat_sig = signer.sign_message(tbs_bits, rng); return DER_Encoder() .start_cons(ASN1_Tag(7), APPLICATION) diff --git a/src/cert/cvc/cvc_gen_cert.h b/src/cert/cvc/cvc_gen_cert.h index 4e3f3013e..8140cb050 100644 --- a/src/cert/cvc/cvc_gen_cert.h +++ b/src/cert/cvc/cvc_gen_cert.h @@ -106,8 +106,7 @@ MemoryVector<byte> EAC1_1_gen_CVC<Derived>::make_signed( const MemoryRegion<byte>& tbs_bits, RandomNumberGenerator& rng) // static { - SecureVector<byte> concat_sig = - EAC1_1_obj<Derived>::make_signature(signer, tbs_bits, rng); + SecureVector<byte> concat_sig = signer.sign_message(tbs_bits, rng); return DER_Encoder() .start_cons(ASN1_Tag(33), APPLICATION) diff --git a/src/cert/cvc/eac_obj.h b/src/cert/cvc/eac_obj.h index 82aaee787..d4f02c530 100644 --- a/src/cert/cvc/eac_obj.h +++ b/src/cert/cvc/eac_obj.h @@ -46,30 +46,16 @@ class BOTAN_DLL EAC1_1_obj : public EAC_Signed_Object protected: void init(DataSource& in); - static SecureVector<byte> - make_signature(PK_Signer& signer, - const MemoryRegion<byte>& tbs_bits, - RandomNumberGenerator& rng); - virtual ~EAC1_1_obj<Derived>(){} }; -template<typename Derived> SecureVector<byte> EAC1_1_obj<Derived>::get_concat_sig() const +template<typename Derived> +SecureVector<byte> EAC1_1_obj<Derived>::get_concat_sig() const { return m_sig.get_concatenation(); } -template<typename Derived> SecureVector<byte> -EAC1_1_obj<Derived>::make_signature(PK_Signer& signer, - const MemoryRegion<byte>& tbs_bits, - RandomNumberGenerator& rng) - { - // this is the signature as a der sequence - ECDSA_Signature sig(signer.sign_message(tbs_bits, rng)); - return sig.get_concatenation(); - } - template<typename Derived> void EAC1_1_obj<Derived>::init(DataSource& in) { diff --git a/src/cert/cvc/signed_obj.cpp b/src/cert/cvc/signed_obj.cpp index 4a08ed0ac..022d0fa5f 100644 --- a/src/cert/cvc/signed_obj.cpp +++ b/src/cert/cvc/signed_obj.cpp @@ -1,5 +1,5 @@ /* -* X.509 SIGNED Object +* EAC SIGNED Object * (C) 1999-2007 Jack Lloyd * 2007 FlexSecure GmbH * @@ -53,14 +53,12 @@ void EAC_Signed_Object::do_decode() catch(Decoding_Error& e) { const std::string what = e.what(); - throw Decoding_Error(PEM_label_pref + " decoding failed (" + - what.substr(23, std::string::npos) + ")"); + throw Decoding_Error(PEM_label_pref + " decoding failed (" + what + ")"); } catch(Invalid_Argument& e) { const std::string what = e.what(); - throw Decoding_Error(PEM_label_pref + " decoding failed (" + - what.substr(7, std::string::npos) + ")"); + throw Decoding_Error(PEM_label_pref + " decoding failed (" + what + ")"); } } |