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

Unified Diff: net/cert/ct_serialization.cc

Issue 71633002: Convert SignedCertificateClass to be ref_counted, and add an SCTStore in which to store them. Add S… Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: few lint fixes Created 7 years, 1 month 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/ct_serialization.h ('k') | net/cert/ct_verify_result.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/ct_serialization.cc
diff --git a/net/cert/ct_serialization.cc b/net/cert/ct_serialization.cc
index 691b18d96cb1b08be2fb8bf3abb87035a3c73353..c139ec9e56713a3f927083d74a5617218f41f263 100644
--- a/net/cert/ct_serialization.cc
+++ b/net/cert/ct_serialization.cc
@@ -317,8 +317,9 @@ bool DecodeSCTList(base::StringPiece* input,
}
bool DecodeSignedCertificateTimestamp(base::StringPiece* input,
- SignedCertificateTimestamp* output) {
- SignedCertificateTimestamp result;
+ scoped_refptr<SignedCertificateTimestamp>* output) {
+ scoped_refptr<SignedCertificateTimestamp> result(
+ new SignedCertificateTimestamp());
unsigned version;
if (!ReadUint(kVersionLength, input, &version))
return false;
@@ -327,7 +328,7 @@ bool DecodeSignedCertificateTimestamp(base::StringPiece* input,
return false;
}
- result.version = SignedCertificateTimestamp::SCT_VERSION_1;
+ result->version = SignedCertificateTimestamp::SCT_VERSION_1;
uint64 timestamp;
base::StringPiece log_id;
base::StringPiece extensions;
@@ -335,7 +336,7 @@ bool DecodeSignedCertificateTimestamp(base::StringPiece* input,
!ReadUint(kTimestampLength, input, &timestamp) ||
!ReadVariableBytes(kExtensionsLengthBytes, input,
&extensions) ||
- !DecodeDigitallySigned(input, &result.signature)) {
+ !DecodeDigitallySigned(input, &result->signature)) {
return false;
}
@@ -344,13 +345,13 @@ bool DecodeSignedCertificateTimestamp(base::StringPiece* input,
return false;
}
- log_id.CopyToString(&result.log_id);
- extensions.CopyToString(&result.extensions);
- result.timestamp =
+ log_id.CopyToString(&result->log_id);
+ extensions.CopyToString(&result->extensions);
+ result->timestamp =
base::Time::UnixEpoch() +
base::TimeDelta::FromMilliseconds(static_cast<int64>(timestamp));
- *output = result;
+ output->swap(result);
return true;
}
« no previous file with comments | « net/cert/ct_serialization.h ('k') | net/cert/ct_verify_result.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698