diff options
-rw-r--r-- | openpgp/src/types/mod.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/openpgp/src/types/mod.rs b/openpgp/src/types/mod.rs index 951cfa8e..91749dd2 100644 --- a/openpgp/src/types/mod.rs +++ b/openpgp/src/types/mod.rs @@ -1017,19 +1017,19 @@ impl FromStr for HashAlgorithm { type Err = (); fn from_str(s: &str) -> result::Result<Self, ()> { - if s == "MD5" { + if s.eq_ignore_ascii_case("MD5") { Ok(HashAlgorithm::MD5) - } else if s == "SHA1" { + } else if s.eq_ignore_ascii_case("SHA1") { Ok(HashAlgorithm::SHA1) - } else if s == "RipeMD160" { + } else if s.eq_ignore_ascii_case("RipeMD160") { Ok(HashAlgorithm::RipeMD) - } else if s == "SHA256" { + } else if s.eq_ignore_ascii_case("SHA256") { Ok(HashAlgorithm::SHA256) - } else if s == "SHA384" { + } else if s.eq_ignore_ascii_case("SHA384") { Ok(HashAlgorithm::SHA384) - } else if s == "SHA512" { + } else if s.eq_ignore_ascii_case("SHA512") { Ok(HashAlgorithm::SHA512) - } else if s == "SHA224" { + } else if s.eq_ignore_ascii_case("SHA224") { Ok(HashAlgorithm::SHA224) } else { Err(()) |