Register the reception of the AIK attribute
authorAndreas Steffen <andreas.steffen@strongswan.org>
Sat, 30 Aug 2014 11:33:59 +0000 (13:33 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Sun, 5 Oct 2014 10:55:38 +0000 (12:55 +0200)
src/libimcv/plugins/imv_attestation/imv_attestation_build.c
src/libimcv/plugins/imv_attestation/imv_attestation_process.c
src/libimcv/plugins/imv_attestation/imv_attestation_state.h

index 120fe3e..c39fe8d 100644 (file)
@@ -98,6 +98,11 @@ bool imv_attestation_build(imv_msg_t *out_msg, imv_state_t *state,
                        uint32_t depth;
                        bool first_component = TRUE;
 
+                       if (!(state->get_action_flags(state) & IMV_ATTESTATION_AIK))
+                       {
+                               break;
+                       }
+
                        attestation_state->set_handshake_state(attestation_state,
                                                                                IMV_ATTESTATION_STATE_END);
 
index 26a57d1..311c19f 100644 (file)
@@ -218,6 +218,7 @@ bool imv_attestation_process(pa_tnc_attr_t *attr, imv_msg_t *out_msg,
                        }
                        session->get_session_id(session, NULL, &aik_id);
                        pts->set_aik(pts, aik, aik_id);
+                       state->set_action_flags(state, IMV_ATTESTATION_AIK);
                        break;
                }
                case TCG_PTS_FILE_MEAS:
index 5e6fae2..39a8eee 100644 (file)
@@ -49,8 +49,9 @@ enum imv_attestation_flag_t {
        IMV_ATTESTATION_ATTR_REQ =            (1<<3),
        IMV_ATTESTATION_ALGO =                (1<<4),
        IMV_ATTESTATION_DH_NONCE =            (1<<5),
-       IMV_ATTESTATION_FILE_MEAS =           (1<<6),
-       IMV_ATTESTATION_REC =                 (1<<7)
+       IMV_ATTESTATION_AIK =                 (1<<6),
+       IMV_ATTESTATION_FILE_MEAS =           (1<<7),
+       IMV_ATTESTATION_REC =                 (1<<8)
 };
 
 /**