Wait for the arrival of the TCPG_PTS_DH_NONCE_PARAMS_RESP
authorAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 27 May 2014 19:15:12 +0000 (21:15 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Sat, 31 May 2014 18:37:57 +0000 (20:37 +0200)
src/libpts/plugins/imv_attestation/imv_attestation_build.c
src/libpts/plugins/imv_attestation/imv_attestation_process.c
src/libpts/plugins/imv_attestation/imv_attestation_state.h

index 3750a0a..120fe3e 100644 (file)
@@ -62,6 +62,11 @@ bool imv_attestation_build(imv_msg_t *out_msg, imv_state_t *state,
                        pts_meas_algorithms_t selected_algorithm;
                        chunk_t initiator_value, initiator_nonce;
 
                        pts_meas_algorithms_t selected_algorithm;
                        chunk_t initiator_value, initiator_nonce;
 
+                       if (!(state->get_action_flags(state) & IMV_ATTESTATION_DH_NONCE))
+                       {
+                               break;
+                       }
+
                        /* Send DH nonce finish attribute */
                        selected_algorithm = pts->get_meas_algorithm(pts);
                        pts->get_my_public_value(pts, &initiator_value, &initiator_nonce);
                        /* Send DH nonce finish attribute */
                        selected_algorithm = pts->get_meas_algorithm(pts);
                        pts->get_my_public_value(pts, &initiator_value, &initiator_nonce);
index f2aa4ec..26a57d1 100644 (file)
@@ -142,6 +142,7 @@ bool imv_attestation_process(pa_tnc_attr_t *attr, imv_msg_t *out_msg,
                        {
                                return FALSE;
                        }
                        {
                                return FALSE;
                        }
+                       state->set_action_flags(state, IMV_ATTESTATION_DH_NONCE);
                        break;
                }
                case TCG_PTS_TPM_VERSION_INFO:
                        break;
                }
                case TCG_PTS_TPM_VERSION_INFO:
index c3aea04..b728575 100644 (file)
@@ -48,8 +48,9 @@ enum imv_attestation_flag_t {
        IMV_ATTESTATION_ATTR_MUST =           (1<<3)-1,
        IMV_ATTESTATION_ATTR_REQ =            (1<<3),
        IMV_ATTESTATION_ALGO =                (1<<4),
        IMV_ATTESTATION_ATTR_MUST =           (1<<3)-1,
        IMV_ATTESTATION_ATTR_REQ =            (1<<3),
        IMV_ATTESTATION_ALGO =                (1<<4),
-       IMV_ATTESTATION_FILE_MEAS =           (1<<5),
-       IMV_ATTESTATION_REC =                 (1<<6)
+       IMV_ATTESTATION_DH_NONCE =            (1<<5),
+       IMV_ATTESTATION_FILE_MEAS =           (1<<6),
+       IMV_ATTESTATION_REC =                 (1<<7)
 };
 
 /**
 };
 
 /**