abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r555396 - in /incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet: AbstractEncryptedRequestFilter.java AbstractEncryptedResponseFilter.java BCEncryptedRequestFilter.java DHEncryptedRequestFilter.java
Date Wed, 11 Jul 2007 20:59:40 GMT
Author: jmsnell
Date: Wed Jul 11 13:59:39 2007
New Revision: 555396

URL: http://svn.apache.org/viewvc?view=rev&rev=555396
Log:
Fixes to the updated encryption filters so that they'll actually work

Added:
    incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/BCEncryptedRequestFilter.java
Modified:
    incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/AbstractEncryptedRequestFilter.java
    incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/AbstractEncryptedResponseFilter.java
    incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/DHEncryptedRequestFilter.java

Modified: incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/AbstractEncryptedRequestFilter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/AbstractEncryptedRequestFilter.java?view=diff&rev=555396&r1=555395&r2=555396
==============================================================================
--- incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/AbstractEncryptedRequestFilter.java
(original)
+++ incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/AbstractEncryptedRequestFilter.java
Wed Jul 11 13:59:39 2007
@@ -20,6 +20,8 @@
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
+import java.security.Provider;
+import java.security.Security;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -50,9 +52,17 @@
     for (String method: methods) this.methods.add(method);
   }
 
+  protected void initProvider() {}
+    
+  protected void addProvider(Provider provider) {
+    if (Security.getProvider(provider.getName()) == null) 
+      Security.addProvider(provider);
+  }
+  
   @Override
   public void init(FilterConfig config) throws ServletException {
     super.init(config);
+    initProvider();
     String s = config.getInitParameter("methods");
     if (s != null && s.length() > 0) {
       this.methods.clear();

Modified: incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/AbstractEncryptedResponseFilter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/AbstractEncryptedResponseFilter.java?view=diff&rev=555396&r1=555395&r2=555396
==============================================================================
--- incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/AbstractEncryptedResponseFilter.java
(original)
+++ incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/AbstractEncryptedResponseFilter.java
Wed Jul 11 13:59:39 2007
@@ -39,6 +39,7 @@
   public void init(
     FilterConfig config) 
       throws ServletException {
+    super.init(config);
     initProvider();
   }
   

Added: incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/BCEncryptedRequestFilter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/BCEncryptedRequestFilter.java?view=auto&rev=555396
==============================================================================
--- incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/BCEncryptedRequestFilter.java
(added)
+++ incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/BCEncryptedRequestFilter.java
Wed Jul 11 13:59:39 2007
@@ -0,0 +1,32 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  The ASF licenses this file to You
+* under the Apache License, Version 2.0 (the "License"); you may not
+* use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.  For additional information regarding
+* copyright in this work, please see the NOTICE file in the top level
+* directory of this distribution.
+*/
+package org.apache.abdera.security.util.servlet;
+
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+
+public abstract class BCEncryptedRequestFilter 
+  extends AbstractEncryptedRequestFilter {
+
+  public void initProvider() {
+    try {
+      Class.forName("org.bouncycastle.LICENSE");
+    } catch (Exception e) {}
+    addProvider(new BouncyCastleProvider());
+  }
+
+}

Modified: incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/DHEncryptedRequestFilter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/DHEncryptedRequestFilter.java?view=diff&rev=555396&r1=555395&r2=555396
==============================================================================
--- incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/DHEncryptedRequestFilter.java
(original)
+++ incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/util/servlet/DHEncryptedRequestFilter.java
Wed Jul 11 13:59:39 2007
@@ -37,7 +37,7 @@
  * Note: this is currently untested.
  */
 public class DHEncryptedRequestFilter 
-  extends AbstractEncryptedRequestFilter {
+  extends BCEncryptedRequestFilter {
 
   private DHContext context;
   
@@ -72,7 +72,9 @@
       try {
         context = (DHContext) this.context.clone();
         context.setPublicKey(dh);
-      } catch (Exception e) {}
+      } catch (Exception e) {
+        e.printStackTrace();
+      }
     }
     return context;
   }



Mime
View raw message