You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2007/05/02 11:09:26 UTC

svn commit: r534363 - in /harmony/enhanced/classlib/trunk: THIRD_PARTY_NOTICES.txt depends/jars/ make/depends.properties modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/AlgorithmParameterGenerator_ImplTest.java

Author: tellison
Date: Wed May  2 02:09:25 2007
New Revision: 534363

URL: http://svn.apache.org/viewvc?view=rev&rev=534363
Log:
Update dependencies to BouncyCastle 1.36
Fix AlgorithmParameterGenerator test.

Modified:
    harmony/enhanced/classlib/trunk/THIRD_PARTY_NOTICES.txt
    harmony/enhanced/classlib/trunk/depends/jars/   (props changed)
    harmony/enhanced/classlib/trunk/make/depends.properties
    harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/AlgorithmParameterGenerator_ImplTest.java

Modified: harmony/enhanced/classlib/trunk/THIRD_PARTY_NOTICES.txt
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/THIRD_PARTY_NOTICES.txt?view=diff&rev=534363&r1=534362&r2=534363
==============================================================================
--- harmony/enhanced/classlib/trunk/THIRD_PARTY_NOTICES.txt (original)
+++ harmony/enhanced/classlib/trunk/THIRD_PARTY_NOTICES.txt Wed May  2 02:09:25 2007
@@ -210,7 +210,7 @@
 
 
 
-License Notice for Bouncy Castle version 133
+License Notice for Bouncy Castle version 1.36
 ============================================
 
 Copyright (c) 2000 - 2006 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)

Propchange: harmony/enhanced/classlib/trunk/depends/jars/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed May  2 02:09:25 2007
@@ -21,3 +21,4 @@
 yoko_M2-20061115
 yoko_M2-20070130
 xerces_2.9.0
+bcprov-jdk15-136

Modified: harmony/enhanced/classlib/trunk/make/depends.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/make/depends.properties?view=diff&rev=534363&r1=534362&r2=534363
==============================================================================
--- harmony/enhanced/classlib/trunk/make/depends.properties (original)
+++ harmony/enhanced/classlib/trunk/make/depends.properties Wed May  2 02:09:25 2007
@@ -33,10 +33,10 @@
 junit.url=${mirror.base}/junit/junit/3.8.2/junit-3.8.2.jar
 junit.md5=28e7eb9eeefe31a657c68755bfccc541
 
-bcprov.dir=${depends.jars}/bcprov-jdk15-134
+bcprov.dir=${depends.jars}/bcprov-jdk15-136
 bcprov.jar=${bcprov.dir}/bcprov.jar
-bcprov.md5=6141379cf543ba9b24536d281181c6f3
-bcprov.url=http://www.bouncycastle.org/download/bcprov-jdk15-134.jar
+bcprov.url=http://www.bouncycastle.org/download/bcprov-jdk15-136.jar
+bcprov.md5=30c42e406de583a09cbf7124f7dae5ed
 
 msvcr.dir.x86=${depends.dir}/libs/windows.x86
 msvcr.dll.x86=${msvcr.dir.x86}/msvcr71.dll

Modified: harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/AlgorithmParameterGenerator_ImplTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/AlgorithmParameterGenerator_ImplTest.java?view=diff&rev=534363&r1=534362&r2=534363
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/AlgorithmParameterGenerator_ImplTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/AlgorithmParameterGenerator_ImplTest.java Wed May  2 02:09:25 2007
@@ -23,6 +23,7 @@
 package org.apache.harmony.security.tests.java.security;
 
 import java.security.AlgorithmParameterGenerator;
+import java.security.InvalidParameterException;
 import java.security.Provider;
 import java.security.SecureRandom;
 
@@ -33,9 +34,7 @@
 /**
  * Tests for <code>AlgorithmParameterGenerator</code> class constructors and
  * methods.
- * 
  */
-
 public class AlgorithmParameterGenerator_ImplTest extends TestCase {
 
     private static String validAlgName = "DSA";
@@ -81,6 +80,7 @@
             fail(validAlgName + " algorithm is not supported");
             return;
         }
+        // Invalid key strengths (strength must be from 512 - 1024 and a multiple of 64)
         int [] keys = {-10000, -512, -1, 0, 10000};
         SecureRandom random = new SecureRandom();
         AlgorithmParameterGenerator[] apgs = createAPGen();
@@ -88,11 +88,37 @@
                 apgs);
 
         for (int i = 0; i < apgs.length; i++) {
+            
+            // Test invalid strengths
             for (int j = 0; j < keys.length; j++) {
-                apgs[i].init(keys[j]);
-                apgs[i].init(keys[j], random);
-                apgs[i].init(keys[j], null);
+                try {
+                    apgs[i].init(keys[j]);
+                    fail("Expected an invalid parameter exception for strength "
+                            + keys[j]);
+                } catch (InvalidParameterException e) {
+                    // expected
+                }
+                try {
+                    apgs[i].init(keys[j], random);
+                    fail("Expected an invalid parameter exception for strength "
+                            + keys[j]);
+                } catch (InvalidParameterException e) {
+                    // expected
+                }
+                try {
+                    apgs[i].init(keys[j], null);
+                    fail("Expected an invalid parameter exception for strength "
+                            + keys[j]);
+                } catch (InvalidParameterException e) {
+                    // expected
+                }
             }
+            
+            // Test valid strengths
+            apgs[i].init(512);
+            apgs[i].init(512, random);
+            apgs[i].init(512 + 64);
+            apgs[i].init(512 + 64 + 64, random);
             apgs[i].init(1024);
             apgs[i].init(1024, random);
         }