Request missing SWID tags in a directed PA-TNC message
[strongswan.git] / src / libimcv / 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 "pts_dh_group.h"
28 #include "pa_tnc/pa_tnc_attr.h"
29
30 #include <library.h>
31
32 #define PTS_MIN_NONCE_LEN 17
33 #define PTS_MAX_NONCE_LEN 0xffff
34
35 /**
36 * PTS Attestation Error Codes
37 * see section 3.14.2 of PTS Protocol: Binding to TNC IF-M Specification
38 */
39 enum pts_error_code_t {
40 TCG_PTS_RESERVED_ERROR = 0,
41 TCG_PTS_HASH_ALG_NOT_SUPPORTED = 1,
42 TCG_PTS_INVALID_PATH = 2,
43 TCG_PTS_FILE_NOT_FOUND = 3,
44 TCG_PTS_REG_NOT_SUPPORTED = 4,
45 TCG_PTS_REG_KEY_NOT_FOUND = 5,
46 TCG_PTS_DH_GRPS_NOT_SUPPORTED = 6,
47 TCG_PTS_BAD_NONCE_LENGTH = 7,
48 TCG_PTS_INVALID_NAME_FAM = 8,
49 TCG_PTS_TPM_VERS_NOT_SUPPORTED = 9,
50 TCG_PTS_INVALID_DELIMITER = 10,
51 TCG_PTS_OPERATION_NOT_SUPPORTED = 11,
52 TCG_PTS_RM_ERROR = 12,
53 TCG_PTS_UNABLE_LOCAL_VAL = 13,
54 TCG_PTS_UNABLE_CUR_EVID = 14,
55 TCG_PTS_UNABLE_DET_TTC = 15,
56 TCG_PTS_UNABLE_DET_PCR = 16,
57 };
58
59 /**
60 * enum name for pts_error_code_t.
61 */
62 extern enum_name_t *pts_error_code_names;
63
64 /**
65 * Creates a PTS Hash Algorithm Not Supported Error Attribute
66 * see section 4.2.2 of PTS Protocol: Binding to TNC IF-M Specification
67 *
68 * @param algorithms supported measurement hash algorithms
69 */
70 pa_tnc_attr_t* pts_hash_alg_error_create(pts_meas_algorithms_t algorithms);
71
72 /**
73 * Creates a PTS DH Group Not Supported Error Attribute
74 * see section 4.2.4 of PTS Protocol: Binding to TNC IF-M Specification
75 *
76 * @param dh_groups supported DH groups
77 */
78 pa_tnc_attr_t* pts_dh_group_error_create(pts_dh_group_t dh_groups);
79
80 /**
81 * Creates a PTS DH PN Nonce Not Supported Error Attribute
82 * see section 4.2.5 of PTS Protocol: Binding to TNC IF-M Specification
83 *
84 * @param min_nonce_len minimum nonce length
85 * @param max_nonce_len maximum nonce length
86 */
87 pa_tnc_attr_t* pts_dh_nonce_error_create(int min_nonce_len, int max_nonce_len);
88
89 #endif /** PTS_ERROR_H_ @}*/