diff options
author | lloyd <[email protected]> | 2006-09-06 04:21:04 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-09-06 04:21:04 +0000 |
commit | e9900b3dbf7be92150235b3dd603bde92c0e4b70 (patch) | |
tree | 019fb940eb8ebb50676055a5efe1e9e36daad48f /include | |
parent | 603c90c01ab1c967fd80e2e39b9cf3b48189d6a6 (diff) |
PK_Verifier no longer keeps a reference to the key being used; it only
ever needed it to pull a few pieces of information from the key, which
it now gets by calling pure virtual functions implemented by its children.
Diffstat (limited to 'include')
-rw-r--r-- | include/pubkey.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/include/pubkey.h b/include/pubkey.h index 68abe290f..d105f708c 100644 --- a/include/pubkey.h +++ b/include/pubkey.h @@ -83,15 +83,16 @@ class PK_Verifier void set_input_format(Signature_Format); - PK_Verifier(const PK_Key&, const std::string&); - virtual ~PK_Verifier() { delete emsa; } + PK_Verifier(const std::string&); + virtual ~PK_Verifier(); protected: virtual bool validate_signature(const MemoryRegion<byte>&, const byte[], u32bit) = 0; + virtual u32bit key_message_parts() const = 0; + virtual u32bit key_message_part_size() const = 0; + Signature_Format sig_format; EMSA* emsa; - private: - const PK_Key& key; }; /************************************************* @@ -149,6 +150,9 @@ class PK_Verifier_with_MR : public PK_Verifier PK_Verifier_with_MR(const PK_Verifying_with_MR_Key&, const std::string&); private: bool validate_signature(const MemoryRegion<byte>&, const byte[], u32bit); + u32bit key_message_parts() const { return key.message_parts(); } + u32bit key_message_part_size() const { return key.message_part_size(); } + const PK_Verifying_with_MR_Key& key; }; @@ -161,6 +165,9 @@ class PK_Verifier_wo_MR : public PK_Verifier PK_Verifier_wo_MR(const PK_Verifying_wo_MR_Key&, const std::string&); private: bool validate_signature(const MemoryRegion<byte>&, const byte[], u32bit); + u32bit key_message_parts() const { return key.message_parts(); } + u32bit key_message_part_size() const { return key.message_part_size(); } + const PK_Verifying_wo_MR_Key& key; }; |