]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Defined functional components within ITA namespace
authorSansar Choinyambuu <schoinya@hsr.ch>
Wed, 2 Nov 2011 15:38:06 +0000 (16:38 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 28 Nov 2011 20:19:42 +0000 (21:19 +0100)
Implemented handling of functional components evidence request/response

src/libpts/pts/pts.c
src/libpts/tcg/tcg_pts_attr_req_funct_comp_evid.c
src/libpts/tcg/tcg_pts_attr_simple_comp_evid.c
src/libpts/tcg/tcg_pts_attr_simple_comp_evid.h

index 5a5f05b24e5f9867e8caa32cc194b44d95f68e1d..504ef08b2a8b1e766869987ae78c9e8e3c7050d3 100644 (file)
 #include <sys/utsname.h>
 #include <errno.h>
 
-#include <openssl/rsa.h>
-#include <openssl/evp.h>
-#include <openssl/x509.h>
-
 #define PTS_BUF_SIZE   4096
 
 typedef struct private_pts_t private_pts_t;
@@ -934,20 +930,6 @@ METHOD(pts_t, quote_tpm, bool,
        return FALSE;
 }
 
-/**
- * Comparison function for pcr_entry_t struct
- */
-static int pcr_entry_compare(const pcr_entry_t *a, const pcr_entry_t *b)
-{
-       return (a->pcr_number - b->pcr_number);
-}
-
-static int pcr_entry_compare_qsort(const void *a, const void *b)
-{
-       return pcr_entry_compare(*(const pcr_entry_t *const *)a
-                                                       , *(const pcr_entry_t *const *)b);
-}
-
 METHOD(pts_t, add_pcr_entry, void,
        private_pts_t *this, pcr_entry_t *new)
 {
@@ -1026,11 +1008,7 @@ METHOD(pts_t, does_pcr_value_match, bool,
                }
        }
        DESTROY_IF(e);
-
        this->pcrs->insert_last(this->pcrs, new);
-
-       qsort(this->pcrs, this->pcrs->get_count(this->pcrs),
-                 sizeof(pcr_entry_t *), pcr_entry_compare_qsort);
 }
 
 /**
@@ -1166,7 +1144,7 @@ METHOD(pts_t, get_quote_info, bool,
        else
        {
                *out_pcr_composite = chunk_clone(pcr_composite);
-               DBG4(DBG_PTS, "calculated PCR Composite: %B", out_pcr_composite);
+               DBG3(DBG_PTS, "calculated PCR Composite: %B", out_pcr_composite);
        }
 
        /* SHA1 hash of PCR Composite to construct TPM_QUOTE_INFO */
index 123bd9b232ea57c0b13139da5c4134f226e9b1ca..7f08f57de866627be0818ab6ddc1c928bc5d3695 100644 (file)
@@ -303,7 +303,7 @@ pa_tnc_attr_t *tcg_pts_attr_req_funct_comp_evid_create(
                                                                        pts_attr_req_funct_comp_evid_flag_t flags,
                                                                        u_int32_t depth, u_int32_t vendor_id,
                                                                        pts_qualifier_t qualifier,
-                                                                       pts_funct_comp_name_t name)
+                                                                       pts_ita_funct_comp_name_t name)
 {
        private_tcg_pts_attr_req_funct_comp_evid_t *this;
 
index 5625a7230413ec6c72e0611f723fe95d67545c0c..58d9e922b6dfacdad3db5fd932762ceba782cf11 100644 (file)
@@ -484,7 +484,7 @@ METHOD(tcg_pts_attr_simple_comp_evid_t, get_qualifier, pts_qualifier_t,
        return this->qualifier;
 }
 
-METHOD(tcg_pts_attr_simple_comp_evid_t, get_comp_funct_name, pts_funct_comp_name_t,
+METHOD(tcg_pts_attr_simple_comp_evid_t, get_comp_funct_name, pts_ita_funct_comp_name_t,
        private_tcg_pts_attr_simple_comp_evid_t *this)
 {
        return this->name;
index f72429c0cd94fab89b9320c36c7bd3ffa2c464a8..ff846fc8b3ef56e545074c4687cad30a6306e5fb 100644 (file)
@@ -68,7 +68,7 @@ struct tcg_pts_attr_simple_comp_evid_params_t {
        u_int32_t depth;
        u_int32_t vendor_id;
        pts_qualifier_t qualifier;
-       pts_funct_comp_name_t name;
+       pts_ita_funct_comp_name_t name;
        u_int32_t extended_pcr;
        pts_meas_algorithms_t hash_algorithm;
        pts_pcr_transform_t transformation;
@@ -137,7 +137,7 @@ struct tcg_pts_attr_simple_comp_evid_t {
         *
         * @return                                      Component Functional Name
         */
-       pts_funct_comp_name_t (*get_comp_funct_name)(tcg_pts_attr_simple_comp_evid_t *this);
+       pts_ita_funct_comp_name_t (*get_comp_funct_name)(tcg_pts_attr_simple_comp_evid_t *this);
        
        /**
         * Get Measurement Type