felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject svn commit: r1365531 - in /felix/trunk/framework.security/src/main/java/org/apache/felix/framework: SecurityActivator.java SecurityProviderImpl.java security/verifier/BundleDNParser.java
Date Wed, 25 Jul 2012 11:41:46 GMT
Author: pauls
Date: Wed Jul 25 11:41:45 2012
New Revision: 1365531

URL: http://svn.apache.org/viewvc?rev=1365531&view=rev
Log:
Log a warning if a certifcate is invalid (FELIX-3604).

Modified:
    felix/trunk/framework.security/src/main/java/org/apache/felix/framework/SecurityActivator.java
    felix/trunk/framework.security/src/main/java/org/apache/felix/framework/SecurityProviderImpl.java
    felix/trunk/framework.security/src/main/java/org/apache/felix/framework/security/verifier/BundleDNParser.java

Modified: felix/trunk/framework.security/src/main/java/org/apache/felix/framework/SecurityActivator.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework.security/src/main/java/org/apache/felix/framework/SecurityActivator.java?rev=1365531&r1=1365530&r2=1365531&view=diff
==============================================================================
--- felix/trunk/framework.security/src/main/java/org/apache/felix/framework/SecurityActivator.java
(original)
+++ felix/trunk/framework.security/src/main/java/org/apache/felix/framework/SecurityActivator.java
Wed Jul 25 11:41:45 2012
@@ -202,7 +202,7 @@ public final class SecurityActivator imp
             }
 
             SecurityProvider provider = new SecurityProviderImpl(crlList,
-                typeList, passwdList, storeList, pai, cpai, action);
+                typeList, passwdList, storeList, pai, cpai, action, ((Felix) context.getBundle(0)).getLogger());
 
             ((Felix) context.getBundle(0)).setSecurityProvider(provider);
         }

Modified: felix/trunk/framework.security/src/main/java/org/apache/felix/framework/SecurityProviderImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework.security/src/main/java/org/apache/felix/framework/SecurityProviderImpl.java?rev=1365531&r1=1365530&r2=1365531&view=diff
==============================================================================
--- felix/trunk/framework.security/src/main/java/org/apache/felix/framework/SecurityProviderImpl.java
(original)
+++ felix/trunk/framework.security/src/main/java/org/apache/felix/framework/SecurityProviderImpl.java
Wed Jul 25 11:41:45 2012
@@ -21,6 +21,7 @@ package org.apache.felix.framework;
 import java.security.Permission;
 import java.security.ProtectionDomain;
 
+import org.apache.felix.framework.Logger;
 import org.apache.felix.framework.ext.SecurityProvider;
 import org.apache.felix.framework.security.condpermadmin.ConditionalPermissionAdminImpl;
 import org.apache.felix.framework.security.permissionadmin.PermissionAdminImpl;
@@ -44,13 +45,13 @@ public final class SecurityProviderImpl 
 
     SecurityProviderImpl(String crlList, String typeList, String passwdList,
         String storeList, PermissionAdminImpl pai,
-        ConditionalPermissionAdminImpl cpai, SecureAction action)
+        ConditionalPermissionAdminImpl cpai, SecureAction action, Logger logger)
     {
         m_pai = pai;
         m_cpai = cpai;
         m_action = action;
         m_parser = new BundleDNParser(new TrustManager(crlList, typeList,
-            passwdList, storeList, m_action));
+            passwdList, storeList, m_action), logger);
     }
 
     /**

Modified: felix/trunk/framework.security/src/main/java/org/apache/felix/framework/security/verifier/BundleDNParser.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework.security/src/main/java/org/apache/felix/framework/security/verifier/BundleDNParser.java?rev=1365531&r1=1365530&r2=1365531&view=diff
==============================================================================
--- felix/trunk/framework.security/src/main/java/org/apache/felix/framework/security/verifier/BundleDNParser.java
(original)
+++ felix/trunk/framework.security/src/main/java/org/apache/felix/framework/security/verifier/BundleDNParser.java
Wed Jul 25 11:41:45 2012
@@ -35,6 +35,7 @@ import java.util.jar.JarEntry;
 import java.util.jar.JarInputStream;
 
 import org.apache.felix.framework.BundleRevisionImpl;
+import org.apache.felix.framework.Logger;
 import org.apache.felix.framework.security.util.BundleInputStream;
 import org.apache.felix.framework.security.util.TrustManager;
 /*
@@ -78,14 +79,16 @@ public final class BundleDNParser
         m_getCertificates = getCertificates;
     }
 
+    private final Logger m_logger;
     private final Map m_cache = new WeakHashMap();
     private final Map m_allCache = new WeakHashMap();
 
     private final TrustManager m_manager;
 
-    public BundleDNParser(TrustManager manager)
+    public BundleDNParser(TrustManager manager, Logger logger)
     {
         m_manager = manager;
+        m_logger = logger;
     }
 
     public Map getCache()
@@ -442,7 +445,7 @@ public final class BundleDNParser
                 }
                 catch (CertificateException ex)
                 {
-                    // TODO: log this or something
+                    m_logger.log(Logger.LOG_WARNING, "Invalid Certificate", ex);
                     revoked = true;
                 }
             }
@@ -508,7 +511,7 @@ public final class BundleDNParser
                     catch (CertificateException ex)
                     {
                         // Not much we can do
-                        // TODO: log this or something
+                        m_logger.log(Logger.LOG_WARNING, "Invalid Certificate", ex);
                     }
                 }
             }
@@ -535,7 +538,7 @@ public final class BundleDNParser
                 }
                 catch (Exception ex)
                 {
-                    // TODO: log this or something
+                    m_logger.log(Logger.LOG_WARNING, "Invalid Certificate", ex);
                 }
             }
         }



Mime
View raw message