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

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

Issue 1923433002: Certificate path builder for new certificate verification library (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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/parse_certificate.cc
diff --git a/net/cert/internal/parse_certificate.cc b/net/cert/internal/parse_certificate.cc
index 738d91b13d256d7f43ac03c0449a04264029ee01..3a95652ae4341aa4bdab637e72cd0744bfeec821 100644
--- a/net/cert/internal/parse_certificate.cc
+++ b/net/cert/internal/parse_certificate.cc
@@ -154,10 +154,47 @@ ParsedCertificate::ParsedCertificate() {}
ParsedCertificate::~ParsedCertificate() {}
+// XXX these "copy without reparsing" constructors are kind ugly. think about
+// other options?
+ParsedCertificate::ParsedCertificate(const ParsedCertificate& other,
+ const der::Input& old_data,
+ const der::Input& new_data)
+ : tbs_certificate_tlv(other.tbs_certificate_tlv, old_data, new_data),
+ signature_algorithm_tlv(other.signature_algorithm_tlv,
+ old_data,
+ new_data),
+ signature_value(
+ der::Input(other.signature_value.bytes(), old_data, new_data),
+ other.signature_value.unused_bits()) {}
+
ParsedTbsCertificate::ParsedTbsCertificate() {}
ParsedTbsCertificate::~ParsedTbsCertificate() {}
+ParsedTbsCertificate::ParsedTbsCertificate(const ParsedTbsCertificate& other,
+ const der::Input& old_data,
+ const der::Input& new_data)
+ : version(other.version),
+ serial_number(other.serial_number, old_data, new_data),
+ signature_algorithm_tlv(other.signature_algorithm_tlv,
+ old_data,
+ new_data),
+ issuer_tlv(other.issuer_tlv, old_data, new_data),
+ validity_not_before(other.validity_not_before),
+ validity_not_after(other.validity_not_after),
+ subject_tlv(other.subject_tlv, old_data, new_data),
+ spki_tlv(other.spki_tlv, old_data, new_data),
+ has_issuer_unique_id(other.has_issuer_unique_id),
+ issuer_unique_id(
+ der::Input(other.issuer_unique_id.bytes(), old_data, new_data),
+ other.issuer_unique_id.unused_bits()),
+ has_subject_unique_id(other.has_subject_unique_id),
+ subject_unique_id(
+ der::Input(other.subject_unique_id.bytes(), old_data, new_data),
+ other.subject_unique_id.unused_bits()),
+ has_extensions(other.has_extensions),
+ extensions_tlv(other.extensions_tlv, old_data, new_data) {}
+
bool VerifySerialNumber(const der::Input& value) {
bool unused_negative;
if (!der::IsValidInteger(value, &unused_negative))

Powered by Google App Engine
This is Rietveld 408576698