aboutsummaryrefslogtreecommitdiffstats
path: root/src/pk_pad/emsa2/emsa2.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-09-29 03:08:47 +0000
committerlloyd <[email protected]>2008-09-29 03:08:47 +0000
commit8479818176b1b80376541e33e49d65589e8feabb (patch)
treef17e9e17286766ada342bc1a9778b98122a378e0 /src/pk_pad/emsa2/emsa2.cpp
parent9e3118d4ded9af1f75ec0512fa9a6bc3725a6ae1 (diff)
Remove more dependencies on the global state object.
New argument to X509_CRL constructor, a boolean that specifies if an exception should be thrown upon encountering an unknown extension type marked as critical. Previously this was controlled globally via the x509/crl/unknown_critical policy flag.
Diffstat (limited to 'src/pk_pad/emsa2/emsa2.cpp')
-rw-r--r--src/pk_pad/emsa2/emsa2.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/pk_pad/emsa2/emsa2.cpp b/src/pk_pad/emsa2/emsa2.cpp
index 24292d390..9f5f4b277 100644
--- a/src/pk_pad/emsa2/emsa2.cpp
+++ b/src/pk_pad/emsa2/emsa2.cpp
@@ -96,11 +96,16 @@ bool EMSA2::verify(const MemoryRegion<byte>& coded,
*************************************************/
EMSA2::EMSA2(const std::string& hash_name)
{
- hash_id = ieee1363_hash_id(hash_name);
- if(hash_id == 0)
- throw Encoding_Error("EMSA2 cannot be used with " + hash->name());
hash = get_hash(hash_name);
empty_hash = hash->final();
+
+ hash_id = ieee1363_hash_id(hash->name());
+
+ if(hash_id == 0)
+ {
+ delete hash;
+ throw Encoding_Error("EMSA2 cannot be used with " + hash->name());
+ }
}
}