credmgr: stop querying for secrets once we get a perfect match
authorMartin Willi <martin@revosec.ch>
Thu, 2 May 2013 08:07:36 +0000 (10:07 +0200)
committerMartin Willi <martin@revosec.ch>
Thu, 18 Jul 2013 10:17:54 +0000 (12:17 +0200)
src/libstrongswan/credentials/credential_manager.c

index 35d9845..fa25555 100644 (file)
@@ -393,6 +393,10 @@ METHOD(credential_manager_t, get_shared, shared_key_t*,
                        best_me = match_me;
                        best_other = match_other;
                }
+               if (best_me == ID_MATCH_PERFECT && best_other == ID_MATCH_PERFECT)
+               {
+                       break;
+               }
        }
        enumerator->destroy(enumerator);
        return found;