Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Unified Diff: net/cert/internal/signature_algorithm.cc

Issue 1664243002: Using == instead of Equals for der::Input comparison. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing comment. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert/internal/extended_key_usage_unittest.cc ('k') | net/cert/internal/test_helpers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/signature_algorithm.cc
diff --git a/net/cert/internal/signature_algorithm.cc b/net/cert/internal/signature_algorithm.cc
index 38158fce771bfdb37a7f9011611eb96bcc7997b6..23812546e366a954cd1f4d435f031d386e7671b2 100644
--- a/net/cert/internal/signature_algorithm.cc
+++ b/net/cert/internal/signature_algorithm.cc
@@ -340,13 +340,13 @@ WARN_UNUSED_RESULT bool ParseHashAlgorithm(const der::Input input,
DigestAlgorithm hash;
- if (oid.Equals(der::Input(kOidSha1))) {
+ if (oid == der::Input(kOidSha1)) {
hash = DigestAlgorithm::Sha1;
- } else if (oid.Equals(der::Input(kOidSha256))) {
+ } else if (oid == der::Input(kOidSha256)) {
hash = DigestAlgorithm::Sha256;
- } else if (oid.Equals(der::Input(kOidSha384))) {
+ } else if (oid == der::Input(kOidSha384)) {
hash = DigestAlgorithm::Sha384;
- } else if (oid.Equals(der::Input(kOidSha512))) {
+ } else if (oid == der::Input(kOidSha512)) {
hash = DigestAlgorithm::Sha512;
} else {
// Unsupported digest algorithm.
@@ -395,7 +395,7 @@ WARN_UNUSED_RESULT bool ParseMaskGenAlgorithm(const der::Input input,
return false;
// MGF1 is the only supported mask generation algorithm.
- if (!oid.Equals(der::Input(kOidMgf1)))
+ if (oid != der::Input(kOidMgf1))
return false;
return ParseHashAlgorithm(params, mgf1_hash);
@@ -555,34 +555,34 @@ scoped_ptr<SignatureAlgorithm> SignatureAlgorithm::CreateFromDer(
// TODO(eroman): Each OID is tested for equality in order, which is not
// particularly efficient.
- if (oid.Equals(der::Input(kOidSha1WithRsaEncryption)))
+ if (oid == der::Input(kOidSha1WithRsaEncryption))
return ParseRsaPkcs1(DigestAlgorithm::Sha1, params);
- if (oid.Equals(der::Input(kOidSha256WithRsaEncryption)))
+ if (oid == der::Input(kOidSha256WithRsaEncryption))
return ParseRsaPkcs1(DigestAlgorithm::Sha256, params);
- if (oid.Equals(der::Input(kOidSha384WithRsaEncryption)))
+ if (oid == der::Input(kOidSha384WithRsaEncryption))
return ParseRsaPkcs1(DigestAlgorithm::Sha384, params);
- if (oid.Equals(der::Input(kOidSha512WithRsaEncryption)))
+ if (oid == der::Input(kOidSha512WithRsaEncryption))
return ParseRsaPkcs1(DigestAlgorithm::Sha512, params);
- if (oid.Equals(der::Input(kOidEcdsaWithSha1)))
+ if (oid == der::Input(kOidEcdsaWithSha1))
return ParseEcdsa(DigestAlgorithm::Sha1, params);
- if (oid.Equals(der::Input(kOidEcdsaWithSha256)))
+ if (oid == der::Input(kOidEcdsaWithSha256))
return ParseEcdsa(DigestAlgorithm::Sha256, params);
- if (oid.Equals(der::Input(kOidEcdsaWithSha384)))
+ if (oid == der::Input(kOidEcdsaWithSha384))
return ParseEcdsa(DigestAlgorithm::Sha384, params);
- if (oid.Equals(der::Input(kOidEcdsaWithSha512)))
+ if (oid == der::Input(kOidEcdsaWithSha512))
return ParseEcdsa(DigestAlgorithm::Sha512, params);
- if (oid.Equals(der::Input(kOidRsaSsaPss)))
+ if (oid == der::Input(kOidRsaSsaPss))
return ParseRsaPss(params);
- if (oid.Equals(der::Input(kOidSha1WithRsaSignature)))
+ if (oid == der::Input(kOidSha1WithRsaSignature))
return ParseRsaPkcs1(DigestAlgorithm::Sha1, params);
return nullptr; // Unsupported OID.
« no previous file with comments | « net/cert/internal/extended_key_usage_unittest.cc ('k') | net/cert/internal/test_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698