crypto-factory: Stop after successfully creating one nonce generator

Fixes: e2fc09c186 ("Add nonce generator interface")
This commit is contained in:
Tobias Brunner 2016-05-17 20:05:06 +02:00
parent c1289eb578
commit 990c62cdcc
1 changed files with 4 additions and 0 deletions

View File

@ -347,6 +347,10 @@ METHOD(crypto_factory_t, create_nonce_gen, nonce_gen_t*,
while (enumerator->enumerate(enumerator, &entry))
{
nonce_gen = entry->create_nonce_gen();
if (nonce_gen)
{
break;
}
}
enumerator->destroy(enumerator);
this->lock->unlock(this->lock);