]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Implemented handling of DH Parameters Response and Finish attributes
authorSansar Choinyambuu <schoinya@hsr.ch>
Fri, 23 Sep 2011 14:06:29 +0000 (16:06 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 28 Nov 2011 15:05:19 +0000 (16:05 +0100)
Implemented calculating session secrets

src/libimcv/plugins/imc_attestation/imc_attestation.c
src/libimcv/plugins/imv_attestation/imv_attestation.c
src/libpts/pts/pts.h

index 99fbdc1cf80a9927ca79ed01b70195d42a049b87..101f592504d178284cf4b15d557abfb5e2f31e92 100644 (file)
@@ -67,6 +67,12 @@ static linked_list_t *evidences = NULL;
  */
 static pts_dh_group_t supported_dh_groups = 0;
 
+/**
+ * High Entropy Random Data
+ * used in calculation of shared secret for the assessment session
+ */
+static chunk_t responder_nonce;
+
 /**
  * see section 3.7.1 of TCG TNC IF-IMC Specification 1.2
  */
index 87832a730bd6bfdef69564651155619ddade6a47..9f9131b3a5efcd4fa3f9fdd0eeb326095309944a 100644 (file)
@@ -62,6 +62,12 @@ static pts_dh_group_t supported_dh_groups = PTS_DH_GROUP_NONE;
  */
 static pts_dh_group_t supported_dh_groups = 0;
 
+/**
+ * High Entropy Random Data
+ * used in calculation of shared secret for the assessment session
+ */
+static chunk_t initiator_nonce;
+
 /**
  * PTS file measurement database
  */
@@ -77,6 +83,11 @@ static pts_creds_t *pts_creds;
  */
 static credential_manager_t *pts_credmgr;
 
+/**
+ * TRUE if DH Nonce Parameters Request attribute is sent
+ */
+static bool dh_nonce_req_sent = FALSE;
+
 /**
  * see section 3.7.1 of TCG TNC IF-IMV Specification 1.2
  */
@@ -474,6 +485,7 @@ TNC_Result TNC_IMV_Terminate(TNC_IMVID imv_id)
        }
        DESTROY_IF(pts_db);
        DESTROY_IF(pts_credmgr);
+       free(initiator_nonce.ptr);
 
        libpts_deinit();
 
index a4d6eda200e710233a9b43eb298c33a4cb56c5e4..864e92d53b88d4e70e8c6cfa6735f763804d39be 100644 (file)
@@ -175,6 +175,46 @@ struct pts_t {
         */
        bool (*calculate_secret) (pts_t *this);
 
+       /**
+        * Set PTS Diffie Hellman Object
+        *
+        * @param dh                    D-H object
+        */
+       bool (*create_dh)(pts_t *this, pts_dh_group_t group);
+
+       /**
+        * Gets Own Diffie Hellman Public Value
+        *
+        * @return                              D-H Public Value
+        */
+       chunk_t (*get_my_pub_val)(pts_t *this);
+
+       /**
+        * Sets the public value of partner.
+        *
+        * @param value         public value of partner
+        */
+       void (*set_other_pub_val) (pts_t *this, chunk_t value);
+
+       /**
+        * Calculates secret assessment value to be used for TPM Quote as an external data
+        *
+        * @param initiator_nonce               Initiator nonce (IMV nonce)
+        * @param responder_nonce               Responder nonce (IMC nonce)
+        * @param algorithm                             Hashing algorithm
+        * @return                                              TRUE, FALSE if not both DH public values and
+        *                                                                                                                       nonces are set
+        */
+       bool (*calculate_secret) (pts_t *this, chunk_t initiator_nonce,
+                                               chunk_t responder_nonce, pts_meas_algorithms_t algorithm);
+
+       /**
+        * Returns secret assessment value to be used for TPM Quote as an external data
+        *
+        * @return                      Secret assessment value
+        */
+       chunk_t (*get_secret) (pts_t *this);
+
        /**
         * Get Platform and OS Info
         *