diff options
author | Martin Willi <martin@strongswan.org> | 2009-08-24 16:06:59 +0200 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2009-08-26 11:23:53 +0200 |
commit | 8eefe4617faa3aed4badf861ebc8d62479b18e4b (patch) | |
tree | 303276ad115514bd56fc51866e155f3d8c229c28 /src | |
parent | 87d20263419e5f9c85b42b17c46e5280218d2049 (diff) | |
download | strongswan-8eefe4617faa3aed4badf861ebc8d62479b18e4b.tar.bz2 strongswan-8eefe4617faa3aed4badf861ebc8d62479b18e4b.tar.xz |
use only KEY_ID_PUBKEY_SHA1 fingerprint charon internally
Diffstat (limited to 'src')
-rw-r--r-- | src/charon/credentials/credential_manager.c | 2 | ||||
-rw-r--r-- | src/charon/plugins/stroke/stroke_cred.c | 26 |
2 files changed, 10 insertions, 18 deletions
diff --git a/src/charon/credentials/credential_manager.c b/src/charon/credentials/credential_manager.c index 405424c16..78b0922ec 100644 --- a/src/charon/credentials/credential_manager.c +++ b/src/charon/credentials/credential_manager.c @@ -1432,7 +1432,7 @@ static private_key_t *get_private_by_cert(private_credential_manager_t *this, public = cert->get_public_key(cert); if (public) { - if (public->get_fingerprint(public, KEY_ID_PUBKEY_INFO_SHA1, &chunk)) + if (public->get_fingerprint(public, KEY_ID_PUBKEY_SHA1, &chunk)) { keyid = identification_create_from_encoding(ID_KEY_ID, chunk); private = get_private_by_keyid(this, type, keyid); diff --git a/src/charon/plugins/stroke/stroke_cred.c b/src/charon/plugins/stroke/stroke_cred.c index 1b309de22..f878180e9 100644 --- a/src/charon/plugins/stroke/stroke_cred.c +++ b/src/charon/plugins/stroke/stroke_cred.c @@ -105,7 +105,6 @@ static void id_data_destroy(id_data_t *data) static bool private_filter(id_data_t *data, private_key_t **in, private_key_t **out) { - key_encoding_type_t type; private_key_t *key; chunk_t keyid; @@ -115,14 +114,11 @@ static bool private_filter(id_data_t *data, *out = key; return TRUE; } - for (type = KEY_ID_PUBKEY_INFO_SHA1; type < KEY_ID_PUBKEY_SHA1; type++) + if (key->get_fingerprint(key, KEY_ID_PUBKEY_SHA1, &keyid) && + chunk_equals(keyid, data->id->get_encoding(data->id))) { - if (key->get_fingerprint(key, type, &keyid) && - chunk_equals(keyid, data->id->get_encoding(data->id))) - { - *out = key; - return TRUE; - } + *out = key; + return TRUE; } return FALSE; } @@ -150,7 +146,6 @@ static enumerator_t* create_private_enumerator(private_stroke_cred_t *this, */ static bool certs_filter(id_data_t *data, certificate_t **in, certificate_t **out) { - key_encoding_type_t type; public_key_t *public; certificate_t *cert = *in; chunk_t keyid; @@ -169,15 +164,12 @@ static bool certs_filter(id_data_t *data, certificate_t **in, certificate_t **ou public = cert->get_public_key(cert); if (public) { - for (type = KEY_ID_PUBKEY_INFO_SHA1; type < KEY_ID_PUBKEY_SHA1; type++) + if (public->get_fingerprint(public, KEY_ID_PUBKEY_SHA1, &keyid) && + chunk_equals(keyid, data->id->get_encoding(data->id))) { - if (public->get_fingerprint(public, type, &keyid) && - chunk_equals(keyid, data->id->get_encoding(data->id))) - { - public->destroy(public); - *out = *in; - return TRUE; - } + public->destroy(public); + *out = *in; + return TRUE; } public->destroy(public); } |