Corrected output length for SHA256 algorithm
authorSansar Choinyambuu <schoinya@hsr.ch>
Fri, 26 Aug 2011 08:07:31 +0000 (10:07 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 8 Sep 2011 10:08:14 +0000 (12:08 +0200)
src/libimcv/plugins/imc_attestation/imc_attestation.c

index 46a5fa0..871e205 100644 (file)
@@ -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_SHA384;
+                                               meas_len = HASH_SIZE_SHA256;
                                        }
-                                       else if(selected_algorithm & PTS_MEAS_ALGO_SHA256) 
+                                       else if (selected_algorithm & PTS_MEAS_ALGO_SHA384)
                                        {
-                                               meas_len = HASH_SIZE_SHA512;
+                                               meas_len = HASH_SIZE_SHA384;
                                        }
-                                       
+
                                        /** 
                                        * Hash the file or directory and add them as attribute
                                        */