Commit 9fedeb4a authored by eroman's avatar eroman Committed by Commit bot

Rename CreateFromDer() to Create().

This is consistent with ParsedCertificate::Create() and
SignatureAlgorithm::Create().

Review-Url: https://codereview.chromium.org/2353333003
Cr-Commit-Position: refs/heads/master@{#420549}
parent f48d3b6d
...@@ -300,7 +300,7 @@ GeneralNames::GeneralNames() {} ...@@ -300,7 +300,7 @@ GeneralNames::GeneralNames() {}
GeneralNames::~GeneralNames() {} GeneralNames::~GeneralNames() {}
// static // static
std::unique_ptr<GeneralNames> GeneralNames::CreateFromDer( std::unique_ptr<GeneralNames> GeneralNames::Create(
const der::Input& general_names_tlv) { const der::Input& general_names_tlv) {
// RFC 5280 section 4.2.1.6: // RFC 5280 section 4.2.1.6:
// GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName // GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
...@@ -332,7 +332,7 @@ std::unique_ptr<GeneralNames> GeneralNames::CreateFromDer( ...@@ -332,7 +332,7 @@ std::unique_ptr<GeneralNames> GeneralNames::CreateFromDer(
NameConstraints::~NameConstraints() {} NameConstraints::~NameConstraints() {}
// static // static
std::unique_ptr<NameConstraints> NameConstraints::CreateFromDer( std::unique_ptr<NameConstraints> NameConstraints::Create(
const der::Input& extension_value, const der::Input& extension_value,
bool is_critical) { bool is_critical) {
std::unique_ptr<NameConstraints> name_constraints(new NameConstraints()); std::unique_ptr<NameConstraints> name_constraints(new NameConstraints());
......
...@@ -48,7 +48,7 @@ struct NET_EXPORT GeneralNames { ...@@ -48,7 +48,7 @@ struct NET_EXPORT GeneralNames {
// Create a GeneralNames object representing the DER-encoded // Create a GeneralNames object representing the DER-encoded
// |general_names_tlv|. // |general_names_tlv|.
static std::unique_ptr<GeneralNames> CreateFromDer( static std::unique_ptr<GeneralNames> Create(
const der::Input& general_names_tlv); const der::Input& general_names_tlv);
// ASCII hostnames. // ASCII hostnames.
...@@ -84,7 +84,7 @@ class NET_EXPORT NameConstraints { ...@@ -84,7 +84,7 @@ class NET_EXPORT NameConstraints {
// the OCTET STRING tag). |is_critical| should be true if the extension was // the OCTET STRING tag). |is_critical| should be true if the extension was
// marked critical. Returns nullptr if parsing the the extension failed. // marked critical. Returns nullptr if parsing the the extension failed.
// The object lifetime is not bound to the lifetime of |extension_value| data. // The object lifetime is not bound to the lifetime of |extension_value| data.
static std::unique_ptr<NameConstraints> CreateFromDer( static std::unique_ptr<NameConstraints> Create(
const der::Input& extension_value, const der::Input& extension_value,
bool is_critical); bool is_critical);
......
...@@ -85,7 +85,7 @@ struct NET_EXPORT ParseCertificateOptions { ...@@ -85,7 +85,7 @@ struct NET_EXPORT ParseCertificateOptions {
// //
// This contains the full (unverified) Tag-Length-Value for a SEQUENCE. No // This contains the full (unverified) Tag-Length-Value for a SEQUENCE. No
// guarantees are made regarding the value of this SEQUENCE. // guarantees are made regarding the value of this SEQUENCE.
// This can be further parsed using SignatureValue::CreateFromDer(). // This can be further parsed using SignatureValue::Create().
// //
// The |out_signature_value| parameter corresponds with "signatureValue" from // The |out_signature_value| parameter corresponds with "signatureValue" from
// RFC 5280: // RFC 5280:
...@@ -183,7 +183,7 @@ struct NET_EXPORT ParsedTbsCertificate { ...@@ -183,7 +183,7 @@ struct NET_EXPORT ParsedTbsCertificate {
// This contains the full (unverified) Tag-Length-Value for a SEQUENCE. No // This contains the full (unverified) Tag-Length-Value for a SEQUENCE. No
// guarantees are made regarding the value of this SEQUENCE. // guarantees are made regarding the value of this SEQUENCE.
// //
// This can be further parsed using SignatureValue::CreateFromDer(). // This can be further parsed using SignatureValue::Create().
der::Input signature_algorithm_tlv; der::Input signature_algorithm_tlv;
// Corresponds with "issuer" from RFC 5280: // Corresponds with "issuer" from RFC 5280:
......
...@@ -61,7 +61,7 @@ void ParseCertificateForFuzzer(const der::Input& in) { ...@@ -61,7 +61,7 @@ void ParseCertificateForFuzzer(const der::Input& in) {
if (FindExtension(KeyUsageOid(), &extensions, &extension)) if (FindExtension(KeyUsageOid(), &extensions, &extension))
ignore_result(ParseKeyUsage(extension.value, &key_usage)); ignore_result(ParseKeyUsage(extension.value, &key_usage));
if (FindExtension(SubjectAltNameOid(), &extensions, &extension)) if (FindExtension(SubjectAltNameOid(), &extensions, &extension))
GeneralNames::CreateFromDer(extension.value); GeneralNames::Create(extension.value);
if (FindExtension(CertificatePoliciesOid(), &extensions, &extension)) if (FindExtension(CertificatePoliciesOid(), &extensions, &extension))
ParseCertificatePoliciesExtension(extension.value, &policies); ParseCertificatePoliciesExtension(extension.value, &policies);
if (FindExtension(ExtKeyUsageOid(), &extensions, &extension)) if (FindExtension(ExtKeyUsageOid(), &extensions, &extension))
......
...@@ -104,7 +104,7 @@ scoped_refptr<ParsedCertificate> ParsedCertificate::CreateInternal( ...@@ -104,7 +104,7 @@ scoped_refptr<ParsedCertificate> ParsedCertificate::CreateInternal(
} }
// Attempt to parse the signature algorithm contained in the Certificate. // Attempt to parse the signature algorithm contained in the Certificate.
// Do not give up on failure here, since SignatureAlgorithm::CreateFromDer // Do not give up on failure here, since SignatureAlgorithm::Create
// will fail on valid but unsupported signature algorithms. // will fail on valid but unsupported signature algorithms.
// TODO(mattm): should distinguish between unsupported algorithms and parsing // TODO(mattm): should distinguish between unsupported algorithms and parsing
// errors. // errors.
...@@ -155,8 +155,8 @@ scoped_refptr<ParsedCertificate> ParsedCertificate::CreateInternal( ...@@ -155,8 +155,8 @@ scoped_refptr<ParsedCertificate> ParsedCertificate::CreateInternal(
&result->subject_alt_names_extension_)) { &result->subject_alt_names_extension_)) {
// RFC 5280 section 4.2.1.6: // RFC 5280 section 4.2.1.6:
// SubjectAltName ::= GeneralNames // SubjectAltName ::= GeneralNames
result->subject_alt_names_ = GeneralNames::CreateFromDer( result->subject_alt_names_ =
result->subject_alt_names_extension_.value); GeneralNames::Create(result->subject_alt_names_extension_.value);
if (!result->subject_alt_names_) if (!result->subject_alt_names_)
return nullptr; return nullptr;
// RFC 5280 section 4.1.2.6: // RFC 5280 section 4.1.2.6:
...@@ -174,7 +174,7 @@ scoped_refptr<ParsedCertificate> ParsedCertificate::CreateInternal( ...@@ -174,7 +174,7 @@ scoped_refptr<ParsedCertificate> ParsedCertificate::CreateInternal(
if (ConsumeExtension(NameConstraintsOid(), &result->unparsed_extensions_, if (ConsumeExtension(NameConstraintsOid(), &result->unparsed_extensions_,
&extension)) { &extension)) {
result->name_constraints_ = result->name_constraints_ =
NameConstraints::CreateFromDer(extension.value, extension.critical); NameConstraints::Create(extension.value, extension.critical);
if (!result->name_constraints_) if (!result->name_constraints_)
return nullptr; return nullptr;
} }
......
...@@ -159,7 +159,7 @@ bool ParseCertificateSandboxed(const base::StringPiece& certificate, ...@@ -159,7 +159,7 @@ bool ParseCertificateSandboxed(const base::StringPiece& certificate,
auto iter = extensions.find(SubjectAltNameOid()); auto iter = extensions.find(SubjectAltNameOid());
if (iter != extensions.end()) { if (iter != extensions.end()) {
std::unique_ptr<GeneralNames> subject_alt_names = std::unique_ptr<GeneralNames> subject_alt_names =
GeneralNames::CreateFromDer(iter->second.value); GeneralNames::Create(iter->second.value);
if (subject_alt_names) { if (subject_alt_names) {
*dns_names = subject_alt_names->dns_names; *dns_names = subject_alt_names->dns_names;
for (const auto& ip : subject_alt_names->ip_addresses) for (const auto& ip : subject_alt_names->ip_addresses)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment