summaryrefslogtreecommitdiffstats
path: root/net/quic/crypto/proof_verifier_chromium.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/quic/crypto/proof_verifier_chromium.cc')
-rw-r--r--net/quic/crypto/proof_verifier_chromium.cc36
1 files changed, 20 insertions, 16 deletions
diff --git a/net/quic/crypto/proof_verifier_chromium.cc b/net/quic/crypto/proof_verifier_chromium.cc
index 8584aed..fdb6a0d 100644
--- a/net/quic/crypto/proof_verifier_chromium.cc
+++ b/net/quic/crypto/proof_verifier_chromium.cc
@@ -47,7 +47,7 @@ class ProofVerifierChromium::Job {
const std::vector<std::string>& certs,
const std::string& signature,
std::string* error_details,
- scoped_ptr<ProofVerifyDetails>* details,
+ scoped_ptr<ProofVerifyDetails>* verify_details,
ProofVerifierCallback* callback);
private:
@@ -104,10 +104,10 @@ ProofVerifierChromium::Status ProofVerifierChromium::Job::VerifyProof(
const vector<string>& certs,
const string& signature,
std::string* error_details,
- scoped_ptr<ProofVerifyDetails>* details,
+ scoped_ptr<ProofVerifyDetails>* verify_details,
ProofVerifierCallback* callback) {
DCHECK(error_details);
- DCHECK(details);
+ DCHECK(verify_details);
DCHECK(callback);
callback_.reset(callback);
@@ -125,7 +125,7 @@ ProofVerifierChromium::Status ProofVerifierChromium::Job::VerifyProof(
*error_details = "Failed to create certificate chain. Certs are empty.";
DLOG(WARNING) << *error_details;
verify_details_->cert_verify_result.cert_status = CERT_STATUS_INVALID;
- details->reset(verify_details_.release());
+ verify_details->reset(verify_details_.release());
return FAILURE;
}
@@ -139,7 +139,7 @@ ProofVerifierChromium::Status ProofVerifierChromium::Job::VerifyProof(
*error_details = "Failed to create certificate chain";
DLOG(WARNING) << *error_details;
verify_details_->cert_verify_result.cert_status = CERT_STATUS_INVALID;
- details->reset(verify_details_.release());
+ verify_details->reset(verify_details_.release());
return FAILURE;
}
@@ -149,7 +149,7 @@ ProofVerifierChromium::Status ProofVerifierChromium::Job::VerifyProof(
*error_details = "Failed to verify signature of server config";
DLOG(WARNING) << *error_details;
verify_details_->cert_verify_result.cert_status = CERT_STATUS_INVALID;
- details->reset(verify_details_.release());
+ verify_details->reset(verify_details_.release());
return FAILURE;
}
@@ -158,13 +158,13 @@ ProofVerifierChromium::Status ProofVerifierChromium::Job::VerifyProof(
next_state_ = STATE_VERIFY_CERT;
switch (DoLoop(OK)) {
case OK:
- details->reset(verify_details_.release());
+ verify_details->reset(verify_details_.release());
return SUCCESS;
case ERR_IO_PENDING:
return PENDING;
default:
*error_details = error_details_;
- details->reset(verify_details_.release());
+ verify_details->reset(verify_details_.release());
return FAILURE;
}
}
@@ -310,11 +310,8 @@ bool ProofVerifierChromium::Job::VerifySignature(const string& signed_data,
return true;
}
-ProofVerifierChromium::ProofVerifierChromium(CertVerifier* cert_verifier,
- const BoundNetLog& net_log)
- : cert_verifier_(cert_verifier),
- net_log_(net_log) {
-}
+ProofVerifierChromium::ProofVerifierChromium(CertVerifier* cert_verifier)
+ : cert_verifier_(cert_verifier) {}
ProofVerifierChromium::~ProofVerifierChromium() {
STLDeleteElements(&active_jobs_);
@@ -325,12 +322,19 @@ ProofVerifierChromium::Status ProofVerifierChromium::VerifyProof(
const std::string& server_config,
const std::vector<std::string>& certs,
const std::string& signature,
+ const ProofVerifyContext* verify_context,
std::string* error_details,
- scoped_ptr<ProofVerifyDetails>* details,
+ scoped_ptr<ProofVerifyDetails>* verify_details,
ProofVerifierCallback* callback) {
- scoped_ptr<Job> job(new Job(this, cert_verifier_, net_log_));
+ if (!verify_context) {
+ *error_details = "Missing context";
+ return FAILURE;
+ }
+ const ProofVerifyContextChromium* chromium_context =
+ reinterpret_cast<const ProofVerifyContextChromium*>(verify_context);
+ scoped_ptr<Job> job(new Job(this, cert_verifier_, chromium_context->net_log));
Status status = job->VerifyProof(hostname, server_config, certs, signature,
- error_details, details, callback);
+ error_details, verify_details, callback);
if (status == PENDING) {
active_jobs_.insert(job.release());
}