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

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

Issue 2349093002: Change the interface for parsing SignatureAlgorithm to take a (Closed)
Patch Set: add comment Created 4 years, 3 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
Index: net/cert/internal/signature_algorithm.cc
diff --git a/net/cert/internal/signature_algorithm.cc b/net/cert/internal/signature_algorithm.cc
index e9bc3c536fa3694eb3c1ed688724e2be2415198c..0a1b0e610edd09456d74cb6fd793cf00cfcb5011 100644
--- a/net/cert/internal/signature_algorithm.cc
+++ b/net/cert/internal/signature_algorithm.cc
@@ -537,8 +537,11 @@ RsaPssParameters::RsaPssParameters(DigestAlgorithm mgf1_hash,
SignatureAlgorithm::~SignatureAlgorithm() {
}
-std::unique_ptr<SignatureAlgorithm> SignatureAlgorithm::CreateFromDer(
- const der::Input& algorithm_identifier) {
+std::unique_ptr<SignatureAlgorithm> SignatureAlgorithm::Create(
+ const der::Input& algorithm_identifier,
+ CertErrors* errors) {
+ // TODO(crbug.com/634443): Add useful error information.
+
der::Input oid;
der::Input params;
if (!ParseAlgorithmIdentifier(algorithm_identifier, &oid, &params))
@@ -577,6 +580,9 @@ std::unique_ptr<SignatureAlgorithm> SignatureAlgorithm::CreateFromDer(
if (oid == der::Input(kOidSha1WithRsaSignature))
return ParseRsaPkcs1(DigestAlgorithm::Sha1, params);
+ // TODO(crbug.com/634443): Add an error indicating what the OID
+ // was.
+
return nullptr; // Unsupported OID.
}

Powered by Google App Engine
This is Rietveld 408576698