aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2009-08-24 16:57:09 +0200
committerMartin Willi <martin@strongswan.org>2009-08-26 11:23:53 +0200
commit1cd0d7969ab8a1b4bfff70d4b4deeaa514995a76 (patch)
tree4005782b723d515c7eee2d8939b1a9c433985074 /src
parent8eefe4617faa3aed4badf861ebc8d62479b18e4b (diff)
downloadstrongswan-1cd0d7969ab8a1b4bfff70d4b4deeaa514995a76.tar.bz2
strongswan-1cd0d7969ab8a1b4bfff70d4b4deeaa514995a76.tar.xz
updated load-tester plugin to new fingerprinting API
Diffstat (limited to 'src')
-rw-r--r--src/charon/plugins/load_tester/load_tester_creds.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/charon/plugins/load_tester/load_tester_creds.c b/src/charon/plugins/load_tester/load_tester_creds.c
index fdb5fa370..b32380d30 100644
--- a/src/charon/plugins/load_tester/load_tester_creds.c
+++ b/src/charon/plugins/load_tester/load_tester_creds.c
@@ -195,10 +195,11 @@ static enumerator_t* create_private_enumerator(private_load_tester_creds_t *this
}
if (id)
{
- identification_t *keyid;
+ chunk_t keyid;
- keyid = this->private->get_id(this->private, id->get_type(id));
- if (!keyid || !keyid->equals(keyid, id))
+ if (!this->private->get_fingerprint(this->private,
+ KEY_ID_PUBKEY_SHA1, &keyid) ||
+ !chunk_equals(keyid, id->get_encoding(id)))
{
return NULL;
}
@@ -217,7 +218,7 @@ static enumerator_t* create_cert_enumerator(private_load_tester_creds_t *this,
public_key_t *peer_key, *ca_key;
u_int32_t serial;
time_t now;
- identification_t *keyid = NULL;
+ chunk_t keyid;
if (this->ca == NULL)
{
@@ -231,18 +232,25 @@ static enumerator_t* create_cert_enumerator(private_load_tester_creds_t *this,
{
return NULL;
}
+ if (!id)
+ {
+ return enumerator_create_single(this->ca, NULL);
+ }
ca_key = this->ca->get_public_key(this->ca);
- if (ca_key && id)
+ if (ca_key)
{
- keyid = ca_key->get_id(ca_key, id->get_type(id));
+ if (ca_key->get_fingerprint(ca_key, KEY_ID_PUBKEY_SHA1, &keyid) &&
+ chunk_equals(keyid, id->get_encoding(id)))
+ {
+ ca_key->destroy(ca_key);
+ return enumerator_create_single(this->ca, NULL);
+ }
+ ca_key->destroy(ca_key);
}
- if (!id || this->ca->has_subject(this->ca, id) ||
- (keyid && id->equals(id, keyid)))
- { /* ca certificate */
- DESTROY_IF(ca_key);
+ if (this->ca->has_subject(this->ca, id))
+ {
return enumerator_create_single(this->ca, NULL);
}
- DESTROY_IF(ca_key);
if (!trusted)
{
/* peer certificate, generate on demand */