libimcv: Allow pts_t.set_peer_public_value() to fail

This commit is contained in:
Martin Willi
2015-03-23 17:54:02 +01:00
parent 83cda57e2d
commit 8a7dbf3c2a
4 changed files with 11 additions and 7 deletions
@@ -178,8 +178,10 @@ bool imc_attestation_process(pa_tnc_attr_t *attr, imc_msg_t *msg,
return FALSE;
}
pts->set_peer_public_value(pts, initiator_value, initiator_nonce);
if (!pts->calculate_secret(pts))
if (!pts->set_peer_public_value(pts, initiator_value,
initiator_nonce) ||
!pts->calculate_secret(pts))
{
return FALSE;
}
@@ -134,11 +134,11 @@ bool imv_attestation_process(pa_tnc_attr_t *attr, imv_msg_t *out_msg,
}
responder_value = attr_cast->get_responder_value(attr_cast);
pts->set_peer_public_value(pts, responder_value,
responder_nonce);
/* Calculate secret assessment value */
if (!pts->calculate_secret(pts))
if (!pts->set_peer_public_value(pts, responder_value,
responder_nonce) ||
!pts->calculate_secret(pts))
{
return FALSE;
}