6eeab0792c567a8c6e2c73d3b2a5e1d01d335d34
[strongswan.git] / src / libpts / pts / pts_error.h
1 /*
2 * Copyright (C) 2011 Sansar Choinyambuu
3 * HSR Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16 /**
17 * @defgroup pts_error pts_error
18 * @{ @ingroup pts
19 */
20
21 #ifndef PTS_ERROR_H_
22 #define PTS_ERROR_H_
23
24 typedef enum pts_error_code_t pts_error_code_t;
25
26 #include "pts_meas_algo.h"
27 #include "pa_tnc/pa_tnc_attr.h"
28
29 #include <library.h>
30
31 /**
32 * PTS Attestation Error Codes
33 * see section 3.14.2 of PTS Protocol: Binding to TNC IF-M Specification
34 */
35 enum pts_error_code_t {
36 TCG_PTS_RESERVED_ERROR = 0,
37 TCG_PTS_HASH_ALG_NOT_SUPPORTED = 1,
38 TCG_PTS_INVALID_PATH = 2,
39 TCG_PTS_FILE_NOT_FOUND = 3,
40 TCG_PTS_REG_NOT_SUPPORTED = 4,
41 TCG_PTS_REG_KEY_NOT_FOUND = 5,
42 TCG_PTS_DH_GRPS_NOT_SUPPORTED = 6,
43 TCG_PTS_BAD_NONCE_LENGTH = 7,
44 TCG_PTS_INVALID_NAME_FAM = 8,
45 TCG_PTS_TPM_VERS_NOT_SUPPORTED = 9,
46 TCG_PTS_INVALID_DELIMITER = 10,
47 TCG_PTS_OPERATION_NOT_SUPPORTED = 11,
48 TCG_PTS_RM_ERROR = 12,
49 TCG_PTS_UNABLE_LOCAL_VAL = 13,
50 TCG_PTS_UNABLE_CUR_EVID = 14,
51 TCG_PTS_UNABLE_DET_TTC = 15,
52 TCG_PTS_UNABLE_DET_PCR = 16,
53 };
54
55 /**
56 * enum name for pts_error_code_t.
57 */
58 extern enum_name_t *pts_error_code_names;
59
60 /**
61 * Creates a PTS Hash Algorithm Not Supported Error Attribute
62 * see section 4.2.2 of PTS Protocol: Binding to TNC IF-M Specification
63 *
64 * @param algorithms supported measurement hash algorithms
65 */
66 pa_tnc_attr_t* pts_hash_alg_error_create(pts_meas_algorithms_t algorithms);
67
68 #endif /** PTS_ERROR_H_ @}*/