diff options
author | karen@chromium.org <karen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-27 04:55:35 +0000 |
---|---|---|
committer | karen@chromium.org <karen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-27 04:55:35 +0000 |
commit | 8935df6e2f357b1dc89e386abc0731b54b1f6be8 (patch) | |
tree | db97357ca07bc6fdb05058363ba05d11a74aa9ab /net/tools | |
parent | 4eb1363107f46a361c1345493c07f7b48eb5cdec (diff) | |
download | chromium_src-8935df6e2f357b1dc89e386abc0731b54b1f6be8.zip chromium_src-8935df6e2f357b1dc89e386abc0731b54b1f6be8.tar.gz chromium_src-8935df6e2f357b1dc89e386abc0731b54b1f6be8.tar.bz2 |
i Revert 213862 "net: make QUIC ProofVerifier more generic."
> net: make QUIC ProofVerifier more generic.
>
> The QUIC ProofVerifier code is currently rather Chromium specific: it's using
> weak pointers, base::Bind etc. This change wraps abstractions around things so
> that the code is more portable again.
>
> It also solves an issue where, when a QUIC connection is canceled while a
> verification is running, the verification can write into free memory.
>
> I went back and forth on this change a bit. It effectively reinvents weak
> pointers and callbacks in order not to use the Chromium versions of these
> things. This is unfortunate but it is desirable to minimise the amount of skew
> between different copies of the QUIC code. In the end, the duplicate didn't
> seem so bad to me.
>
> Weak pointers are replaced with an explicit callback interface for the
> ProofVerifier. The QUIC client stream implements a Cancel method so that it can
> cope with being deleted while a proof verification is still running.
>
> The need to store a CertVerifyDetails is taken care of with an abstract class
> for wrapping "implementation specific" results from a verification. There is
> still Chromium-specific code that casts it to a Chromium object, but that's
> unavoidable somewhere. (Although it's not clear that the QUIC client stream is
> the best place for it.)
>
> BUG=none
>
> Review URL: https://chromiumcodereview.appspot.com/20047002
TBR=agl@chromium.org
Review URL: https://codereview.chromium.org/20822005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214035 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/tools')
-rw-r--r-- | net/tools/quic/test_tools/quic_test_client.cc | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/net/tools/quic/test_tools/quic_test_client.cc b/net/tools/quic/test_tools/quic_test_client.cc index eb26078..ef9a164 100644 --- a/net/tools/quic/test_tools/quic_test_client.cc +++ b/net/tools/quic/test_tools/quic_test_client.cc @@ -24,19 +24,16 @@ namespace { class RecordingProofVerifier : public net::ProofVerifier { public: // ProofVerifier interface. - virtual net::ProofVerifier::Status VerifyProof( - const string& hostname, - const string& server_config, - const vector<string>& certs, - const string& signature, - string* error_details, - scoped_ptr<net::ProofVerifyDetails>* details, - net::ProofVerifierCallback* callback) OVERRIDE { - delete callback; - + virtual int VerifyProof(const string& hostname, + const string& server_config, + const vector<string>& certs, + const string& signature, + string* error_details, + net::CertVerifyResult* cert_verify_result, + const net::CompletionCallback& callback) OVERRIDE { common_name_.clear(); if (certs.empty()) { - return FAILURE; + return net::ERR_FAILED; } // Convert certs to X509Certificate. @@ -47,11 +44,11 @@ class RecordingProofVerifier : public net::ProofVerifier { scoped_refptr<net::X509Certificate> cert = net::X509Certificate::CreateFromDERCertChain(cert_pieces); if (!cert.get()) { - return FAILURE; + return net::ERR_FAILED; } common_name_ = cert->subject().GetDisplayName(); - return SUCCESS; + return net::OK; } const string& common_name() const { return common_name_; } |