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

Unified Diff: net/cert/cert_verifier.h

Issue 1987113002: Introduce CertVerifier::RequestParams (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move tests Created 4 years, 7 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
« no previous file with comments | « no previous file | net/cert/cert_verifier.cc » ('j') | net/cert/cert_verifier_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/cert_verifier.h
diff --git a/net/cert/cert_verifier.h b/net/cert/cert_verifier.h
index 26ee988355ae96bf8e4b71f7e726e12d2b72e34c..3f6c9d05066e65689d431081ae6bf771079b22c7 100644
--- a/net/cert/cert_verifier.h
+++ b/net/cert/cert_verifier.h
@@ -7,17 +7,19 @@
#include <memory>
#include <string>
+#include <vector>
#include "base/macros.h"
#include "net/base/completion_callback.h"
+#include "net/base/hash_value.h"
#include "net/base/net_export.h"
+#include "net/cert/x509_certificate.h"
namespace net {
class BoundNetLog;
class CertVerifyResult;
class CRLSet;
-class X509Certificate;
// CertVerifier represents a service for verifying certificates.
//
@@ -74,6 +76,32 @@ class NET_EXPORT CertVerifier {
VERIFY_REV_CHECKING_REQUIRED_LOCAL_ANCHORS = 1 << 4,
};
+ // The parameters for doing a Verify(). |certificate|, |hostname|, and
+ // |flags| are required. The rest are optional.
eroman 2016/05/18 01:43:18 Are you going to move documentation for the variou
Ryan Sleevi 2016/05/18 02:02:02 Yes, when updating Verify() to use this.
+ class RequestParams {
+ public:
+ RequestParams(X509Certificate* certificate,
+ const std::string& hostname,
+ int flags,
+ const std::string& ocsp_response,
+ const CertificateList& additional_trust_anchors);
+ RequestParams(const RequestParams& other);
+ ~RequestParams();
+
+ const std::string& hostname() const { return hostname_; }
+ int flags() const { return flags_; }
+ const std::vector<SHA1HashValue> request_data() const {
+ return request_data_;
+ }
+
+ bool operator<(const RequestParams& other) const;
+
+ private:
+ std::string hostname_;
+ int flags_;
+ std::vector<SHA1HashValue> request_data_;
eroman 2016/05/18 01:43:18 Can you speak to the design choice of using a vect
Ryan Sleevi 2016/05/18 02:02:02 While I appreciate all of this feedback, I don't t
eroman 2016/05/18 02:06:43 OK, we can discuss that separately.
+ };
+
// When the verifier is destroyed, all certificate verification requests are
// canceled, and their completion callbacks will not be called.
virtual ~CertVerifier() {}
@@ -113,7 +141,7 @@ class NET_EXPORT CertVerifier {
// nullptr. However it is not guaranteed that all implementations will reset
// it in this case.
//
- // TODO(rsleevi): Move CRLSet* out of the CertVerifier signature.
+ // TODO(rsleevi): Update this to use RequestParams as part of the signature.
virtual int Verify(X509Certificate* cert,
const std::string& hostname,
const std::string& ocsp_response,
« no previous file with comments | « no previous file | net/cert/cert_verifier.cc » ('j') | net/cert/cert_verifier_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698