aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/config/credentials/local_credential_store.c
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2007-08-10 12:10:36 +0000
committerAndreas Steffen <andreas.steffen@strongswan.org>2007-08-10 12:10:36 +0000
commit8f687a7591b1d52a2516fd14de0c79022a772d7d (patch)
tree06ff375a0709cc5f86111280f0f7cb11077aa0b5 /src/charon/config/credentials/local_credential_store.c
parentc045d90a8ee0b59bb41da684f15c86dbc51f3a2d (diff)
downloadstrongswan-8f687a7591b1d52a2516fd14de0c79022a772d7d.tar.bz2
strongswan-8f687a7591b1d52a2516fd14de0c79022a772d7d.tar.xz
has_rsa_private_key() must also be protected by keys_mutex
Diffstat (limited to 'src/charon/config/credentials/local_credential_store.c')
-rw-r--r--src/charon/config/credentials/local_credential_store.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/charon/config/credentials/local_credential_store.c b/src/charon/config/credentials/local_credential_store.c
index 6400cfff6..60a01778f 100644
--- a/src/charon/config/credentials/local_credential_store.c
+++ b/src/charon/config/credentials/local_credential_store.c
@@ -382,8 +382,10 @@ static bool has_rsa_private_key(private_local_credential_store_t *this, rsa_publ
{
bool found = FALSE;
rsa_private_key_t *current;
+ iterator_t *iterator;
- iterator_t *iterator = this->private_keys->create_iterator(this->private_keys, TRUE);
+ pthread_mutex_lock(&(this->keys_mutex));
+ iterator = this->private_keys->create_iterator(this->private_keys, TRUE);
while (iterator->iterate(iterator, (void**)&current))
{
@@ -394,6 +396,7 @@ static bool has_rsa_private_key(private_local_credential_store_t *this, rsa_publ
}
}
iterator->destroy(iterator);
+ pthread_mutex_unlock(&(this->keys_mutex));
return found;
}