xref: /aosp_15_r20/external/cronet/net/cert/ct_policy_status.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2016 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef NET_CERT_CT_POLICY_STATUS_H_
6 #define NET_CERT_CT_POLICY_STATUS_H_
7 
8 #include "net/base/net_export.h"
9 
10 namespace net::ct {
11 
12 // Information about the connection's compliance with the CT policy. This value
13 // is histogrammed, so do not re-order or change values, and add new values at
14 // the end.
15 enum class CTPolicyCompliance {
16   // The connection complied with the certificate policy by
17   // including SCTs that satisfy the policy.
18   CT_POLICY_COMPLIES_VIA_SCTS = 0,
19   // The connection did not have enough SCTs to comply.
20   CT_POLICY_NOT_ENOUGH_SCTS = 1,
21   // The connection did not have diverse enough SCTs to comply.
22   CT_POLICY_NOT_DIVERSE_SCTS = 2,
23   // The connection cannot be considered compliant because the build
24   // isn't timely and therefore log information might be out of date
25   // (for example a log might no longer be considered trustworthy).
26   CT_POLICY_BUILD_NOT_TIMELY = 3,
27   // Compliance details for the connection are not available, e.g. because a
28   // resource was loaded from disk cache.
29   CT_POLICY_COMPLIANCE_DETAILS_NOT_AVAILABLE = 4,
30   CT_POLICY_COUNT
31 };
32 
33 NET_EXPORT const char* CTPolicyComplianceToString(CTPolicyCompliance status);
34 
35 }  // namespace net::ct
36 
37 #endif  // NET_CERT_CT_POLICY_STATUS_H_
38