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

Side by Side Diff: net/cert/ct_verifier.h

Issue 2604513002: Optimize CT & OCSP handling code (Closed)
Patch Set: Actually optimize for OCSP Created 3 years, 12 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_CERT_CT_VERIFIER_H_ 5 #ifndef NET_CERT_CT_VERIFIER_H_
6 #define NET_CERT_CT_VERIFIER_H_ 6 #define NET_CERT_CT_VERIFIER_H_
7 7
8 #include <string> 8 #include "base/strings/string_piece.h"
9
10 #include "net/base/net_export.h" 9 #include "net/base/net_export.h"
11 #include "net/cert/signed_certificate_timestamp_and_status.h" 10 #include "net/cert/signed_certificate_timestamp_and_status.h"
12 11
13 namespace net { 12 namespace net {
14 13
15 class NetLogWithSource; 14 class NetLogWithSource;
16 class X509Certificate; 15 class X509Certificate;
17 16
18 // Interface for verifying Signed Certificate Timestamps over a certificate. 17 // Interface for verifying Signed Certificate Timestamps over a certificate.
19 class NET_EXPORT CTVerifier { 18 class NET_EXPORT CTVerifier {
(...skipping 17 matching lines...) Expand all
37 virtual ~CTVerifier() {} 36 virtual ~CTVerifier() {}
38 37
39 // Verifies SCTs embedded in the certificate itself, SCTs embedded in a 38 // Verifies SCTs embedded in the certificate itself, SCTs embedded in a
40 // stapled OCSP response, and SCTs obtained via the 39 // stapled OCSP response, and SCTs obtained via the
41 // signed_certificate_timestamp TLS extension on the given |cert|. 40 // signed_certificate_timestamp TLS extension on the given |cert|.
42 // A certificate is permitted but not required to use multiple sources for 41 // A certificate is permitted but not required to use multiple sources for
43 // SCTs. It is expected that most certificates will use only one source 42 // SCTs. It is expected that most certificates will use only one source
44 // (embedding, TLS extension or OCSP stapling). If no stapled OCSP response 43 // (embedding, TLS extension or OCSP stapling). If no stapled OCSP response
45 // is available, |stapled_ocsp_response| should be an empty string. If no SCT 44 // is available, |stapled_ocsp_response| should be an empty string. If no SCT
46 // TLS extension was negotiated, |sct_list_from_tls_extension| should be an 45 // TLS extension was negotiated, |sct_list_from_tls_extension| should be an
47 // empty string. |result| will be filled with the SCTs present, divided into 46 // empty string. |result| will be filled with the SCTs present, divided into
eroman 2016/12/27 22:00:40 Can you fix this comment too?
48 // categories based on the verification result. 47 // categories based on the verification result.
49 virtual int Verify(X509Certificate* cert, 48 virtual void Verify(X509Certificate* cert,
50 const std::string& stapled_ocsp_response, 49 base::StringPiece stapled_ocsp_response,
51 const std::string& sct_list_from_tls_extension, 50 base::StringPiece sct_list_from_tls_extension,
52 SignedCertificateTimestampAndStatusList* output_scts, 51 SignedCertificateTimestampAndStatusList* output_scts,
53 const NetLogWithSource& net_log) = 0; 52 const NetLogWithSource& net_log) = 0;
54 53
55 // Registers |observer| to receive notifications of validated SCTs. Does not 54 // Registers |observer| to receive notifications of validated SCTs. Does not
56 // take ownership of the observer as the observer may be performing 55 // take ownership of the observer as the observer may be performing
57 // URLRequests which have to be cancelled before this object is destroyed. 56 // URLRequests which have to be cancelled before this object is destroyed.
58 // Setting |observer| to nullptr has the effect of stopping all notifications. 57 // Setting |observer| to nullptr has the effect of stopping all notifications.
59 virtual void SetObserver(Observer* observer) = 0; 58 virtual void SetObserver(Observer* observer) = 0;
60 }; 59 };
61 60
62 } // namespace net 61 } // namespace net
63 62
64 #endif // NET_CERT_CT_VERIFIER_H_ 63 #endif // NET_CERT_CT_VERIFIER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698