]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
crypto-factory: Stop after successfully creating one nonce generator
authorTobias Brunner <tobias@strongswan.org>
Tue, 17 May 2016 18:05:06 +0000 (20:05 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 17 Jun 2016 16:48:02 +0000 (18:48 +0200)
Fixes: e2fc09c186c3 ("Add nonce generator interface")
src/libstrongswan/crypto/crypto_factory.c

index b0b86372ce80b57d0ce53345a06e18d69b2ef0d0..35dcf25ac99fc5b2170d84d2fb79785519457d4c 100644 (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);