1 package android.keystore.cts;
2 
3 import android.security.keymaster.KeymasterDefs;
4 
5 class EatClaim {
6     public static final int IAT = 6;
7     public static final int CTI = 7;
8 
9     public static final int NONCE = -75008;
10     public static final int UEID = -75009;
11 
12     public static final int SECURITY_LEVEL = -76002;
13     public static final int SECURITY_LEVEL_UNRESTRICTED = 1;
14     public static final int SECURITY_LEVEL_SECURE_RESTRICTED = 3;
15     public static final int SECURITY_LEVEL_HARDWARE = 4;
16 
17     public static final int BOOT_STATE = -76003;
18     public static final int SUBMODS = -76000;
19 
20     private static final int PRIVATE_BASE = -80000;
21 
22     public static final int PURPOSE = PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_PURPOSE);
23     public static final int ALGORITHM =
24             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ALGORITHM);
25     public static final int KEY_SIZE = PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_KEY_SIZE);
26     public static final int BLOCK_MODE =
27             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_BLOCK_MODE);
28     public static final int DIGEST = PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_DIGEST);
29     public static final int PADDING = PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_PADDING);
30     public static final int CALLER_NONCE =
31             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_CALLER_NONCE);
32     public static final int MIN_MAC_LENGTH =
33             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_MIN_MAC_LENGTH);
34     public static final int KDF = PRIVATE_BASE - 9;
35 
36     public static final int EC_CURVE = PRIVATE_BASE - 10;
37     public static final int EAT_EC_CURVE_P_224 = 0;
38     public static final int EAT_EC_CURVE_P_256 = 1;
39     public static final int EAT_EC_CURVE_P_384 = 2;
40     public static final int EAT_EC_CURVE_P_521 = 3;
41 
42     public static final int RSA_PUBLIC_EXPONENT =
43             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_RSA_PUBLIC_EXPONENT);
44 
45     public static final int ROLLBACK_RESISTANCE = PRIVATE_BASE - 303;
46     public static final int EARLY_BOOT_ONLY = PRIVATE_BASE - 305;
47 
48     public static final int ACTIVE_DATETIME =
49             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ACTIVE_DATETIME);
50     public static final int ORIGINATION_EXPIRE_DATETIME =
51             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ORIGINATION_EXPIRE_DATETIME);
52     public static final int USAGE_EXPIRE_DATETIME =
53             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_USAGE_EXPIRE_DATETIME);
54 
55     public static final int NO_AUTH_REQUIRED =
56             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_NO_AUTH_REQUIRED);
57     public static final int USER_AUTH_TYPE =
58             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_USER_AUTH_TYPE);
59     public static final int AUTH_TIMEOUT =
60             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_AUTH_TIMEOUT);
61     public static final int ALLOW_WHILE_ON_BODY =
62             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ALLOW_WHILE_ON_BODY);
63     public static final int USER_PRESENCE_REQUIRED = PRIVATE_BASE - 507;
64     public static final int TRUSTED_CONFIRMATION_REQUIRED =
65             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_TRUSTED_CONFIRMATION_REQUIRED);
66     public static final int UNLOCKED_DEVICE_REQUIRED =
67             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_UNLOCKED_DEVICE_REQUIRED);
68 
69     public static final int APPLICATION_ID =
70             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_APPLICATION_ID);
71 
72     public static final int ORIGIN = PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ORIGIN);
73     // TODO: hardcoded while KeymasterDefs uses the same value for
74     // ROLLBACK_RESISTANCE and ROLLBACK_RESISTANT
75     public static final int ROLLBACK_RESISTANT = PRIVATE_BASE - 703;
76     public static final int OS_VERSION = PRIVATE_BASE - 705;
77     public static final int OS_PATCHLEVEL = PRIVATE_BASE - 706;
78     public static final int ATTESTATION_APPLICATION_ID = PRIVATE_BASE - 709;
79     public static final int ATTESTATION_ID_BRAND =
80             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ATTESTATION_ID_BRAND);
81     public static final int ATTESTATION_ID_DEVICE =
82             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ATTESTATION_ID_DEVICE);
83     public static final int ATTESTATION_ID_PRODUCT =
84             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ATTESTATION_ID_PRODUCT);
85     public static final int ATTESTATION_ID_SERIAL =
86             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ATTESTATION_ID_SERIAL);
87     public static final int ATTESTATION_ID_MEID =
88             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ATTESTATION_ID_MEID);
89     public static final int ATTESTATION_ID_MANUFACTURER =
90             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ATTESTATION_ID_MANUFACTURER);
91     public static final int ATTESTATION_ID_MODEL =
92             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ATTESTATION_ID_MODEL);
93     public static final int VENDOR_PATCHLEVEL =
94             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_VENDOR_PATCHLEVEL);
95     public static final int BOOT_PATCHLEVEL =
96             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_BOOT_PATCHLEVEL);
97     public static final int DEVICE_UNIQUE_ATTESTATION =
98             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_DEVICE_UNIQUE_ATTESTATION);
99     public static final int IDENTITY_CREDENTIAL_KEY = PRIVATE_BASE - 721;
100 
101     private static final int NON_KM_BASE = PRIVATE_BASE - 2000;
102 
103     public static final int VERIFIED_BOOT_KEY = NON_KM_BASE - 1;
104     public static final int DEVICE_LOCKED = NON_KM_BASE - 2;
105     public static final int VERIFIED_BOOT_HASH = NON_KM_BASE - 3;
106     public static final int ATTESTATION_VERSION = NON_KM_BASE - 4;
107     public static final int KEYMASTER_VERSION = NON_KM_BASE - 5;
108     public static final int OFFICIAL_BUILD = NON_KM_BASE - 6;
109 
110     public static final String SUBMOD_SOFTWARE = "software";
111     public static final String SUBMOD_TEE = "tee";
112 }
113