Lines Matching +full:0 +full:x042

12 TPM2_ST_NO_SESSIONS = 0x8001
13 TPM2_ST_SESSIONS = 0x8002
15 TPM2_CC_FIRST = 0x01FF
17 TPM2_CC_CREATE_PRIMARY = 0x0131
18 TPM2_CC_DICTIONARY_ATTACK_LOCK_RESET = 0x0139
19 TPM2_CC_CREATE = 0x0153
20 TPM2_CC_LOAD = 0x0157
21 TPM2_CC_UNSEAL = 0x015E
22 TPM2_CC_FLUSH_CONTEXT = 0x0165
23 TPM2_CC_START_AUTH_SESSION = 0x0176
24 TPM2_CC_GET_CAPABILITY = 0x017A
25 TPM2_CC_GET_RANDOM = 0x017B
26 TPM2_CC_PCR_READ = 0x017E
27 TPM2_CC_POLICY_PCR = 0x017F
28 TPM2_CC_PCR_EXTEND = 0x0182
29 TPM2_CC_POLICY_PASSWORD = 0x018C
30 TPM2_CC_POLICY_GET_DIGEST = 0x0189
32 TPM2_SE_POLICY = 0x01
33 TPM2_SE_TRIAL = 0x03
35 TPM2_ALG_RSA = 0x0001
36 TPM2_ALG_SHA1 = 0x0004
37 TPM2_ALG_AES = 0x0006
38 TPM2_ALG_KEYEDHASH = 0x0008
39 TPM2_ALG_SHA256 = 0x000B
40 TPM2_ALG_NULL = 0x0010
41 TPM2_ALG_CBC = 0x0042
42 TPM2_ALG_CFB = 0x0043
44 TPM2_RH_OWNER = 0x40000001
45 TPM2_RH_NULL = 0x40000007
46 TPM2_RH_LOCKOUT = 0x4000000A
47 TPM2_RS_PW = 0x40000009
49 TPM2_RC_SIZE = 0x01D5
50 TPM2_RC_AUTH_FAIL = 0x098E
51 TPM2_RC_POLICY_FAIL = 0x099D
52 TPM2_RC_COMMAND_CODE = 0x0143
57 TPM2_CAP_HANDLES = 0x00000001
58 TPM2_CAP_COMMANDS = 0x00000002
59 TPM2_CAP_PCRS = 0x00000005
60 TPM2_CAP_TPM_PROPERTIES = 0x00000006
62 TPM2_PT_FIXED = 0x100
66 HR_LOADED_SESSION = 0x02000000
67 HR_TRANSIENT = 0x80000000
73 0x000: "TPM_RC_SUCCESS",
74 0x030: "TPM_RC_BAD_TAG",
78 0x000: "TPM_RC_FAILURE",
79 0x001: "TPM_RC_FAILURE",
80 0x003: "TPM_RC_SEQUENCE",
81 0x00B: "TPM_RC_PRIVATE",
82 0x019: "TPM_RC_HMAC",
83 0x020: "TPM_RC_DISABLED",
84 0x021: "TPM_RC_EXCLUSIVE",
85 0x024: "TPM_RC_AUTH_TYPE",
86 0x025: "TPM_RC_AUTH_MISSING",
87 0x026: "TPM_RC_POLICY",
88 0x027: "TPM_RC_PCR",
89 0x028: "TPM_RC_PCR_CHANGED",
90 0x02D: "TPM_RC_UPGRADE",
91 0x02E: "TPM_RC_TOO_MANY_CONTEXTS",
92 0x02F: "TPM_RC_AUTH_UNAVAILABLE",
93 0x030: "TPM_RC_REBOOT",
94 0x031: "TPM_RC_UNBALANCED",
95 0x042: "TPM_RC_COMMAND_SIZE",
96 0x043: "TPM_RC_COMMAND_CODE",
97 0x044: "TPM_RC_AUTHSIZE",
98 0x045: "TPM_RC_AUTH_CONTEXT",
99 0x046: "TPM_RC_NV_RANGE",
100 0x047: "TPM_RC_NV_SIZE",
101 0x048: "TPM_RC_NV_LOCKED",
102 0x049: "TPM_RC_NV_AUTHORIZATION",
103 0x04A: "TPM_RC_NV_UNINITIALIZED",
104 0x04B: "TPM_RC_NV_SPACE",
105 0x04C: "TPM_RC_NV_DEFINED",
106 0x050: "TPM_RC_BAD_CONTEXT",
107 0x051: "TPM_RC_CPHASH",
108 0x052: "TPM_RC_PARENT",
109 0x053: "TPM_RC_NEEDS_TEST",
110 0x054: "TPM_RC_NO_RESULT",
111 0x055: "TPM_RC_SENSITIVE",
112 0x07F: "RC_MAX_FM0",
116 0x001: "TPM_RC_ASYMMETRIC",
117 0x002: "TPM_RC_ATTRIBUTES",
118 0x003: "TPM_RC_HASH",
119 0x004: "TPM_RC_VALUE",
120 0x005: "TPM_RC_HIERARCHY",
121 0x007: "TPM_RC_KEY_SIZE",
122 0x008: "TPM_RC_MGF",
123 0x009: "TPM_RC_MODE",
124 0x00A: "TPM_RC_TYPE",
125 0x00B: "TPM_RC_HANDLE",
126 0x00C: "TPM_RC_KDF",
127 0x00D: "TPM_RC_RANGE",
128 0x00E: "TPM_RC_AUTH_FAIL",
129 0x00F: "TPM_RC_NONCE",
130 0x010: "TPM_RC_PP",
131 0x012: "TPM_RC_SCHEME",
132 0x015: "TPM_RC_SIZE",
133 0x016: "TPM_RC_SYMMETRIC",
134 0x017: "TPM_RC_TAG",
135 0x018: "TPM_RC_SELECTOR",
136 0x01A: "TPM_RC_INSUFFICIENT",
137 0x01B: "TPM_RC_SIGNATURE",
138 0x01C: "TPM_RC_KEY",
139 0x01D: "TPM_RC_POLICY_FAIL",
140 0x01F: "TPM_RC_INTEGRITY",
141 0x020: "TPM_RC_TICKET",
142 0x021: "TPM_RC_RESERVED_BITS",
143 0x022: "TPM_RC_BAD_AUTH",
144 0x023: "TPM_RC_EXPIRED",
145 0x024: "TPM_RC_POLICY_CC",
146 0x025: "TPM_RC_BINDING",
147 0x026: "TPM_RC_CURVE",
148 0x027: "TPM_RC_ECC_POINT",
152 0x001: "TPM_RC_CONTEXT_GAP",
153 0x002: "TPM_RC_OBJECT_MEMORY",
154 0x003: "TPM_RC_SESSION_MEMORY",
155 0x004: "TPM_RC_MEMORY",
156 0x005: "TPM_RC_SESSION_HANDLES",
157 0x006: "TPM_RC_OBJECT_HANDLES",
158 0x007: "TPM_RC_LOCALITY",
159 0x008: "TPM_RC_YIELDED",
160 0x009: "TPM_RC_CANCELED",
161 0x00A: "TPM_RC_TESTING",
162 0x010: "TPM_RC_REFERENCE_H0",
163 0x011: "TPM_RC_REFERENCE_H1",
164 0x012: "TPM_RC_REFERENCE_H2",
165 0x013: "TPM_RC_REFERENCE_H3",
166 0x014: "TPM_RC_REFERENCE_H4",
167 0x015: "TPM_RC_REFERENCE_H5",
168 0x016: "TPM_RC_REFERENCE_H6",
169 0x018: "TPM_RC_REFERENCE_S0",
170 0x019: "TPM_RC_REFERENCE_S1",
171 0x01A: "TPM_RC_REFERENCE_S2",
172 0x01B: "TPM_RC_REFERENCE_S3",
173 0x01C: "TPM_RC_REFERENCE_S4",
174 0x01D: "TPM_RC_REFERENCE_S5",
175 0x01E: "TPM_RC_REFERENCE_S6",
176 0x020: "TPM_RC_NV_RATE",
177 0x021: "TPM_RC_LOCKOUT",
178 0x022: "TPM_RC_RETRY",
179 0x023: "TPM_RC_NV_UNAVAILABLE",
180 0x7F: "TPM_RC_NOT_USED",
183 RC_VER1 = 0x100
184 RC_FMT1 = 0x080
185 RC_WARN = 0x900
208 return '0x%0x' % (alg)
224 return '0x%0x' % (alg)
233 self.name = TPM2_FMT1_ERRORS.get(rc & 0x3f, "TPM_RC_UNKNOWN")
235 self.name = TPM2_WARN_ERRORS.get(rc & 0x7f, "TPM_RC_UNKNOWN")
237 self.name = TPM2_VER1_ERRORS.get(rc & 0x7f, "TPM_RC_UNKNOWN")
239 self.name = TPM2_VER0_ERRORS.get(rc & 0x7f, "TPM_RC_UNKNOWN")
243 return '%s: cc=0x%08x, rc=0x%08x' % (self.name, self.cc, self.rc)
245 return '%s: rc=0x%08x' % (self.name, self.rc)
252 session_attributes=0, hmac=bytes()):
348 d = [d[i: i + 16] for i in range(0, len(d), 16)]
355 FLAG_DEBUG = 0x01
356 FLAG_SPACE = 0x02
357 FLAG_NONBLOCK = 0x04
358 TPM_IOC_NEW_SPACE = 0xa200
360 def __init__(self, flags = 0):
363 if (self.flags & Client.FLAG_SPACE) == 0:
364 self.tpm = open('/dev/tpm0', 'r+b', buffering=0)
366 self.tpm = open('/dev/tpmrm0', 'r+b', buffering=0)
393 if (self.flags & Client.FLAG_DEBUG) != 0:
399 rc = struct.unpack('>I', rsp[6:10])[0]
400 if rc != 0:
401 cc = struct.unpack('>I', cmd[6:10])[0]
408 pcrsel = [0] * pcrsel_len
431 digest_cnt = struct.unpack('>I', rsp[:4])[0]
432 if digest_cnt == 0:
466 ('\0' * 16).encode(),
467 0,
472 return struct.unpack('>I', self.send_cmd(cmd)[10:14])[0]
495 pcrsel = [0] * pcrsel_len
563 0)
585 0, 0)
587 return struct.unpack('>I', self.send_cmd(cmd)[10:14])[0]
594 attributes = 0
623 0, 0)
630 private_len = struct.unpack('>H', blob[0:2])[0]
632 public_len = struct.unpack('>H', blob[public_start:public_start + 2])[0]
648 data_handle = struct.unpack('>I', self.send_cmd(cmd)[10:14])[0]
670 data_len = struct.unpack('>I', rsp[10:14])[0] - 2
703 for i in range(0, cnt):
704 handle = struct.unpack('>I', rsp[:4])[0]
730 TPM2_CAP_PCRS, 0, 1)
736 for i in range(0, cnt):
740 pcrSelect = 0
741 if sizeOfSelect > 0: