Use struct containing the parameters for Create function
[strongswan.git] / src / libpts / tcg / tcg_pts_attr_simple_comp_evid.c
index 58d9e92..b2798d0 100644 (file)
@@ -241,28 +241,10 @@ METHOD(pa_tnc_attr_t, build, void,
        private_tcg_pts_attr_simple_comp_evid_t *this)
 {
        bio_writer_t *writer;
-       u_int8_t flags = 0, qualifier = 0;
+       u_int8_t qualifier = 0;
        
        writer = bio_writer_create(PTS_SIMPLE_COMP_EVID_SIZE);
-       /* Determine the flags to set*/
-       if (this->pcr_info_included)
-       {
-               flags += 128;
-       }
-       if (this->flags == PTS_SIMPLE_COMP_EVID_FLAG_NO_VER)
-       {
-               flags += 32;
-       }
-       else if (this->flags == PTS_SIMPLE_COMP_EVID_FLAG_VER_FAIL)
-       {
-               flags += 64;
-       }
-       else if (this->flags == PTS_SIMPLE_COMP_EVID_FLAG_VER_PASS)
-       {
-               flags += 96;
-       }
-
-       writer->write_uint8(writer, flags);
+       writer->write_uint8(writer, this->flags);
        writer->write_uint24 (writer, this->depth);
        writer->write_uint24 (writer, this->comp_vendor_id);
        
@@ -341,27 +323,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
        reader = bio_reader_create(this->value);
        
        reader->read_uint8(reader, &flags);
-       /* Determine the flags to set*/
-       if ((flags >> 7) & 1)
-       {
-                this->pcr_info_included = TRUE;
-       }
-       if (!((flags >> 6) & 1) && !((flags >> 5) & 1))
-       {
-               this->flags = PTS_SIMPLE_COMP_EVID_FLAG_NO_VALID;
-       }
-       else if (!((flags >> 6) & 1) && ((flags >> 5) & 1))
-       {
-               this->flags = PTS_SIMPLE_COMP_EVID_FLAG_NO_VER;
-       }
-       else if (((flags >> 6) & 1) && !((flags >> 5) & 1))
-       {
-               this->flags = PTS_SIMPLE_COMP_EVID_FLAG_VER_FAIL;
-       }
-       else if (((flags >> 6) & 1) && ((flags >> 5) & 1))
-       {
-               this->flags = PTS_SIMPLE_COMP_EVID_FLAG_VER_PASS;
-       }
+       this->flags = flags;
        
        reader->read_uint24(reader, &this->depth);
        reader->read_uint24(reader, &this->comp_vendor_id);
@@ -484,7 +446,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_ita_funct_comp_name_t,
+METHOD(tcg_pts_attr_simple_comp_evid_t, get_comp_funct_name, pts_funct_comp_name_t,
        private_tcg_pts_attr_simple_comp_evid_t *this)
 {
        return this->name;
@@ -595,7 +557,6 @@ pa_tnc_attr_t *tcg_pts_attr_simple_comp_evid_create(tcg_pts_attr_simple_comp_evi
                },
                .vendor_id = PEN_TCG,
                .type = TCG_PTS_SIMPLE_COMP_EVID,
-               .pcr_info_included = params.pcr_info_included,
                .flags = params.flags,
                .depth = params.depth,
                .comp_vendor_id = params.vendor_id,