diff options
author | lloyd <[email protected]> | 2008-09-29 03:08:47 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-09-29 03:08:47 +0000 |
commit | 8479818176b1b80376541e33e49d65589e8feabb (patch) | |
tree | f17e9e17286766ada342bc1a9778b98122a378e0 /src/pk_pad/hash_id/hash_id.cpp | |
parent | 9e3118d4ded9af1f75ec0512fa9a6bc3725a6ae1 (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/hash_id/hash_id.cpp')
-rw-r--r-- | src/pk_pad/hash_id/hash_id.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/pk_pad/hash_id/hash_id.cpp b/src/pk_pad/hash_id/hash_id.cpp index 27225b3b5..123a0de0e 100644 --- a/src/pk_pad/hash_id/hash_id.cpp +++ b/src/pk_pad/hash_id/hash_id.cpp @@ -4,7 +4,7 @@ *************************************************/ #include <botan/hash_id.h> -#include <botan/libstate.h> +#include <botan/exceptn.h> namespace Botan { @@ -51,10 +51,8 @@ const byte TIGER_ID[] = { /************************************************* * Return the HashID, as specified by PKCS * *************************************************/ -MemoryVector<byte> pkcs_hash_id(const std::string& name_or_alias) +MemoryVector<byte> pkcs_hash_id(const std::string& name) { - const std::string name = global_state().deref_alias(name_or_alias); - MemoryVector<byte> out; if(name == "Parallel(MD5,SHA-160)") @@ -82,16 +80,14 @@ MemoryVector<byte> pkcs_hash_id(const std::string& name_or_alias) if(out.size()) return out; - throw Invalid_Argument("No PKCS #1 identifier for " + name_or_alias); + throw Invalid_Argument("No PKCS #1 identifier for " + name); } /************************************************* * Return the HashID, as specified by IEEE 1363 * *************************************************/ -byte ieee1363_hash_id(const std::string& name_or_alias) +byte ieee1363_hash_id(const std::string& name) { - const std::string name = global_state().deref_alias(name_or_alias); - if(name == "RIPEMD-160") return 0x31; if(name == "RIPEMD-128") return 0x32; if(name == "SHA-160") return 0x33; |