Implemented Error Codes Enumeration for PTS
authorSansar Choinyambuu <schoinya@hsr.ch>
Mon, 22 Aug 2011 15:21:23 +0000 (17:21 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 8 Sep 2011 10:08:13 +0000 (12:08 +0200)
src/libimcv/Makefile.am
src/libimcv/tcg/pts/pts_error.c [new file with mode: 0644]
src/libimcv/tcg/pts/pts_error.h [new file with mode: 0644]

index e331b9a..8db55e2 100644 (file)
@@ -30,6 +30,7 @@ libimcv_la_SOURCES = \
        tcg/tcg_pts_attr_req_file_meas.h tcg/tcg_pts_attr_req_file_meas.c \
        tcg/tcg_pts_attr_file_meas.h tcg/tcg_pts_attr_file_meas.c \
        tcg/pts/pts.h tcg/pts/pts.c \
+       tcg/pts/pts_error.h tcg/pts/pts_error.c \
        tcg/pts/pts_proto_caps.h tcg/pts/pts_funct_comp_name.h \
        tcg/pts/pts_meas_algo.h tcg/pts/pts_meas_algo.c
 
diff --git a/src/libimcv/tcg/pts/pts_error.c b/src/libimcv/tcg/pts/pts_error.c
new file mode 100644 (file)
index 0000000..ca33fb4
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2011 Sansar Choinyambuu
+ * HSR Hochschule fuer Technik Rapperswil
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * for more details.
+ */
+
+#include "pts_error.h"
+
+ENUM(pts_error_code_names, TCG_PTS_RESERVED_ERROR, TCG_PTS_UNABLE_DET_PCR,
+       "Reserved Error",
+       "Hash Algorithm Not Supported",
+       "Invalid Path",
+       "File Not Found",
+       "Registry Not Supported",
+       "Registry Key Not Found",
+       "D-H Group Not Supported",
+       "DH-PN Nonce Not Acceptable",
+       "Invalid Functional Name Family",
+       "TPM Version Information Unavailable",
+       "Invalid File Pathname Delimiter",
+       "PTS Operation Not Supported",
+       "Unable To Update Reference Manifest",
+       "Unable To Perform Local Validation",
+       "Unable To Collect Current Evidence",
+       "Unable To Determine Transitive Trust Chain",
+       "Unable To Determine PCR"
+);
diff --git a/src/libimcv/tcg/pts/pts_error.h b/src/libimcv/tcg/pts/pts_error.h
new file mode 100644 (file)
index 0000000..1cb6644
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2011 Sansar Choinyambuu
+ * HSR Hochschule fuer Technik Rapperswil
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * for more details.
+ */
+
+/**
+ * @defgroup pts_error pts_error
+ * @{ @ingroup pts
+ */
+
+#ifndef PTS_ERROR_H_
+#define PTS_ERROR_H_
+
+typedef enum pts_error_code_t pts_error_code_t;
+
+#include <library.h>
+
+/**
+  * PTS Attestation Error Codes
+  * see section 3.14.2 of PTS Protocol: Binding to TNC IF-M Specification
+ */
+enum pts_error_code_t {
+       TCG_PTS_RESERVED_ERROR =                0,
+       TCG_PTS_HASH_ALG_NOT_SUPPORTED =        1,
+       TCG_PTS_INVALID_PATH =                  2,
+       TCG_PTS_FILE_NOT_FOUND =                3,
+       TCG_PTS_REG_NOT_SUPPORTED =             4,
+       TCG_PTS_REG_KEY_NOT_FOUND =             5,
+       TCG_PTS_DH_GRPS_NOT_SUPPORTED =         6,
+       TCG_PTS_BAD_NONCE_LENGTH =              7,
+       TCG_PTS_INVALID_NAME_FAM =              8,
+       TCG_PTS_TPM_VERS_NOT_SUPPORTED =        9,
+       TCG_PTS_INVALID_DELIMITER =             10,
+       TCG_PTS_OPERATION_NOT_SUPPORTED =       11,
+       TCG_PTS_RM_ERROR =                      12,
+       TCG_PTS_UNABLE_LOCAL_VAL =              13,
+       TCG_PTS_UNABLE_CUR_EVID =               14,
+       TCG_PTS_UNABLE_DET_TTC =                15,
+       TCG_PTS_UNABLE_DET_PCR =                16,
+       PB_BATCH_ROOF =                         16
+};
+
+/**
+ * enum name for pts_error_code_t.
+ */
+extern enum_name_t *pts_error_code_names;
+
+#endif /** PTS_ERROR_H_ @}*/
\ No newline at end of file