aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSansar Choinyambuu <schoinya@hsr.ch>2011-11-02 08:05:28 +0100
committerAndreas Steffen <andreas.steffen@strongswan.org>2011-11-28 14:39:53 +0100
commit71741df078900412637a0f077a21cc63b62ba740 (patch)
tree6ef7ac8577dd48886d71a87a7d7d8f787feb680d
parent2b28a13182f5be4356881f973d02db0edd20b99c (diff)
downloadstrongswan-71741df078900412637a0f077a21cc63b62ba740.tar.bz2
strongswan-71741df078900412637a0f077a21cc63b62ba740.tar.xz
Changed the static function name in openssl_rsa_public_key object
Removed unused chunk variable from PTS verify_quote_signature function
-rw-r--r--src/libcharon/plugins/tnc_imc/tnc_imc.c2
-rw-r--r--src/libcharon/plugins/tnc_imv/tnc_imv.c2
-rw-r--r--src/libpts/pts/pts.c35
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_rsa_public_key.c5
4 files changed, 21 insertions, 23 deletions
diff --git a/src/libcharon/plugins/tnc_imc/tnc_imc.c b/src/libcharon/plugins/tnc_imc/tnc_imc.c
index 52e526604..cf2f09a3c 100644
--- a/src/libcharon/plugins/tnc_imc/tnc_imc.c
+++ b/src/libcharon/plugins/tnc_imc/tnc_imc.c
@@ -161,7 +161,7 @@ METHOD(imc_t, type_supported, bool,
METHOD(imc_t, destroy, void,
private_tnc_imc_t *this)
{
- dlclose(this->handle);
+ //dlclose(this->handle);
this->mutex->destroy(this->mutex);
free(this->supported_types);
free(this->name);
diff --git a/src/libcharon/plugins/tnc_imv/tnc_imv.c b/src/libcharon/plugins/tnc_imv/tnc_imv.c
index f9cfc3417..ea15179db 100644
--- a/src/libcharon/plugins/tnc_imv/tnc_imv.c
+++ b/src/libcharon/plugins/tnc_imv/tnc_imv.c
@@ -162,7 +162,7 @@ METHOD(imv_t, type_supported, bool,
METHOD(imv_t, destroy, void,
private_tnc_imv_t *this)
{
- dlclose(this->handle);
+ //dlclose(this->handle);
this->mutex->destroy(this->mutex);
free(this->supported_types);
free(this->name);
diff --git a/src/libpts/pts/pts.c b/src/libpts/pts/pts.c
index 3361c89c4..9f36a76d7 100644
--- a/src/libpts/pts/pts.c
+++ b/src/libpts/pts/pts.c
@@ -370,7 +370,7 @@ static void load_aik_blob(private_pts_t *this)
fclose(fp);
return;
}
-
+
DBG1(DBG_PTS, "AIK Blob is not available");
}
@@ -711,7 +711,7 @@ METHOD(pts_t, read_pcr, bool,
result);
return FALSE;
}
-
+
result = Tspi_Context_Connect(hContext, NULL);
if (result != TSS_SUCCESS)
{
@@ -728,7 +728,7 @@ METHOD(pts_t, read_pcr, bool,
{
goto err;
}
-
+
*output = pcr_value;
*output = chunk_clone(*output);
@@ -849,7 +849,7 @@ METHOD(pts_t, quote_tpm, bool,
{
goto err1;
}
-
+
result = Tspi_Context_LoadKeyByBlob (hContext, hSRK, this->aik_blob.len,
this->aik_blob.ptr, &hAIK);
if (result != TSS_SUCCESS)
@@ -884,7 +884,7 @@ METHOD(pts_t, quote_tpm, bool,
valData.ulExternalDataLength = this->secret.len;
valData.rgbExternalData = (BYTE *)this->secret.ptr;
-
+
/* TPM Quote */
result = Tspi_TPM_Quote(hTPM, hAIK, hPcrComposite, &valData);
if (result != TSS_SUCCESS)
@@ -898,7 +898,7 @@ METHOD(pts_t, quote_tpm, bool,
*pcr_composite = pcr_comp;
*pcr_composite = chunk_clone(*pcr_composite);
DBG3(DBG_PTS, "Hash of PCR Composite: %B",pcr_composite);
-
+
quote_sign = chunk_alloc(valData.ulValidationDataLength);
memcpy(quote_sign.ptr, valData.rgbValidationData,
valData.ulValidationDataLength);
@@ -923,7 +923,7 @@ METHOD(pts_t, quote_tpm, bool,
err2:
Tspi_Context_CloseObject(hContext, hAIK);
-
+
err1:
Tspi_Context_Close(hContext);
free(pcrs);
@@ -950,7 +950,7 @@ METHOD(pts_t, add_pcr_entry, void,
{
enumerator_t *e;
pcr_entry_t *entry;
-
+
if (!this->pcrs)
{
this->pcrs = linked_list_create();
@@ -969,7 +969,7 @@ METHOD(pts_t, add_pcr_entry, void,
}
}
DESTROY_IF(e);
-
+
this->pcrs->insert_last(this->pcrs, new);
qsort(this->pcrs, this->pcrs->get_count(this->pcrs),
@@ -1051,7 +1051,7 @@ METHOD(pts_t, get_quote_info, bool,
}
free(pcr_entry);
e->destroy(e);
-
+
/* PCR Composite structure */
pcr_composite = chunk_clone(writer->get_buf(writer));
writer->destroy(writer);
@@ -1073,7 +1073,7 @@ METHOD(pts_t, get_quote_info, bool,
if (composite_algo)
{
hash_algorithm_t algo;
-
+
algo = pts_meas_algo_to_hash(composite_algo);
hasher = lib->crypto->create_hasher(lib->crypto, algo);
@@ -1087,16 +1087,16 @@ METHOD(pts_t, get_quote_info, bool,
*out_pcr_composite = chunk_clone(pcr_composite);
DBG4(DBG_PTS, "calculated PCR Composite: %B", out_pcr_composite);
}
-
+
/* SHA1 hash of PCR Composite to construct TPM_QUOTE_INFO */
hasher = lib->crypto->create_hasher(lib->crypto, HASH_SHA1);
hasher->allocate_hash(hasher, pcr_composite, &hash_pcr_composite);
hasher->destroy(hasher);
-
+
writer->write_data(writer, hash_pcr_composite);
chunk_clear(&pcr_composite);
chunk_clear(&hash_pcr_composite);
-
+
if (!this->secret.ptr)
{
DBG1(DBG_PTS, "Secret assessment value unavailable",
@@ -1111,7 +1111,7 @@ METHOD(pts_t, get_quote_info, bool,
*out_quote_info = chunk_clone(writer->get_buf(writer));
DBG4(DBG_PTS, "Calculated TPM Quote Info: %B", out_quote_info);
writer->destroy(writer);
-
+
return TRUE;
}
@@ -1119,7 +1119,6 @@ METHOD(pts_t, verify_quote_signature, bool,
private_pts_t *this, chunk_t data, chunk_t signature)
{
public_key_t *aik_pub_key;
- chunk_t key_encoding;
aik_pub_key = this->aik->get_public_key(this->aik);
if (!aik_pub_key)
@@ -1134,7 +1133,7 @@ METHOD(pts_t, verify_quote_signature, bool,
DESTROY_IF(aik_pub_key);
return FALSE;
}
-
+
aik_pub_key->destroy(aik_pub_key);
return TRUE;
}
@@ -1294,7 +1293,7 @@ static bool has_tpm(private_pts_t *this)
goto err;
}
this->tpm_version_info = chunk_clone(this->tpm_version_info);
-
+
Tspi_Context_FreeMemory(hContext, NULL);
Tspi_Context_Close(hContext);
return TRUE;
diff --git a/src/libstrongswan/plugins/openssl/openssl_rsa_public_key.c b/src/libstrongswan/plugins/openssl/openssl_rsa_public_key.c
index 6c05b087a..00f131423 100644
--- a/src/libstrongswan/plugins/openssl/openssl_rsa_public_key.c
+++ b/src/libstrongswan/plugins/openssl/openssl_rsa_public_key.c
@@ -119,7 +119,7 @@ error:
/**
* Verification of an EMPSA PKCS1 signature described in PKCS#1
*/
-static bool verify_rsa_signature(private_openssl_rsa_public_key_t *this,
+static bool verify_signature(private_openssl_rsa_public_key_t *this,
int type, chunk_t data, chunk_t signature)
{
bool valid = FALSE;
@@ -187,7 +187,7 @@ METHOD(public_key_t, verify, bool,
switch (scheme)
{
case SIGN_RSA_SHA1:
- return verify_rsa_signature(this, NID_sha1, data, signature);
+ return verify_signature(this, NID_sha1, data, signature);
case SIGN_RSA_EMSA_PKCS1_NULL:
return verify_emsa_pkcs1_signature(this, NID_undef, data, signature);
case SIGN_RSA_EMSA_PKCS1_SHA1:
@@ -448,4 +448,3 @@ openssl_rsa_public_key_t *openssl_rsa_public_key_load(key_type_t type,
destroy(this);
return NULL;
}
-