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     public static final int RSA_OAEP_MGF_DIGEST =
45             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_RSA_OAEP_MGF_DIGEST);
46     public static final int ROLLBACK_RESISTANCE = PRIVATE_BASE - 303;
47     public static final int EARLY_BOOT_ONLY = PRIVATE_BASE - 305;
48 
49     public static final int ACTIVE_DATETIME =
50             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ACTIVE_DATETIME);
51     public static final int ORIGINATION_EXPIRE_DATETIME =
52             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ORIGINATION_EXPIRE_DATETIME);
53     public static final int USAGE_EXPIRE_DATETIME =
54             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_USAGE_EXPIRE_DATETIME);
55 
56     public static final int NO_AUTH_REQUIRED =
57             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_NO_AUTH_REQUIRED);
58     public static final int USER_AUTH_TYPE =
59             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_USER_AUTH_TYPE);
60     public static final int AUTH_TIMEOUT =
61             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_AUTH_TIMEOUT);
62     public static final int ALLOW_WHILE_ON_BODY =
63             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ALLOW_WHILE_ON_BODY);
64     public static final int USER_PRESENCE_REQUIRED = PRIVATE_BASE - 507;
65     public static final int TRUSTED_CONFIRMATION_REQUIRED =
66             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_TRUSTED_CONFIRMATION_REQUIRED);
67     public static final int UNLOCKED_DEVICE_REQUIRED =
68             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_UNLOCKED_DEVICE_REQUIRED);
69 
70     public static final int APPLICATION_ID =
71             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_APPLICATION_ID);
72 
73     public static final int ORIGIN = PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ORIGIN);
74     // TODO: hardcoded while KeymasterDefs uses the same value for
75     // ROLLBACK_RESISTANCE and ROLLBACK_RESISTANT
76     public static final int ROLLBACK_RESISTANT = PRIVATE_BASE - 703;
77     public static final int OS_VERSION = PRIVATE_BASE - 705;
78     public static final int OS_PATCHLEVEL = PRIVATE_BASE - 706;
79     public static final int ATTESTATION_APPLICATION_ID = PRIVATE_BASE - 709;
80     public static final int ATTESTATION_ID_BRAND =
81             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ATTESTATION_ID_BRAND);
82     public static final int ATTESTATION_ID_DEVICE =
83             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ATTESTATION_ID_DEVICE);
84     public static final int ATTESTATION_ID_PRODUCT =
85             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ATTESTATION_ID_PRODUCT);
86     public static final int ATTESTATION_ID_SERIAL =
87             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ATTESTATION_ID_SERIAL);
88     public static final int ATTESTATION_ID_MEID =
89             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ATTESTATION_ID_MEID);
90     public static final int ATTESTATION_ID_MANUFACTURER =
91             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ATTESTATION_ID_MANUFACTURER);
92     public static final int ATTESTATION_ID_MODEL =
93             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_ATTESTATION_ID_MODEL);
94     public static final int VENDOR_PATCHLEVEL =
95             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_VENDOR_PATCHLEVEL);
96     public static final int BOOT_PATCHLEVEL =
97             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_BOOT_PATCHLEVEL);
98     public static final int DEVICE_UNIQUE_ATTESTATION =
99             PRIVATE_BASE - (0x0FFFFFFF & KeymasterDefs.KM_TAG_DEVICE_UNIQUE_ATTESTATION);
100     public static final int IDENTITY_CREDENTIAL_KEY = PRIVATE_BASE - 721;
101 
102     private static final int NON_KM_BASE = PRIVATE_BASE - 2000;
103 
104     public static final int VERIFIED_BOOT_KEY = NON_KM_BASE - 1;
105     public static final int DEVICE_LOCKED = NON_KM_BASE - 2;
106     public static final int VERIFIED_BOOT_HASH = NON_KM_BASE - 3;
107     public static final int ATTESTATION_VERSION = NON_KM_BASE - 4;
108     public static final int KEYMASTER_VERSION = NON_KM_BASE - 5;
109     public static final int OFFICIAL_BUILD = NON_KM_BASE - 6;
110 
111     public static final String SUBMOD_SOFTWARE = "software";
112     public static final String SUBMOD_TEE = "tee";
113 }
114