trial_comparison_cert_verifier_util.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright 2021 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_TRIAL_COMPARISON_CERT_VERIFIER_UTIL_H_
  5. #define NET_CERT_TRIAL_COMPARISON_CERT_VERIFIER_UTIL_H_
  6. #include "net/base/net_export.h"
  7. #include "net/cert/cert_verify_result.h"
  8. namespace net {
  9. // These values are persisted to logs. Entries should not be renumbered and
  10. // numeric values should never be reused.
  11. enum class TrialComparisonResult {
  12. kInvalid = 0,
  13. kEqual = 1,
  14. kPrimaryValidSecondaryError = 2,
  15. kPrimaryErrorSecondaryValid = 3,
  16. kBothValidDifferentDetails = 4,
  17. kBothErrorDifferentDetails = 5,
  18. kIgnoredMacUndesiredRevocationChecking = 6,
  19. kIgnoredMultipleEVPoliciesAndOneMatchesRoot = 7,
  20. kIgnoredDifferentPathReVerifiesEquivalent = 8,
  21. kIgnoredLocallyTrustedLeaf = 9,
  22. kIgnoredConfigurationChanged = 10,
  23. kIgnoredSHA1SignaturePresent = 11,
  24. kIgnoredWindowsRevCheckingEnabled = 12,
  25. kIgnoredBothAuthorityInvalid = 13,
  26. kIgnoredBothKnownRoot = 14,
  27. kIgnoredBuiltinAuthorityInvalidPlatformSymantec = 15,
  28. kIgnoredLetsEncryptExpiredRoot = 16,
  29. kMaxValue = kIgnoredLetsEncryptExpiredRoot
  30. };
  31. NET_EXPORT_PRIVATE bool CertVerifyResultEqual(const CertVerifyResult& a,
  32. const CertVerifyResult& b);
  33. NET_EXPORT_PRIVATE TrialComparisonResult
  34. IsSynchronouslyIgnorableDifference(int primary_error,
  35. const CertVerifyResult& primary_result,
  36. int trial_error,
  37. const CertVerifyResult& trial_result,
  38. bool sha1_local_anchors_enabled);
  39. } // namespace net
  40. #endif // NET_CERT_TRIAL_COMPARISON_CERT_VERIFIER_UTIL_H_