aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSansar Choinyambuu <schoinya@hsr.ch>2011-09-23 16:06:29 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2011-11-28 16:05:19 +0100
commitbe922d56b22dbc2fd172b6070d8c93c761ed61f1 (patch)
treec4db9a151451972e0f01e7a92793ab83bcc410f8 /src
parente3cbd18892cd2a2b8e8e156700f499738cc68ac3 (diff)
downloadstrongswan-be922d56b22dbc2fd172b6070d8c93c761ed61f1.tar.bz2
strongswan-be922d56b22dbc2fd172b6070d8c93c761ed61f1.tar.xz
Implemented handling of DH Parameters Response and Finish attributes
Implemented calculating session secrets
Diffstat (limited to 'src')
-rw-r--r--src/libimcv/plugins/imc_attestation/imc_attestation.c6
-rw-r--r--src/libimcv/plugins/imv_attestation/imv_attestation.c12
-rw-r--r--src/libpts/pts/pts.h40
3 files changed, 58 insertions, 0 deletions
diff --git a/src/libimcv/plugins/imc_attestation/imc_attestation.c b/src/libimcv/plugins/imc_attestation/imc_attestation.c
index 99fbdc1cf..101f59250 100644
--- a/src/libimcv/plugins/imc_attestation/imc_attestation.c
+++ b/src/libimcv/plugins/imc_attestation/imc_attestation.c
@@ -68,6 +68,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
*/
TNC_Result TNC_IMC_Initialize(TNC_IMCID imc_id,
diff --git a/src/libimcv/plugins/imv_attestation/imv_attestation.c b/src/libimcv/plugins/imv_attestation/imv_attestation.c
index 87832a730..9f9131b3a 100644
--- a/src/libimcv/plugins/imv_attestation/imv_attestation.c
+++ b/src/libimcv/plugins/imv_attestation/imv_attestation.c
@@ -63,6 +63,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
*/
static pts_database_t *pts_db;
@@ -78,6 +84,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
*/
TNC_Result TNC_IMV_Initialize(TNC_IMVID imv_id,
@@ -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();
diff --git a/src/libpts/pts/pts.h b/src/libpts/pts/pts.h
index a4d6eda20..864e92d53 100644
--- a/src/libpts/pts/pts.h
+++ b/src/libpts/pts/pts.h
@@ -176,6 +176,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
*
* @return Platform and OS info