From: Andreas Steffen Date: Tue, 27 May 2014 19:15:12 +0000 (+0200) Subject: Wait for the arrival of the TCPG_PTS_DH_NONCE_PARAMS_RESP X-Git-Tag: 5.2.0dr5~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=543447cb6b3e08e627a6c9470f1bf5e951bee868;p=thirdparty%2Fstrongswan.git Wait for the arrival of the TCPG_PTS_DH_NONCE_PARAMS_RESP --- diff --git a/src/libpts/plugins/imv_attestation/imv_attestation_build.c b/src/libpts/plugins/imv_attestation/imv_attestation_build.c index 3750a0a5ba..120fe3eaa7 100644 --- a/src/libpts/plugins/imv_attestation/imv_attestation_build.c +++ b/src/libpts/plugins/imv_attestation/imv_attestation_build.c @@ -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; + 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); diff --git a/src/libpts/plugins/imv_attestation/imv_attestation_process.c b/src/libpts/plugins/imv_attestation/imv_attestation_process.c index f2aa4ec823..26a57d15ce 100644 --- a/src/libpts/plugins/imv_attestation/imv_attestation_process.c +++ b/src/libpts/plugins/imv_attestation/imv_attestation_process.c @@ -142,6 +142,7 @@ bool imv_attestation_process(pa_tnc_attr_t *attr, imv_msg_t *out_msg, { return FALSE; } + state->set_action_flags(state, IMV_ATTESTATION_DH_NONCE); break; } case TCG_PTS_TPM_VERSION_INFO: diff --git a/src/libpts/plugins/imv_attestation/imv_attestation_state.h b/src/libpts/plugins/imv_attestation/imv_attestation_state.h index c3aea048cb..b728575522 100644 --- a/src/libpts/plugins/imv_attestation/imv_attestation_state.h +++ b/src/libpts/plugins/imv_attestation/imv_attestation_state.h @@ -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_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) }; /**