1 /********************************************************************************/
2 /*										*/
3 /*			     TSS Error Codes					*/
4 /*			     Written by Ken Goldman				*/
5 /*		       IBM Thomas J. Watson Research Center			*/
6 /*										*/
7 /* (c) Copyright IBM Corporation 2015 - 2019.					*/
8 /*										*/
9 /* All rights reserved.								*/
10 /* 										*/
11 /* Redistribution and use in source and binary forms, with or without		*/
12 /* modification, are permitted provided that the following conditions are	*/
13 /* met:										*/
14 /* 										*/
15 /* Redistributions of source code must retain the above copyright notice,	*/
16 /* this list of conditions and the following disclaimer.			*/
17 /* 										*/
18 /* Redistributions in binary form must reproduce the above copyright		*/
19 /* notice, this list of conditions and the following disclaimer in the		*/
20 /* documentation and/or other materials provided with the distribution.		*/
21 /* 										*/
22 /* Neither the names of the IBM Corporation nor the names of its		*/
23 /* contributors may be used to endorse or promote products derived from		*/
24 /* this software without specific prior written permission.			*/
25 /* 										*/
26 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS		*/
27 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT		*/
28 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR	*/
29 /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT		*/
30 /* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,	*/
31 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT		*/
32 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,	*/
33 /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY	*/
34 /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT		*/
35 /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE	*/
36 /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.		*/
37 /********************************************************************************/
38 
39 /* This is a public header. That defines TSS error codes.
40 
41    tss.h includes it for convenience.
42 */
43 
44 #ifndef TSSERROR_H
45 #define TSSERROR_H
46 
47 /* the base for these errors is 11 << 16 = 000bxxxx */
48 
49 #define	TSS_RC_OUT_OF_MEMORY		0x000b0001	/* Out of memory,(malloc failed) */
50 #define	TSS_RC_ALLOC_INPUT		0x000b0002	/* The input to an allocation is not NULL */
51 #define	TSS_RC_MALLOC_SIZE		0x000b0003	/* The malloc size is too large or zero */
52 #define	TSS_RC_INSUFFICIENT_BUFFER	0x000b0004	/* A buffer was insufficient for a copy */
53 #define TSS_RC_BAD_PROPERTY		0x000b0005	/* The property parameter is out of range */
54 #define TSS_RC_BAD_PROPERTY_VALUE	0x000b0006	/* The property value is invalid */
55 #define TSS_RC_INSUPPORTED_INTERFACE	0x000b0007	/* The TPM interface type is not supported */
56 #define TSS_RC_NO_CONNECTION		0x000b0008	/* Failure connecting to lower layer */
57 #define TSS_RC_BAD_CONNECTION		0x000b0009	/* Failure communicating with lower layer */
58 #define TSS_RC_MALFORMED_RESPONSE	0x000b000a	/* A response packet was fundamentally malformed */
59 #define TSS_RC_NULL_PARAMETER		0x000b000b	/* A required parameter was NULL */
60 #define TSS_RC_NOT_IMPLEMENTED		0x000b000c	/* TSS function is not implemented */
61 #define TSS_RC_BAD_READ_VALUE		0x000b000d	/* Actual read value different from expected */
62 #define	TSS_RC_FILE_OPEN		0x000b0010	/* The file could not be opened */
63 #define	TSS_RC_FILE_SEEK		0x000b0011	/* A file seek failed */
64 #define	TSS_RC_FILE_FTELL		0x000b0012	/* A file ftell failed */
65 #define	TSS_RC_FILE_READ		0x000b0013	/* A file read failed */
66 #define	TSS_RC_FILE_CLOSE		0x000b0014	/* A file close failed */
67 #define	TSS_RC_FILE_WRITE		0x000b0015	/* A file write failed */
68 #define	TSS_RC_FILE_REMOVE		0x000b0016	/* A file remove failed */
69 #define	TSS_RC_RNG_FAILURE		0x000b0020	/* Random number generator failed */
70 #define TSS_RC_BAD_PWAP_NONCE		0x000b0030	/* Bad PWAP response nonce */
71 #define TSS_RC_BAD_PWAP_ATTRIBUTES	0x000b0031	/* Bad PWAP response attributes */
72 #define	TSS_RC_BAD_PWAP_HMAC		0x000b0032	/* Bad PWAP response HMAC */
73 #define	TSS_RC_NAME_NOT_IMPLEMENTED	0x000b0040	/* Name calculation not implemented for handle type */
74 #define	TSS_RC_MALFORMED_NV_PUBLIC	0x000b0041	/* The NV public structure does not match the name */
75 #define TSS_RC_NAME_FILENAME		0x000b0042	/* The name filename function has inconsistent arguments */
76 #define TSS_RC_MALFORMED_PUBLIC		0x000b0043	/* The public structure does not match the name */
77 #define	TSS_RC_DECRYPT_SESSIONS		0x000b0050	/* More than one command decrypt session */
78 #define	TSS_RC_ENCRYPT_SESSIONS		0x000b0051	/* More than one response encrypt session */
79 #define	TSS_RC_NO_DECRYPT_PARAMETER	0x000b0052	/* Command has no decrypt parameter */
80 #define	TSS_RC_NO_ENCRYPT_PARAMETER	0x000b0053	/* Response has no encrypt parameter */
81 #define	TSS_RC_BAD_DECRYPT_ALGORITHM	0x000b0054	/* Session had an unimplemented decrypt symmetric algorithm */
82 #define	TSS_RC_BAD_ENCRYPT_ALGORITHM	0x000b0055	/* Session had an unimplemented encrypt symmetric algorithm */
83 #define	TSS_RC_AES_ENCRYPT_FAILURE	0x000b0056	/* AES encryption failed */
84 #define	TSS_RC_AES_DECRYPT_FAILURE	0x000b0057	/* AES decryption failed */
85 #define TSS_RC_BAD_ENCRYPT_SIZE		0x000b0058	/* Parameter encryption size mismatch */
86 #define TSS_RC_AES_KEYGEN_FAILURE	0x000b0059	/* AES key generation failed */
87 #define TSS_RC_SESSION_NUMBER		0x000b005a	/* session number out of range */
88 #define	TSS_RC_BAD_SALT_KEY		0x000b0060	/* tpmKey is unsuitable for salt */
89 #define	TSS_RC_KDFA_FAILED		0x000b0070	/* KDFa function failed */
90 #define	TSS_RC_HMAC			0x000b0071	/* An HMAC calculation failed */
91 #define	TSS_RC_HMAC_SIZE		0x000b0072	/* Response HMAC is the wrong size */
92 #define	TSS_RC_HMAC_VERIFY		0x000b0073	/* HMAC does not verify */
93 #define	TSS_RC_BAD_HASH_ALGORITHM	0x000b0074	/* Unimplemented hash algorithm */
94 #define	TSS_RC_HASH			0x000b0075	/* A hash calculation failed */
95 #define TSS_RC_RSA_KEY_CONVERT		0x000b0076	/* RSA key conversion failed */
96 #define TSS_RC_RSA_PADDING		0x000b0077	/* RSA add padding failed */
97 #define TSS_RC_RSA_ENCRYPT		0x000b0078	/* RSA public encrypt failed */
98 #define TSS_RC_BIGNUM			0x000b0079	/* BIGNUM operation failed */
99 #define TSS_RC_RSA_SIGNATURE		0x000b007a	/* RSA signature is bad */
100 #define TSS_RC_EC_SIGNATURE		0x000b007b	/* EC signature is bad */
101 #define TSS_RC_EC_KEY_CONVERT		0x000b007c	/* EC key conversion failed */
102 #define TSS_RC_BAD_SIGNATURE_ALGORITHM	0x000b007d	/* Unimplemented signature algorithm */
103 #define TSS_RC_X509_ERROR		0x000b007e	/* X509 parse error */
104 #define TSS_RC_PEM_ERROR		0x000b007f	/* PEM parse error */
105 #define TSS_RC_COMMAND_UNIMPLEMENTED	0x000b0080	/* Unimplemented command */
106 #define TSS_RC_IN_PARAMETER		0x000b0081	/* Bad in parameter to TSS_Execute */
107 #define TSS_RC_OUT_PARAMETER		0x000b0082	/* Bad out parameter to TSS_Execute */
108 #define TSS_RC_BAD_HANDLE_NUMBER	0x000b0083	/* Bad handle number for this command */
109 #define TSS_RC_KDFE_FAILED              0x000b0084      /* KDFe function failed */
110 #define TSS_RC_EC_EPHEMERAL_FAILURE     0x000b0085      /* Failed while making or using EC ephemeral key */
111 #define TSS_RC_FAIL			0x000b0086	/* TSS internal failure */
112 #define TSS_RC_NO_SESSION_SLOT		0x000b0090	/* TSS context has no session slot for handle */
113 #define TSS_RC_NO_OBJECTPUBLIC_SLOT	0x000b0091	/* TSS context has no object public slot for handle */
114 #define TSS_RC_NO_NVPUBLIC_SLOT		0x000b0092	/* TSS context has no NV public slot for handle */
115 #endif
116