xref: /aosp_15_r20/external/cronet/net/cert/cert_status_flags_list.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2014 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 // This file intentionally does not have header guards, it's included
6 // inside a macro to generate enum values. The following line silences a
7 // presubmit warning that would otherwise be triggered by this:
8 // no-include-guard-because-multiply-included
9 // NOLINT(build/header_guard)
10 
11 // This is the list of CertStatus flags and their values.
12 //
13 // Defines the values using a macro CERT_STATUS_FLAG,
14 // so it can be expanded differently in some places
15 
16 // The possible status bits for CertStatus.
17 // Bits 0 to 15 are for errors.
18 CERT_STATUS_FLAG(COMMON_NAME_INVALID, 1 << 0)
19 CERT_STATUS_FLAG(DATE_INVALID, 1 << 1)
20 CERT_STATUS_FLAG(AUTHORITY_INVALID, 1 << 2)
21 // 1 << 3 is reserved for ERR_CERT_CONTAINS_ERRORS (not useful with WinHTTP).
22 CERT_STATUS_FLAG(NO_REVOCATION_MECHANISM, 1 << 4)
23 CERT_STATUS_FLAG(UNABLE_TO_CHECK_REVOCATION, 1 << 5)
24 CERT_STATUS_FLAG(REVOKED, 1 << 6)
25 CERT_STATUS_FLAG(INVALID, 1 << 7)
26 CERT_STATUS_FLAG(WEAK_SIGNATURE_ALGORITHM, 1 << 8)
27 // 1 << 9 was used for CERT_STATUS_NOT_IN_DNS
28 CERT_STATUS_FLAG(NON_UNIQUE_NAME, 1 << 10)
29 CERT_STATUS_FLAG(WEAK_KEY, 1 << 11)
30 // 1 << 12 was used for CERT_STATUS_WEAK_DH_KEY
31 CERT_STATUS_FLAG(PINNED_KEY_MISSING, 1 << 13)
32 CERT_STATUS_FLAG(NAME_CONSTRAINT_VIOLATION, 1 << 14)
33 CERT_STATUS_FLAG(VALIDITY_TOO_LONG, 1 << 15)
34 
35 // Bits 16 to 23 are for non-error statuses.
36 CERT_STATUS_FLAG(IS_EV, 1 << 16)
37 CERT_STATUS_FLAG(REV_CHECKING_ENABLED, 1 << 17)
38 // Bit 18 was CERT_STATUS_IS_DNSSEC
39 CERT_STATUS_FLAG(SHA1_SIGNATURE_PRESENT, 1 << 19)
40 // Bit 20 was CERT_STATUS_CT_COMPLIANCE_FAILED
41 CERT_STATUS_FLAG(KNOWN_INTERCEPTION_DETECTED, 1 << 21)
42 
43 // Bits 24 - 31 are for errors.
44 CERT_STATUS_FLAG(CERTIFICATE_TRANSPARENCY_REQUIRED, 1 << 24)
45 CERT_STATUS_FLAG(SYMANTEC_LEGACY, 1 << 25)
46 CERT_STATUS_FLAG(KNOWN_INTERCEPTION_BLOCKED, 1 << 26)
47 // Bit 27 was CERT_STATUS_LEGACY_TLS.
48