Commit fb6173c7 authored by Matt Menke's avatar Matt Menke Committed by Commit Bot

Add const to a pair of x509 certificate methods.

Doesn't actually modify the method bodies at all.

Change-Id: I7354db324deeee4bfeb497038a704d9cbb98d961
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1733789Reviewed-by: default avatarDavid Benjamin <davidben@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683765}
parent dc7bac19
...@@ -327,7 +327,7 @@ CertificateList X509Certificate::CreateCertificateListFromBytes( ...@@ -327,7 +327,7 @@ CertificateList X509Certificate::CreateCertificateListFromBytes(
return results; return results;
} }
void X509Certificate::Persist(base::Pickle* pickle) { void X509Certificate::Persist(base::Pickle* pickle) const {
DCHECK(cert_buffer_); DCHECK(cert_buffer_);
// This would be an absolutely insane number of intermediates. // This would be an absolutely insane number of intermediates.
if (intermediate_ca_certs_.size() > static_cast<size_t>(INT_MAX) - 1) { if (intermediate_ca_certs_.size() > static_cast<size_t>(INT_MAX) - 1) {
...@@ -424,7 +424,7 @@ bool X509Certificate::EqualsIncludingChain(const X509Certificate* other) const { ...@@ -424,7 +424,7 @@ bool X509Certificate::EqualsIncludingChain(const X509Certificate* other) const {
} }
bool X509Certificate::IsIssuedByEncoded( bool X509Certificate::IsIssuedByEncoded(
const std::vector<std::string>& valid_issuers) { const std::vector<std::string>& valid_issuers) const {
std::vector<std::string> normalized_issuers; std::vector<std::string> normalized_issuers;
CertErrors errors; CertErrors errors;
for (const auto& raw_issuer : valid_issuers) { for (const auto& raw_issuer : valid_issuers) {
......
...@@ -145,7 +145,7 @@ class NET_EXPORT X509Certificate ...@@ -145,7 +145,7 @@ class NET_EXPORT X509Certificate
// The format is [int count], [data - this certificate], // The format is [int count], [data - this certificate],
// [data - intermediate1], ... [data - intermediateN]. // [data - intermediate1], ... [data - intermediateN].
// All certificates are stored in DER form. // All certificates are stored in DER form.
void Persist(base::Pickle* pickle); void Persist(base::Pickle* pickle) const;
// The serial number, DER encoded, possibly including a leading 00 byte. // The serial number, DER encoded, possibly including a leading 00 byte.
const std::string& serial_number() const { return serial_number_; } const std::string& serial_number() const { return serial_number_; }
...@@ -189,7 +189,7 @@ class NET_EXPORT X509Certificate ...@@ -189,7 +189,7 @@ class NET_EXPORT X509Certificate
// Do any of the given issuer names appear in this cert's chain of trust? // Do any of the given issuer names appear in this cert's chain of trust?
// |valid_issuers| is a list of DER-encoded X.509 DistinguishedNames. // |valid_issuers| is a list of DER-encoded X.509 DistinguishedNames.
bool IsIssuedByEncoded(const std::vector<std::string>& valid_issuers); bool IsIssuedByEncoded(const std::vector<std::string>& valid_issuers) const;
// Verifies that |hostname| matches this certificate. // Verifies that |hostname| matches this certificate.
// Does not verify that the certificate is valid, only that the certificate // Does not verify that the certificate is valid, only that the certificate
......
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