keychain: be less verbose when loading certificates
authorMartin Willi <martin@revosec.ch>
Wed, 31 Jul 2013 09:36:55 +0000 (11:36 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 31 Jul 2013 09:41:16 +0000 (11:41 +0200)
src/libstrongswan/plugins/keychain/keychain_creds.c

index ddcc7a4..d60f286 100644 (file)
@@ -69,10 +69,11 @@ static mem_cred_t* load_certs(private_keychain_creds_t *this, char *path)
        SecKeychainItemRef item;
        mem_cred_t *set;
        OSStatus status;
+       int loaded = 0;
 
        set = mem_cred_create();
 
-       DBG1(DBG_CFG, "loading certificates from %s:", path);
+       DBG2(DBG_CFG, "loading certificates from %s:", path);
        status = SecKeychainOpen(path, &keychain);
        if (status == errSecSuccess)
        {
@@ -95,8 +96,9 @@ static mem_cred_t* load_certs(private_keychain_creds_t *this, char *path)
                                                                BUILD_END);
                                        if (cert)
                                        {
-                                               DBG1(DBG_CFG, "  loaded '%Y'", cert->get_subject(cert));
+                                               DBG2(DBG_CFG, "  loaded '%Y'", cert->get_subject(cert));
                                                set->add_cert(set, TRUE, cert);
+                                               loaded++;
                                        }
                                        SecKeychainItemFreeAttributesAndData(NULL, data);
                                }
@@ -106,6 +108,7 @@ static mem_cred_t* load_certs(private_keychain_creds_t *this, char *path)
                }
                CFRelease(keychain);
        }
+       DBG1(DBG_CFG, "loaded %d certificates from %s", loaded, path);
        return set;
 }