ssl_error_options_mask.h 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2019 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 COMPONENTS_SECURITY_INTERSTITIALS_CORE_SSL_ERROR_OPTIONS_MASK_H_
  5. #define COMPONENTS_SECURITY_INTERSTITIALS_CORE_SSL_ERROR_OPTIONS_MASK_H_
  6. namespace security_interstitials {
  7. enum SSLErrorOptionsMask {
  8. // Indicates that the error UI should support dismissing the error and
  9. // loading the page. By default, the errors cannot be overridden via the UI.
  10. SOFT_OVERRIDE_ENABLED = 1 << 0,
  11. // Indicates that the user should NOT be allowed to use a "secret code" to
  12. // dismiss the error and load the page, even if the UI does not support it.
  13. // By default, an error can be overridden via the "secret code."
  14. HARD_OVERRIDE_DISABLED = 1 << 1,
  15. // Indicates that the site the user is trying to connect to has requested
  16. // strict enforcement of certificate validation (e.g. with HTTP
  17. // Strict-Transport-Security). By default, the error assumes strict
  18. // enforcement was not requested.
  19. STRICT_ENFORCEMENT = 1 << 2,
  20. };
  21. // Calculates a mask encoded via the SSLErrorOptionsMaskFlag bitfields based
  22. // on the passed-in parameters.
  23. int CalculateSSLErrorOptionsMask(int cert_error,
  24. bool hard_override_disabled,
  25. bool should_ssl_errors_be_fatal);
  26. } // namespace security_interstitials
  27. #endif // COMPONENTS_SECURITY_INTERSTITIALS_CORE_SSL_ERROR_OPTIONS_MASK_H_