forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfido_types.h
84 lines (70 loc) · 2.46 KB
/
fido_types.h
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef DEVICE_FIDO_FIDO_TYPES_H_
#define DEVICE_FIDO_FIDO_TYPES_H_
#include <cstdint>
// The definitions below are for mojo-mappable types that need to be transferred
// from Blink. Types that do not have mojo equivalents are better placed in
// fido_constants.h.
namespace device {
// ProtocolVersion is the major protocol version of an authenticator device.
enum class ProtocolVersion {
kCtap2,
kU2f,
kUnknown,
};
// Ctap2Version distinguishes different minor versions of the CTAP2 protocol.
enum class Ctap2Version {
kCtap2_0,
kCtap2_1,
};
enum class CredentialType { kPublicKey };
// Authenticator attachment constraint passed on from the relying party as a
// parameter for AuthenticatorSelectionCriteria. |kAny| is equivalent to the
// (optional) attachment field not being present.
// https://w3c.github.io/webauthn/#attachment
enum class AuthenticatorAttachment {
kAny,
kPlatform,
kCrossPlatform,
};
// A constraint on whether a client-side discoverable (resident) credential
// should be created during registration.
//
// https://w3c.github.io/webauthn/#enum-residentKeyRequirement
enum class ResidentKeyRequirement {
kDiscouraged,
kPreferred,
kRequired,
};
// User verification constraint passed on from the relying party as a parameter
// for AuthenticatorSelectionCriteria and for CtapGetAssertion request.
// https://w3c.github.io/webauthn/#enumdef-userverificationrequirement
enum class UserVerificationRequirement {
kRequired,
kPreferred,
kDiscouraged,
};
// https://w3c.github.io/webauthn/#attestation-convey
enum class AttestationConveyancePreference : uint8_t {
kNone,
kIndirect,
kDirect,
// The value "enterprise" from WebAuthn is split into these two values. The
// first indicates that the site requested enterprise attestation and we can
// pass that onto the authenticator in case the RP ID is hardcoded into the
// authenticator to allow that. The second indicates that we, the browser,
// have authenticated the request (e.g. by enterprise policy) and it's
// permitted without further checks.
kEnterpriseIfRPListedOnAuthenticator,
kEnterpriseApprovedByBrowser,
};
// https://w3c.github.io/webauthn#enumdef-largeblobsupport
enum class LargeBlobSupport {
kNotRequested,
kRequired,
kPreferred,
};
} // namespace device
#endif // DEVICE_FIDO_FIDO_TYPES_H_