diff options
author | Jack Lloyd <[email protected]> | 2017-05-18 16:14:01 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-05-18 16:14:01 -0400 |
commit | bebecf225713bc7e8b2082adfd163a173e4483c1 (patch) | |
tree | 4f7b396518bb6b2a157e0c0bf520d98e2a47fcea | |
parent | 2c21c5ca62062f82d160b8ef8d0e386e9d38f111 (diff) |
Accept SHA1 and SHA-1 as aliases for hash_id
-rw-r--r-- | src/lib/pk_pad/hash_id/hash_id.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/pk_pad/hash_id/hash_id.cpp b/src/lib/pk_pad/hash_id/hash_id.cpp index 70b7470c4..71a3dbe22 100644 --- a/src/lib/pk_pad/hash_id/hash_id.cpp +++ b/src/lib/pk_pad/hash_id/hash_id.cpp @@ -67,7 +67,7 @@ std::vector<uint8_t> pkcs_hash_id(const std::string& name) return std::vector<uint8_t>(RIPEMD_160_PKCS_ID, RIPEMD_160_PKCS_ID + sizeof(RIPEMD_160_PKCS_ID)); - if(name == "SHA-160") + if(name == "SHA-160" || name == "SHA-1" || name == "SHA1") return std::vector<uint8_t>(SHA_160_PKCS_ID, SHA_160_PKCS_ID + sizeof(SHA_160_PKCS_ID)); @@ -103,7 +103,8 @@ std::vector<uint8_t> pkcs_hash_id(const std::string& name) */ uint8_t ieee1363_hash_id(const std::string& name) { - if(name == "SHA-160") return 0x33; + if(name == "SHA-160" || name == "SHA-1" || name == "SHA1") + return 0x33; if(name == "SHA-224") return 0x38; if(name == "SHA-256") return 0x34; |