do_nothing_ct_verifier.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Copyright 2016 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef NET_CERT_DO_NOTHING_CT_VERIFIER_H_
  5. #define NET_CERT_DO_NOTHING_CT_VERIFIER_H_
  6. #include "net/base/net_export.h"
  7. #include "net/cert/ct_verifier.h"
  8. namespace net {
  9. // An implementation of CTVerifier that does not validate SCTs.
  10. //
  11. // SECURITY NOTE:
  12. // As Certificate Transparency is an essential part in safeguarding TLS
  13. // connections, disabling Certificate Transparency enforcement is a decision
  14. // that should not be taken lightly, and it should be made an explicit
  15. // decision rather than a potentially accidental decision (such as allowing
  16. // for a nullptr instance). By checking Certificate Transparency information,
  17. // typically via a net::MultiLogCTVerifier, and enforcing policies related
  18. // to Certificate Transparency provided by a net::CTPolicyEnforcer, developers
  19. // can help protect their users by ensuring that misissued TLS certificates
  20. // are detected.
  21. //
  22. // However, not every consumer of TLS certificates is using the Web PKI. For
  23. // example, they may be using connections authenticated out of band, or may
  24. // be using private or local PKIs for which Certificate Transparency is not
  25. // relevant. Alternatively, much like how a robust and secure TLS client
  26. // requires a regularly updated root certificate store, a robust and secure
  27. // Certificate Transparency client requires regular updates. However, since
  28. // some clients may not support regular updates, it may be intentional to
  29. // disable Certificate Transparency and choose a less-secure default
  30. // behavior.
  31. //
  32. // Consumers of this class should generally try to get a security or design
  33. // to discuss the type of net::X509Certificates they will be validating,
  34. // and determine whether or not Certificate Transparency is right for the
  35. // particular use case.
  36. //
  37. // Because of the complex nuances related to security tradeoffs, it is
  38. // expected that classes which expect a CTVerifier will require one to be
  39. // supplied, forcing the caller to make an intentional and explicit decision
  40. // about the appropriate security policy, rather than leaving it ambiguous,
  41. // such as via a nullptr. This class is intended to indicate an intentional
  42. // consideration of CT, and a decision to not support it.
  43. class NET_EXPORT DoNothingCTVerifier : public CTVerifier {
  44. public:
  45. DoNothingCTVerifier();
  46. DoNothingCTVerifier(const DoNothingCTVerifier&) = delete;
  47. DoNothingCTVerifier& operator=(const DoNothingCTVerifier&) = delete;
  48. ~DoNothingCTVerifier() override;
  49. void Verify(base::StringPiece hostname,
  50. X509Certificate* cert,
  51. base::StringPiece stapled_ocsp_response,
  52. base::StringPiece sct_list_from_tls_extension,
  53. SignedCertificateTimestampAndStatusList* output_scts,
  54. const NetLogWithSource& net_log) override;
  55. };
  56. } // namespace net
  57. #endif // NET_CERT_DO_NOTHING_CT_VERIFIER_H_