From 08a7bd530ee86e929fc886d8900136389bcefcb5 Mon Sep 17 00:00:00 2001 From: Sansar Choinyambuu Date: Fri, 26 Aug 2011 10:07:31 +0200 Subject: [PATCH] Corrected output length for SHA256 algorithm --- .../plugins/imc_attestation/imc_attestation.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libimcv/plugins/imc_attestation/imc_attestation.c b/src/libimcv/plugins/imc_attestation/imc_attestation.c index 46a5fa0ab..871e2052e 100644 --- a/src/libimcv/plugins/imc_attestation/imc_attestation.c +++ b/src/libimcv/plugins/imc_attestation/imc_attestation.c @@ -316,15 +316,15 @@ TNC_Result TNC_IMC_ReceiveMessage(TNC_IMCID imc_id, /* Send File Measurement attribute */ selected_algorithm = pts->get_meas_algorithm(pts); meas_len = HASH_SIZE_SHA1; - if (selected_algorithm & PTS_MEAS_ALGO_SHA384) + if(selected_algorithm & PTS_MEAS_ALGO_SHA256) + { + meas_len = HASH_SIZE_SHA256; + } + else if (selected_algorithm & PTS_MEAS_ALGO_SHA384) { meas_len = HASH_SIZE_SHA384; } - else if(selected_algorithm & PTS_MEAS_ALGO_SHA256) - { - meas_len = HASH_SIZE_SHA512; - } - + /** * Hash the file or directory and add them as attribute */