1 // Copyright 2018 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 
5 #include "device/fido/fido_constants.h"
6 
7 namespace device {
8 
9 const std::array<uint8_t, 32> kBogusAppParam = {
10     0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41,
11     0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41,
12     0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41};
13 
14 const std::array<uint8_t, 32> kBogusChallenge = {
15     0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
16     0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
17     0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42};
18 
19 const char kResidentKeyMapKey[] = "rk";
20 const char kUserVerificationMapKey[] = "uv";
21 const char kUserPresenceMapKey[] = "up";
22 const char kClientPinMapKey[] = "clientPin";
23 const char kPlatformDeviceMapKey[] = "plat";
24 const char kEntityIdMapKey[] = "id";
25 const char kEntityNameMapKey[] = "name";
26 const char kDisplayNameMapKey[] = "displayName";
27 const char kIconUrlMapKey[] = "icon";
28 const char kCredentialTypeMapKey[] = "type";
29 const char kCredentialAlgorithmMapKey[] = "alg";
30 const char kCredentialManagementMapKey[] = "credMgmt";
31 const char kCredentialManagementPreviewMapKey[] = "credentialMgmtPreview";
32 const char kBioEnrollmentMapKey[] = "bioEnroll";
33 const char kBioEnrollmentPreviewMapKey[] = "userVerificationMgmtPreview";
34 const char kUvTokenMapKey[] = "uvToken";
35 
36 const base::TimeDelta kDeviceTimeout = base::TimeDelta::FromSeconds(20);
37 const base::TimeDelta kU2fRetryDelay = base::TimeDelta::FromMilliseconds(200);
38 
39 const char kFormatKey[] = "fmt";
40 const char kAttestationStatementKey[] = "attStmt";
41 const char kAuthDataKey[] = "authData";
42 const char kNoneAttestationValue[] = "none";
43 
44 const char kPublicKey[] = "public-key";
45 
CredentialTypeToString(CredentialType type)46 const char* CredentialTypeToString(CredentialType type) {
47   switch (type) {
48     case CredentialType::kPublicKey:
49       return kPublicKey;
50   }
51   NOTREACHED();
52   return kPublicKey;
53 }
54 
55 const char kCableHandshakeKeyInfo[] = "FIDO caBLE v1 handshakeKey";
56 const std::array<uint8_t, 24> kCableDeviceEncryptionKeyInfo = {
57     'F', 'I', 'D', 'O', ' ', 'c', 'a', 'B', 'L', 'E', ' ', 'v',
58     '1', ' ', 's', 'e', 's', 's', 'i', 'o', 'n', 'K', 'e', 'y',
59 };
60 const char kCableAuthenticatorHelloMessage[] = "caBLE v1 authenticator hello";
61 const char kCableClientHelloMessage[] = "caBLE v1 client hello";
62 
63 const char kCtap2Version[] = "FIDO_2_0";
64 const char kU2fVersion[] = "U2F_V2";
65 
66 const char kExtensionHmacSecret[] = "hmac-secret";
67 const char kExtensionCredProtect[] = "credProtect";
68 const char kExtensionAndroidClientData[] = "googleAndroidClientData";
69 
70 const base::TimeDelta kBleDevicePairingModeWaitingInterval =
71     base::TimeDelta::FromSeconds(2);
72 
73 }  // namespace device
74