1 /*++
2 
3 TSS error return codes
4 
5 --*/
6 
7 #ifndef __TSS_ERROR_H__
8 #define __TSS_ERROR_H__
9 
10 #include <tss/platform.h>
11 
12 //
13 // error coding scheme for a Microsoft Windows platform -
14 // refer to the TSS Specification Parts
15 //
16 //  Values are 32 bit values layed out as follows:
17 //
18 //   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
19 //   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
20 //  +---+-+-+-----------------------+-------+-----------------------+
21 //  |Lev|C|R|     Facility          | Layer |         Code          |
22 //  +---+-+-+-----------------------+-------+-----------------------+
23 //  | Platform specific coding      | TSS error coding system       |
24 //  +---+-+-+-----------------------+-------+-----------------------+
25 //
26 //      Lev - is the Level code
27 //
28 //          00 - Success
29 //          01 - Informational
30 //          10 - Warning
31 //          11 - Error
32 //
33 //      C - is the Customer code flag  (must actually be set)
34 //
35 //      R - is a reserved bit    (unused)
36 //
37 //      Facility - is the facility code: TCPA: proposal 0x028
38 //
39 //      Code - is the facility's status code
40 //
41 
42 //
43 // definitions for the code level information
44 //
45 #define TSS_LEVEL_SUCCESS  0x00     // code level success
46 #define TSS_LEVEL_INFO     0x40000000L    // code level information
47 #define TSS_LEVEL_WARNING  0x80000000L    // code level warning
48 #define TSS_LEVEL_ERROR    0xC0000000L    // code level error
49 
50 //
51 // some defines for the platform specific information
52 //
53 #define FACILITY_TSS            0x28L     // facility number for TCPA return codes
54 #define FACILITY_TSS_CODEPOS   (FACILITY_TSS << 16)  // shift the facility info to the code
55                                                                         // position
56 
57 #define TSS_CUSTOM_CODEFLAG     0x20000000L    // bit position for the custom flag in
58                                                                         // return code
59 
60 //
61 //
62 // TSS error return codes
63 //
64 //
65 #ifndef TSS_E_BASE
66 #define TSS_E_BASE    0x00000000L
67 #endif // TSS_E_BASE
68 #ifndef TSS_W_BASE
69 #define TSS_W_BASE    0x00000000L
70 #endif // TSS_W_BASE
71 #ifndef TSS_I_BASE
72 #define TSS_I_BASE    0x00000000L
73 #endif // TSS_I_BASE
74 
75 //
76 // basic error return codes common to all TSS Service Provider Interface methods
77 // and returned by all TSS SW stack components
78 //
79 
80 //
81 // MessageId: TSS_SUCCESS
82 //
83 // MessageText:
84 //
85 //  Successful completion of the operation.
86 //
87 #define TSS_SUCCESS     (UINT32)(0x00000000L)
88 
89 //
90 // MessageId: TSS_E_FAIL
91 //
92 // MessageText:
93 //
94 //  An internal error has been detected, but the source is unknown.
95 //
96 #define TSS_E_FAIL     (UINT32)(TSS_E_BASE + 0x002L)
97 
98 //
99 // MessageId: TSS_E_BAD_PARAMETER
100 //
101 // MessageText:
102 //
103 // One or more parameter is bad.
104 //
105 #define TSS_E_BAD_PARAMETER    (UINT32)(TSS_E_BASE + 0x003L)
106 
107 //
108 // MessageId: TSS_E_INTERNAL_ERROR
109 //
110 // MessageText:
111 //
112 //  An internal SW error has been detected.
113 //
114 #define TSS_E_INTERNAL_ERROR    (UINT32)(TSS_E_BASE + 0x004L)
115 
116 //
117 // MessageId: TSS_E_OUTOFMEMORY
118 //
119 // MessageText:
120 //
121 // Ran out of memory.
122 //
123 #define TSS_E_OUTOFMEMORY    (UINT32)(TSS_E_BASE + 0x005L)
124 
125 //
126 // MessageId: TSS_E_NOTIMPL
127 //
128 // MessageText:
129 //
130 // Not implemented.
131 //
132 #define TSS_E_NOTIMPL     (UINT32)(TSS_E_BASE + 0x006L)
133 
134 //
135 // MessageId: TSS_E_KEY_ALREADY_REGISTERED
136 //
137 // MessageText:
138 //
139 //  Key is already registered
140 //
141 #define TSS_E_KEY_ALREADY_REGISTERED  (UINT32)(TSS_E_BASE + 0x008L)
142 
143 
144 //
145 // MessageId: TSS_E_TPM_UNEXPECTED
146 //
147 // MessageText:
148 //
149 //  An unexpected TPM error has occurred.
150 //
151 #define TSS_E_TPM_UNEXPECTED    (UINT32)(TSS_E_BASE + 0x010L)
152 
153 //
154 // MessageId: TSS_E_COMM_FAILURE
155 //
156 // MessageText:
157 //
158 //  A communications error with the TPM has been detected.
159 //
160 #define TSS_E_COMM_FAILURE    (UINT32)(TSS_E_BASE + 0x011L)
161 
162 //
163 // MessageId: TSS_E_TIMEOUT
164 //
165 // MessageText:
166 //
167 //  The operation has timed out.
168 //
169 #define TSS_E_TIMEOUT     (UINT32)(TSS_E_BASE + 0x012L)
170 
171 //
172 // MessageId: TSS_E_TPM_UNSUPPORTED_FEATURE
173 //
174 // MessageText:
175 //
176 //  The TPM does not support the requested feature.
177 //
178 #define TSS_E_TPM_UNSUPPORTED_FEATURE  (UINT32)(TSS_E_BASE + 0x014L)
179 
180 //
181 // MessageId: TSS_E_CANCELED
182 //
183 // MessageText:
184 //
185 //  The action was canceled by request.
186 //
187 #define TSS_E_CANCELED     (UINT32)(TSS_E_BASE + 0x016L)
188 
189 //
190 // MessageId: TSS_E_PS_KEY_NOTFOUND
191 //
192 // MessageText:
193 //
194 // The key cannot be found in the persistent storage database.
195 //
196 #define TSS_E_PS_KEY_NOTFOUND    (UINT32)(TSS_E_BASE + 0x020L)
197 //
198 // MessageId: TSS_E_PS_KEY_EXISTS
199 //
200 // MessageText:
201 //
202 // The key already exists in the persistent storage database.
203 //
204 #define TSS_E_PS_KEY_EXISTS            (UINT32)(TSS_E_BASE + 0x021L)
205 
206 //
207 // MessageId: TSS_E_PS_BAD_KEY_STATE
208 //
209 // MessageText:
210 //
211 // The key data set not valid in the persistent storage database.
212 //
213 #define TSS_E_PS_BAD_KEY_STATE         (UINT32)(TSS_E_BASE + 0x022L)
214 
215 
216 //
217 // error codes returned by specific TSS Service Provider Interface methods
218 // offset TSS_TSPI_OFFSET
219 //
220 
221 //
222 // MessageId: TSS_E_INVALID_OBJECT_TYPE
223 //
224 // MessageText:
225 //
226 // Object type not valid for this operation.
227 //
228 #define TSS_E_INVALID_OBJECT_TYPE   (UINT32)(TSS_E_BASE + 0x101L)
229 
230 //
231 // MessageId: TSS_E_NO_CONNECTION
232 //
233 // MessageText:
234 //
235 // Core Service connection doesn't exist.
236 //
237 #define TSS_E_NO_CONNECTION    (UINT32)(TSS_E_BASE + 0x102L)
238 
239 //
240 // MessageId: TSS_E_CONNECTION_FAILED
241 //
242 // MessageText:
243 //
244 // Core Service connection failed.
245 //
246 #define TSS_E_CONNECTION_FAILED   (UINT32)(TSS_E_BASE + 0x103L)
247 
248 //
249 // MessageId: TSS_E_CONNECTION_BROKEN
250 //
251 // MessageText:
252 //
253 // Communication with Core Service failed.
254 //
255 #define TSS_E_CONNECTION_BROKEN   (UINT32)(TSS_E_BASE + 0x104L)
256 
257 //
258 // MessageId: TSS_E_HASH_INVALID_ALG
259 //
260 // MessageText:
261 //
262 // Invalid hash algorithm.
263 //
264 #define TSS_E_HASH_INVALID_ALG   (UINT32)(TSS_E_BASE + 0x105L)
265 
266 //
267 // MessageId: TSS_E_HASH_INVALID_LENGTH
268 //
269 // MessageText:
270 //
271 // Hash length is inconsistent with hash algorithm.
272 //
273 #define TSS_E_HASH_INVALID_LENGTH   (UINT32)(TSS_E_BASE + 0x106L)
274 
275 //
276 // MessageId: TSS_E_HASH_NO_DATA
277 //
278 // MessageText:
279 //
280 // Hash object has no internal hash value.
281 //
282 #define TSS_E_HASH_NO_DATA    (UINT32)(TSS_E_BASE + 0x107L)
283 
284 
285 //
286 // MessageId: TSS_E_INVALID_ATTRIB_FLAG
287 //
288 // MessageText:
289 //
290 // Flag value for attrib-functions inconsistent.
291 //
292 #define TSS_E_INVALID_ATTRIB_FLAG   (UINT32)(TSS_E_BASE + 0x109L)
293 
294 //
295 // MessageId: TSS_E_INVALID_ATTRIB_SUBFLAG
296 //
297 // MessageText:
298 //
299 // Subflag value for attrib-functions inconsistent.
300 //
301 #define TSS_E_INVALID_ATTRIB_SUBFLAG  (UINT32)(TSS_E_BASE + 0x10AL)
302 
303 //
304 // MessageId: TSS_E_INVALID_ATTRIB_DATA
305 //
306 // MessageText:
307 //
308 // Data for attrib-functions invalid.
309 //
310 #define TSS_E_INVALID_ATTRIB_DATA   (UINT32)(TSS_E_BASE + 0x10BL)
311 
312 //
313 // MessageId: TSS_E_INVALID_OBJECT_INITFLAG
314 //
315 // MessageText:
316 //
317 // Wrong flag information for object creation.
318 //
319 // The alternate spelling is supported to be compatible with a typo
320 // in the 1.1b header files.
321 //
322 #define TSS_E_INVALID_OBJECT_INIT_FLAG  (UINT32)(TSS_E_BASE + 0x10CL)
323 #define TSS_E_INVALID_OBJECT_INITFLAG   TSS_E_INVALID_OBJECT_INIT_FLAG
324 
325 //
326 // MessageId: TSS_E_NO_PCRS_SET
327 //
328 // MessageText:
329 //
330 // No PCR register are selected or set.
331 //
332 #define TSS_E_NO_PCRS_SET    (UINT32)(TSS_E_BASE + 0x10DL)
333 
334 //
335 // MessageId: TSS_E_KEY_NOT_LOADED
336 //
337 // MessageText:
338 //
339 // The addressed key is currently not loaded.
340 //
341 #define TSS_E_KEY_NOT_LOADED    (UINT32)(TSS_E_BASE + 0x10EL)
342 
343 //
344 // MessageId: TSS_E_KEY_NOT_SET
345 //
346 // MessageText:
347 //
348 // No key information is currently available.
349 //
350 #define TSS_E_KEY_NOT_SET    (UINT32)(TSS_E_BASE + 0x10FL)
351 
352 //
353 // MessageId: TSS_E_VALIDATION_FAILED
354 //
355 // MessageText:
356 //
357 // Internal validation of data failed.
358 //
359 #define TSS_E_VALIDATION_FAILED   (UINT32)(TSS_E_BASE + 0x110L)
360 
361 //
362 // MessageId: TSS_E_TSP_AUTHREQUIRED
363 //
364 // MessageText:
365 //
366 // Authorization is required.
367 //
368 #define TSS_E_TSP_AUTHREQUIRED   (UINT32)(TSS_E_BASE + 0x111L)
369 
370 //
371 // MessageId: TSS_E_TSP_AUTH2REQUIRED
372 //
373 // MessageText:
374 //
375 // Multiple authorization is required.
376 //
377 #define TSS_E_TSP_AUTH2REQUIRED   (UINT32)(TSS_E_BASE + 0x112L)
378 
379 //
380 // MessageId: TSS_E_TSP_AUTHFAIL
381 //
382 // MessageText:
383 //
384 // Authorization failed.
385 //
386 #define TSS_E_TSP_AUTHFAIL    (UINT32)(TSS_E_BASE + 0x113L)
387 
388 //
389 // MessageId: TSS_E_TSP_AUTH2FAIL
390 //
391 // MessageText:
392 //
393 // Multiple authorization failed.
394 //
395 #define TSS_E_TSP_AUTH2FAIL    (UINT32)(TSS_E_BASE + 0x114L)
396 
397 //
398 // MessageId: TSS_E_KEY_NO_MIGRATION_POLICY
399 //
400 // MessageText:
401 //
402 // There's no migration policy object set for the addressed key.
403 //
404 #define TSS_E_KEY_NO_MIGRATION_POLICY  (UINT32)(TSS_E_BASE + 0x115L)
405 
406 //
407 // MessageId: TSS_E_POLICY_NO_SECRET
408 //
409 // MessageText:
410 //
411 // No secret information is currently available for the addressed policy object.
412 //
413 #define TSS_E_POLICY_NO_SECRET   (UINT32)(TSS_E_BASE + 0x116L)
414 
415 //
416 // MessageId: TSS_E_INVALID_OBJ_ACCESS
417 //
418 // MessageText:
419 //
420 // The operation failed due to an invalid object status.
421 //
422 #define TSS_E_INVALID_OBJ_ACCESS   (UINT32)(TSS_E_BASE + 0x117L)
423 
424 //
425 // MessageId: TSS_E_INVALID_ENCSCHEME
426 //
427 // MessageText:
428 //
429 //
430 //
431 #define TSS_E_INVALID_ENCSCHEME   (UINT32)(TSS_E_BASE + 0x118L)
432 
433 
434 //
435 // MessageId: TSS_E_INVALID_SIGSCHEME
436 //
437 // MessageText:
438 //
439 //
440 //
441 #define TSS_E_INVALID_SIGSCHEME   (UINT32)(TSS_E_BASE + 0x119L)
442 
443 //
444 // MessageId: TSS_E_ENC_INVALID_LENGTH
445 //
446 // MessageText:
447 //
448 //
449 //
450 #define TSS_E_ENC_INVALID_LENGTH   (UINT32)(TSS_E_BASE + 0x120L)
451 
452 
453 //
454 // MessageId: TSS_E_ENC_NO_DATA
455 //
456 // MessageText:
457 //
458 //
459 //
460 #define TSS_E_ENC_NO_DATA    (UINT32)(TSS_E_BASE + 0x121L)
461 
462 //
463 // MessageId: TSS_E_ENC_INVALID_TYPE
464 //
465 // MessageText:
466 //
467 //
468 //
469 #define TSS_E_ENC_INVALID_TYPE   (UINT32)(TSS_E_BASE + 0x122L)
470 
471 
472 //
473 // MessageId: TSS_E_INVALID_KEYUSAGE
474 //
475 // MessageText:
476 //
477 //
478 //
479 #define TSS_E_INVALID_KEYUSAGE   (UINT32)(TSS_E_BASE + 0x123L)
480 
481 //
482 // MessageId: TSS_E_VERIFICATION_FAILED
483 //
484 // MessageText:
485 //
486 //
487 //
488 #define TSS_E_VERIFICATION_FAILED   (UINT32)(TSS_E_BASE + 0x124L)
489 
490 //
491 // MessageId: TSS_E_HASH_NO_IDENTIFIER
492 //
493 // MessageText:
494 //
495 // Hash algorithm identifier not set.
496 //
497 #define TSS_E_HASH_NO_IDENTIFIER   (UINT32)(TSS_E_BASE + 0x125L)
498 
499 //
500 // MessageId: TSS_E_INVALID_HANDLE
501 //
502 // MessageText:
503 //
504 //  An invalid handle
505 //
506 #define TSS_E_INVALID_HANDLE    (UINT32)(TSS_E_BASE + 0x126L)
507 
508 //
509 // MessageId: TSS_E_SILENT_CONTEXT
510 //
511 // MessageText:
512 //
513 //  A silent context requires user input
514 //
515 #define TSS_E_SILENT_CONTEXT           (UINT32)(TSS_E_BASE + 0x127L)
516 
517 //
518 // MessageId: TSS_E_EK_CHECKSUM
519 //
520 // MessageText:
521 //
522 // TSP is instructed to verify the EK checksum and it does not verify.
523 //
524 #define TSS_E_EK_CHECKSUM             (UINT32)(TSS_E_BASE + 0x128L)
525 
526 
527 //
528 // MessageId: TSS_E_DELGATION_NOTSET
529 //
530 // MessageText:
531 //
532 // The Policy object does not have a delegation blob set.
533 //
534 #define TSS_E_DELEGATION_NOTSET      (UINT32)(TSS_E_BASE + 0x129L)
535 
536 //
537 // MessageId: TSS_E_DELFAMILY_NOTFOUND
538 //
539 // MessageText:
540 //
541 // The specified delegation family was not found
542 //
543 #define TSS_E_DELFAMILY_NOTFOUND       (UINT32)(TSS_E_BASE + 0x130L)
544 
545 //
546 // MessageId: TSS_E_DELFAMILY_ROWEXISTS
547 //
548 // MessageText:
549 //
550 // The specified delegation family table row is already in use and
551 // the command flags does not allow the TSS to overwrite the existing
552 // entry.
553 //
554 #define TSS_E_DELFAMILY_ROWEXISTS    (UINT32)(TSS_E_BASE + 0x131L)
555 
556 //
557 // MessageId: TSS_E_VERSION_MISMATCH
558 //
559 // MessageText:
560 //
561 // The specified delegation family table row is already in use and
562 // the command flags does not allow the TSS to overwrite the existing
563 // entry.
564 //
565 #define TSS_E_VERSION_MISMATCH       (UINT32)(TSS_E_BASE + 0x132L)
566 
567 //
568 //  MessageId: TSS_E_DAA_AR_DECRYPTION_ERROR
569 //
570 //  Decryption of the encrypted pseudonym has failed, due to
571 //  either a wrong secret key or a wrong decryption condition.
572 //
573 #define TSS_E_DAA_AR_DECRYPTION_ERROR             (UINT32)(TSS_E_BASE + 0x133L)
574 
575 //
576 //  MessageId: TSS_E_DAA_AUTHENTICATION_ERROR
577 //
578 //  The TPM could not be authenticated by the DAA Issuer.
579 //
580 #define TSS_E_DAA_AUTHENTICATION_ERROR            (UINT32)(TSS_E_BASE + 0x134L)
581 
582 //
583 //  MessageId: TSS_E_DAA_CHALLENGE_RESPONSE_ERROR
584 //
585 //  DAA Challenge response error.
586 //
587 #define TSS_E_DAA_CHALLENGE_RESPONSE_ERROR        (UINT32)(TSS_E_BASE + 0x135L)
588 
589 //
590 //  MessageId: TSS_E_DAA_CREDENTIAL_PROOF_ERROR
591 //
592 //  Verification of the credential TSS_DAA_CRED_ISSUER issued by
593 //  the DAA Issuer has failed.
594 //
595 #define TSS_E_DAA_CREDENTIAL_PROOF_ERROR          (UINT32)(TSS_E_BASE + 0x136L)
596 
597 //
598 //  MessageId: TSS_E_DAA_CREDENTIAL_REQUEST_PROOF_ERROR
599 //
600 //  Verification of the platform's credential request
601 //  TSS_DAA_CREDENTIAL_REQUEST has failed.
602 //
603 #define TSS_E_DAA_CREDENTIAL_REQUEST_PROOF_ERROR  (UINT32)(TSS_E_BASE + 0x137L)
604 
605 //
606 //  MessageId: TSS_E_DAA_ISSUER_KEY_ERROR
607 //
608 //  DAA Issuer's authentication key chain could not be verified or
609 //  is not correct.
610 //
611 #define TSS_E_DAA_ISSUER_KEY_ERROR                (UINT32)(TSS_E_BASE + 0x138L)
612 
613 //
614 //  MessageId: TSS_E_DAA_PSEUDONYM_ERROR
615 //
616 //  While verifying the pseudonym of the TPM, the private key of the
617 //  TPM was found on the rogue list.
618 //
619 #define TSS_E_DAA_PSEUDONYM_ERROR                 (UINT32)(TSS_E_BASE + 0x139L)
620 
621 //
622 //  MessageId: TSS_E_INVALID_RESOURCE
623 //
624 //  Pointer to memory wrong.
625 //
626 #define TSS_E_INVALID_RESOURCE                    (UINT32)(TSS_E_BASE + 0x13AL)
627 
628 //
629 //  MessageId: TSS_E_NV_AREA_EXIST
630 //
631 //  The NV area referenced already exists
632 //
633 #define TSS_E_NV_AREA_EXIST                       (UINT32)(TSS_E_BASE + 0x13BL)
634 
635 //
636 //  MessageId: TSS_E_NV_AREA_NOT_EXIST
637 //
638 //  The NV area referenced doesn't exist
639 //
640 #define TSS_E_NV_AREA_NOT_EXIST                   (UINT32)(TSS_E_BASE + 0x13CL)
641 
642 //
643 //  MessageId: TSS_E_TSP_TRANS_AUTHFAIL
644 //
645 //  The transport session authorization failed
646 //
647 #define TSS_E_TSP_TRANS_AUTHFAIL                  (UINT32)(TSS_E_BASE + 0x13DL)
648 
649 //
650 //  MessageId: TSS_E_TSP_TRANS_AUTHREQUIRED
651 //
652 //  Authorization for transport is required
653 //
654 #define TSS_E_TSP_TRANS_AUTHREQUIRED              (UINT32)(TSS_E_BASE + 0x13EL)
655 
656 //
657 //  MessageId: TSS_E_TSP_TRANS_NOT_EXCLUSIVE
658 //
659 //  A command was executed outside of an exclusive transport session.
660 //
661 #define TSS_E_TSP_TRANS_NOTEXCLUSIVE              (UINT32)(TSS_E_BASE + 0x13FL)
662 
663 //
664 //  MessageId: TSS_E_TSP_TRANS_FAIL
665 //
666 //  Generic transport protection error.
667 //
668 #define TSS_E_TSP_TRANS_FAIL                     (UINT32)(TSS_E_BASE + 0x140L)
669 
670 //
671 //  MessageId: TSS_E_TSP_TRANS_NO_PUBKEY
672 //
673 //  A command could not be executed through a logged transport session
674 //  because the command used a key and the key's public key is not
675 //  known to the TSP.
676 //
677 #define TSS_E_TSP_TRANS_NO_PUBKEY                (UINT32)(TSS_E_BASE + 0x141L)
678 
679 //
680 //  MessageId: TSS_E_NO_ACTIVE_COUNTER
681 //
682 //  The TPM active counter has not been set yet.
683 //
684 #define TSS_E_NO_ACTIVE_COUNTER                  (UINT32)(TSS_E_BASE + 0x142L)
685 
686 
687 #endif // __TSS_ERROR_H__
688