streamlined file loading labels
authorAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 26 Aug 2009 20:02:00 +0000 (22:02 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 26 Aug 2009 20:02:00 +0000 (22:02 +0200)
src/pluto/ac.c
src/pluto/certs.c
src/pluto/crl.c
src/pluto/plutomain.c
testing/tests/ikev1/crl-from-cache/evaltest.dat
testing/tests/ikev1/crl-ldap/evaltest.dat

index ac95364..0c36e59 100644 (file)
@@ -820,13 +820,15 @@ void load_acerts(void)
                {
                        while (n--)
                        {
+                               char *filename = filelist[n]->d_name;
                                x509acert_t *ac;
                                
                                ac = lib->creds->create(lib->creds, CRED_CERTIFICATE,
-                                                       CERT_PLUTO_AC, BUILD_FROM_FILE, filelist[n]->d_name,
+                                                       CERT_PLUTO_AC, BUILD_FROM_FILE, filename,
                                                        BUILD_END);
                                if (ac)
                                {
+                                       plog("  loaded attribute certificate from '%s'", filename);
                                        add_acert(ac);
                                }
                                free(filelist[n]);
index 7bdeb07..129b58c 100644 (file)
@@ -144,7 +144,7 @@ private_key_t* load_private_key(char* filename, prompt_pass_t *pass,
        }
        if (key)
        {
-               plog("  loaded private key from file '%s'", filename);
+               plog("  loaded private key from '%s'", filename);
        }
        else
        {
@@ -165,7 +165,7 @@ bool load_cert(char *filename, const char *label, cert_t *out)
        if (cert)
        {
                /* the API passes an empty cert_t, we move over and free the built one */
-               plog(" loaded '%s' certificate from '%s'", label, filename);
+               plog("  loaded %s certificate from '%s'", label, filename);
                *out = *cert;
                free(cert);
                return TRUE;
@@ -180,7 +180,7 @@ bool load_host_cert(char *filename, cert_t *cert)
 {
        char *path = concatenate_paths(HOST_CERT_PATH, filename);
 
-       return load_cert(path, "host cert", cert);
+       return load_cert(path, "host", cert);
 }
 
 /**
@@ -190,7 +190,7 @@ bool load_ca_cert(char *filename, cert_t *cert)
 {
        char *path = concatenate_paths(CA_CERT_PATH, filename);
 
-       return load_cert(path, "CA cert", cert);
+       return load_cert(path, "CA", cert);
 }
 
 /**
index 40c5d47..549d0a7 100644 (file)
@@ -350,6 +350,7 @@ void load_crls(void)
                                {
                                        chunk_t crl_uri;
 
+                                       plog("  loaded crl from '%s'", filename);
                                        crl_uri.len = 7 + sizeof(CRL_PATH) + strlen(filename);
                                        crl_uri.ptr = malloc(crl_uri.len + 1);
 
index a22b370..b3d75e8 100644 (file)
@@ -717,11 +717,11 @@ int main(int argc, char **argv)
 #endif /* CAPABILITIES */
 
        /* loading X.509 CA certificates */
-       load_authcerts("CA cert", CA_CERT_PATH, AUTH_CA);
+       load_authcerts("CA", CA_CERT_PATH, AUTH_CA);
        /* loading X.509 AA certificates */
-       load_authcerts("AA cert", AA_CERT_PATH, AUTH_AA);
+       load_authcerts("AA", AA_CERT_PATH, AUTH_AA);
        /* loading X.509 OCSP certificates */
-       load_authcerts("OCSP cert", OCSP_CERT_PATH, AUTH_OCSP);
+       load_authcerts("OCSP", OCSP_CERT_PATH, AUTH_OCSP);
        /* loading X.509 CRLs */
        load_crls();
        /* loading attribute certificates (experimental) */
index dd200c8..bdceddb 100644 (file)
@@ -1,5 +1,5 @@
-moon::cat /var/log/auth.log::loaded crl file::YES
-carol::cat /var/log/auth.log::loaded crl file::YES
+moon::cat /var/log/auth.log::loaded crl from::YES
+carol::cat /var/log/auth.log::loaded crl from::YES
 moon::cat /var/log/auth.log::X.509 certificate rejected::NO
 carol::cat /var/log/auth.log::X.509 certificate rejected::NO
 moon::ipsec status::rw.*STATE_QUICK_R2.*IPsec SA established::YES
index 730614c..039cec3 100644 (file)
@@ -1,5 +1,5 @@
-moon::cat /var/log/auth.log::loaded crl file::YES
-carol::cat /var/log/auth.log::loaded crl file::YES
+moon::cat /var/log/auth.log::loaded crl from::YES
+carol::cat /var/log/auth.log::loaded crl from::YES
 moon::cat /var/log/auth.log::crl update is overdue::YES
 carol::cat /var/log/auth.log::crl update is overdue::YES
 moon::cat /var/log/auth.log::X.509 certificate rejected::YES