Chromium Code Reviews| Index: net/cert/ct_verifier.h |
| diff --git a/net/cert/ct_verifier.h b/net/cert/ct_verifier.h |
| index 290a0474a649138733c902fdc5a8e47b6210f12d..5cfdd77e278a30ab770e478f6f3022eff2e2799a 100644 |
| --- a/net/cert/ct_verifier.h |
| +++ b/net/cert/ct_verifier.h |
| @@ -5,21 +5,39 @@ |
| #ifndef NET_CERT_CT_VERIFIER_H_ |
| #define NET_CERT_CT_VERIFIER_H_ |
| +#include <string> |
| + |
| +#include "base/memory/ref_counted.h" |
| #include "net/base/net_export.h" |
| namespace net { |
| namespace ct { |
| struct CTVerifyResult; |
| +struct SignedCertificateTimestamp; |
| } // namespace ct |
| class BoundNetLog; |
| +class CTLogVerifier; |
| class X509Certificate; |
| // Interface for verifying Signed Certificate Timestamps over a certificate. |
| class NET_EXPORT CTVerifier { |
| public: |
| - virtual ~CTVerifier() {} |
| + class NET_EXPORT Observer { |
| + public: |
| + // Called for each Signed Certificate Timestamp from a known log that vas |
| + // verified successfully (i.e. the signature verifies). |sct| is the |
| + // Signed Certificate Timestamp, |log_verifier| is the log issuing this |
| + // SCT. |
| + // TODO(eranm): The certificate itself is also necessary for calculating |
| + // the hash of the log entry. Will be added when implementing inclusion |
| + // checking functionality. |
|
Ryan Sleevi
2015/07/02 13:23:08
Why not have this interface provide the certificat
Eran Messeri
2015/07/02 14:12:51
Done.
|
| + virtual void OnSCTVerified(const ct::SignedCertificateTimestamp* sct, |
| + scoped_refptr<CTLogVerifier> log_verifier) = 0; |
|
Ryan Sleevi
2015/07/02 13:23:08
FIRST ORDER DESIGN: Why pass this as a scoped_refp
Eran Messeri
2015/07/02 14:12:52
Good point, the observer can hold a list of CTLogV
|
| + }; |
| + |
| + virtual ~CTVerifier(); |
|
Ryan Sleevi
2015/07/02 13:23:08
It's unclear why you're no longer inlining this? T
Eran Messeri
2015/07/02 14:12:51
Reverted.
|
| // Verifies SCTs embedded in the certificate itself, SCTs embedded in a |
| // stapled OCSP response, and SCTs obtained via the |
| @@ -36,6 +54,13 @@ class NET_EXPORT CTVerifier { |
| const std::string& sct_list_from_tls_extension, |
| ct::CTVerifyResult* result, |
| const BoundNetLog& net_log) = 0; |
| + |
| + virtual void StopNotifications() = 0; |
|
Ryan Sleevi
2015/07/02 13:23:08
Document.
Seems like this would be more logical a
Eran Messeri
2015/07/02 14:12:52
Using SetObserver(nullptr) would definitely do the
|
| + |
| + // Registers |observer| to receive notifications of validated SCTs. Does not |
| + // take ownership of the observer as the observer may be performing |
| + // URLRequests which have to be cancelled before this object is destroyed. |
| + virtual void SetObserver(Observer* observer) = 0; |
| }; |
| } // namespace net |