File: sct_status_flags.h

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (49 lines) | stat: -rw-r--r-- 1,631 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NET_CERT_SCT_STATUS_FLAGS_H_
#define NET_CERT_SCT_STATUS_FLAGS_H_

#include <stdint.h>

#include "net/base/net_export.h"

namespace net::ct {

// The possible verification statuses for a SignedCertificateTimestamp.
// Note: The numeric values are used within histograms and should not change
// or be re-assigned.
enum SCTVerifyStatus : uint32_t {
  // Not a real status, this just prevents a default int value from being
  // mis-interpreseted as a valid status.
  // Also used to count SCTs that cannot be decoded in the histogram.
  SCT_STATUS_NONE = 0,

  // The SCT is from an unknown log, so we cannot verify its signature.
  SCT_STATUS_LOG_UNKNOWN = 1,

  // Obsolete. Kept here to avoid reuse.
  // SCT_STATUS_INVALID = 2,

  // The SCT is from a known log, and the signature is valid.
  SCT_STATUS_OK = 3,

  // The SCT is from a known log, but the signature is invalid.
  SCT_STATUS_INVALID_SIGNATURE = 4,

  // The SCT is from a known log, but the timestamp is in the future.
  SCT_STATUS_INVALID_TIMESTAMP = 5,

  // Used to bound the enum values. Since this enum is passed over IPC,
  // the last value must be a valid one (rather than one past a valid one).
  SCT_STATUS_MAX = SCT_STATUS_INVALID_TIMESTAMP,
};

// Returns true if |status| denotes a valid value in SCTVerifyStatus, which
// is all current values in the enum except SCT_STATUS_NONE.
NET_EXPORT bool IsValidSCTStatus(uint32_t status);

}  // namespace net::ct

#endif  // NET_CERT_SCT_STATUS_FLAGS_H_