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

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

Issue 2731603002: Check TBSCertificate.algorithm and Certificate.signatureAlgorithm for (Closed)
Patch Set: Use rsleevi's background comment Created 3 years, 9 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/cert_verify_proc_unittest.cc ('k') | net/cert/internal/signature_algorithm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/signature_algorithm.h
diff --git a/net/cert/internal/signature_algorithm.h b/net/cert/internal/signature_algorithm.h
index 0f316de90c59dc41544ea3e91ca92c9f172634a6..58b9582bbab056277e67d890e0d3c2aa3b38b964 100644
--- a/net/cert/internal/signature_algorithm.h
+++ b/net/cert/internal/signature_algorithm.h
@@ -52,7 +52,7 @@ enum class SignatureAlgorithmId {
// { IDENTIFIER id-sha384 PARAMS TYPE NULL ARE preferredPresent } |
// { IDENTIFIER id-sha512 PARAMS TYPE NULL ARE preferredPresent }
// }
-WARN_UNUSED_RESULT bool ParseHashAlgorithm(const der::Input input,
+WARN_UNUSED_RESULT bool ParseHashAlgorithm(const der::Input& input,
DigestAlgorithm* out);
// Base class for describing algorithm parameters.
@@ -118,6 +118,13 @@ class NET_EXPORT SignatureAlgorithm {
// The returned pointer is non-owned, and has the same lifetime as |this|.
const RsaPssParameters* ParamsForRsaPss() const;
+ bool has_params() const { return !!params_; }
+
+ // Returns true if |alg1_tlv| and |alg2_tlv| represent an equivalent
+ // AlgorithmIdentifier once parsed.
+ static bool IsEquivalent(const der::Input& alg1_tlv,
+ const der::Input& alg2_tlv);
+
private:
SignatureAlgorithm(SignatureAlgorithmId algorithm,
DigestAlgorithm digest,
« no previous file with comments | « net/cert/cert_verify_proc_unittest.cc ('k') | net/cert/internal/signature_algorithm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698