harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r988333 - in /harmony/enhanced/java/branches/java6: ./ classlib/ classlib/depends/libs/ drlvm/ jdktools/ jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/keytool/ jdktools/modules/jretools/src/main/java/org/apache/harmony/jr...
Date Mon, 23 Aug 2010 22:00:53 GMT
Author: hindessm
Date: Mon Aug 23 22:00:52 2010
New Revision: 988333

URL: http://svn.apache.org/viewvc?rev=988333&view=rev
Log:
Merge change from /harmony/enhanced/java/trunk@988045:

  r988045 | odeakin | 2010-08-23 10:37:56 +0100 (Mon, 23 Aug 2010) | 1 line
  
  Commit slightly modified patch for HARMONY-6631 ([jdktools][keytool] All interactive input
is truncated by one character on linux).


Modified:
    harmony/enhanced/java/branches/java6/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/depends/libs/   (props changed)
    harmony/enhanced/java/branches/java6/drlvm/   (props changed)
    harmony/enhanced/java/branches/java6/jdktools/   (props changed)
    harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/keytool/ArgumentsParser.java
    harmony/enhanced/java/branches/java6/jdktools/modules/jretools/src/main/java/org/apache/harmony/jretools/keytool/ArgumentsParser.java
    harmony/enhanced/java/branches/java6/jdktools/modules/jretools/src/test/java/org/apache/harmony/jretools/tests/keytool/GenKeyTest.java

Propchange: harmony/enhanced/java/branches/java6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Aug 23 22:00:52 2010
@@ -1,4 +1,4 @@
 /harmony/enhanced/java/branches/mrh:935751-941490
-/harmony/enhanced/java/trunk:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597-984598,984613,984682,984708,984731,984779,984784,984798,985098,985141,986136,986141,986147,986150,986205,986223-986224,986228,986248,986356,986603,986626,987283,987285,987981
+/harmony/enhanced/java/trunk:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597-984598,984613,984682,984708,984731,984779,984784,984798,985098,985141,986136,986141,986147,986150,986205,986223-986224,986228,986248,986356,986603,986626,987283,987285,987981,988045
 /harmony/enhanced/trunk:476395-929252
 /incubator/harmony/enhanced/trunk:292550-476394

Propchange: harmony/enhanced/java/branches/java6/classlib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Aug 23 22:00:52 2010
@@ -1,7 +1,7 @@
 /harmony/enhanced/classlib/trunk:713674-735919,765923-926091,926318-926838
 /harmony/enhanced/classlib/trunk/working_classlib:884014-884286
 /harmony/enhanced/java/branches/mrh/classlib:935751-941490
-/harmony/enhanced/java/trunk/classlib:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597-984598,984613,984682,984708,984731,984779,984784,984798,985098,985141,986136,986141,986147,986150,986205,986223-986224,986228,986248,986356,986603,986626,987283,987285,987981
+/harmony/enhanced/java/trunk/classlib:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597-984598,984613,984682,984708,984731,984779,984784,984798,985098,985141,986136,986141,986147,986150,986205,986223-986224,986228,986248,986356,986603,986626,987283,987285,987981,988045
 /harmony/enhanced/trunk/classlib:476395-929252
 /harmony/enhanced/trunk/working_classlib:476396-920147
 /incubator/harmony/enhanced/trunk/classlib:292550-476394

Propchange: harmony/enhanced/java/branches/java6/classlib/depends/libs/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Aug 23 22:00:52 2010
@@ -1,4 +1,4 @@
 /harmony/enhanced/classlib/trunk/depends/libs:544451-926091
-/harmony/enhanced/java/trunk/classlib/depends/libs:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597-984598,984613,984682,984708,984731,984779,984784,984798,985098,985141,986136,986141,986147,986150,986205,986223-986224,986228,986248,986356,986603,986626,987283,987285,987981
+/harmony/enhanced/java/trunk/classlib/depends/libs:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597-984598,984613,984682,984708,984731,984779,984784,984798,985098,985141,986136,986141,986147,986150,986205,986223-986224,986228,986248,986356,986603,986626,987283,987285,987981,988045
 /harmony/enhanced/trunk/classlib/depends/libs:476395-929252
 /incubator/harmony/enhanced/trunk/classlib/depends/libs:292550-476394

Propchange: harmony/enhanced/java/branches/java6/drlvm/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Aug 23 22:00:52 2010
@@ -1,5 +1,5 @@
 /harmony/enhanced/java/branches/mrh/drlvm:935751-941490
-/harmony/enhanced/java/trunk/drlvm:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597-984598,984613,984682,984708,984731,984779,984784,984798,985098,985141,986136,986141,986147,986150,986205,986223-986224,986228,986248,986356,986603,986626,987283,987285,987981
+/harmony/enhanced/java/trunk/drlvm:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597-984598,984613,984682,984708,984731,984779,984784,984798,985098,985141,986136,986141,986147,986150,986205,986223-986224,986228,986248,986356,986603,986626,987283,987285,987981,988045
 /harmony/enhanced/trunk/drlvm:476395-929252
 /harmony/enhanced/trunk/working_vm:476396-920147
 /incubator/harmony/enhanced/trunk/drlvm:292550-476394

Propchange: harmony/enhanced/java/branches/java6/jdktools/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Aug 23 22:00:52 2010
@@ -1,4 +1,4 @@
-/harmony/enhanced/java/trunk/jdktools:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597-984598,984613,984682,984708,984731,984779,984784,984798,985098,985141,986136,986141,986147,986150,986205,986223-986224,986228,986248,986356,986603,986626,987283,987285,987981
+/harmony/enhanced/java/trunk/jdktools:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597-984598,984613,984682,984708,984731,984779,984784,984798,985098,985141,986136,986141,986147,986150,986205,986223-986224,986228,986248,986356,986603,986626,987283,987285,987981,988045
 /harmony/enhanced/jdktools/trunk:630107-925933
 /harmony/enhanced/trunk/jdktools:476395-929252
 /harmony/enhanced/trunk/working_jdktools:476396-920147

Modified: harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/keytool/ArgumentsParser.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/keytool/ArgumentsParser.java?rev=988333&r1=988332&r2=988333&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/keytool/ArgumentsParser.java
(original)
+++ harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/keytool/ArgumentsParser.java
Mon Aug 23 22:00:52 2010
@@ -49,9 +49,10 @@ class ArgumentsParser {
     // maximum number of attempts to set the password
     static int maxNrOfAttempts = 3;
 
-    // length of the "\r\n" which is added to the end of the line,
-    // when ENTER is pressed.
-    private static int newLineLength = 2;
+    // length of the newline which is added to the end of the line
+    // when ENTER is pressed - on windows this is "\r\n", otherwise "\n"
+    private static int newLineLength = 
+        (File.separatorChar == '\\') ? 2 : 1;
 
     // options names to compare to //
     // commands
@@ -316,10 +317,18 @@ class ArgumentsParser {
                 }
                 if (args[i].compareToIgnoreCase(sStorepass) == 0) {
                     param.setStorePass(args[++i].toCharArray());
+                    if (param.getStorePass().length < minPwdLength) {
+                        throw new KeytoolException("The password must be at least "
+                                + minPwdLength + " characters");
+                    }
                     continue;
                 }
                 if (args[i].compareToIgnoreCase(sKeypass) == 0) {
                     param.setKeyPass(args[++i].toCharArray());
+                    if (param.getKeyPass().length < minPwdLength) {
+                        throw new KeytoolException("The password must be at least "
+                                + minPwdLength + " characters");
+                    }
                     continue;
                 }
                 if (args[i].compareToIgnoreCase(sIssuerPass) == 0) {

Modified: harmony/enhanced/java/branches/java6/jdktools/modules/jretools/src/main/java/org/apache/harmony/jretools/keytool/ArgumentsParser.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/jdktools/modules/jretools/src/main/java/org/apache/harmony/jretools/keytool/ArgumentsParser.java?rev=988333&r1=988332&r2=988333&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/jdktools/modules/jretools/src/main/java/org/apache/harmony/jretools/keytool/ArgumentsParser.java
(original)
+++ harmony/enhanced/java/branches/java6/jdktools/modules/jretools/src/main/java/org/apache/harmony/jretools/keytool/ArgumentsParser.java
Mon Aug 23 22:00:52 2010
@@ -49,9 +49,10 @@ class ArgumentsParser {
     // maximum number of attempts to set the password
     static int maxNrOfAttempts = 3;
 
-    // length of the "\r\n" which is added to the end of the line,
-    // when ENTER is pressed.
-    private static int newLineLength = 2;
+    // length of the newline which is added to the end of the line
+    // when ENTER is pressed - on windows this is "\r\n", otherwise "\n"
+    private static int newLineLength = 
+        (File.separatorChar == '\\') ? 2 : 1;
 
     // options names to compare to //
     // commands
@@ -316,10 +317,18 @@ class ArgumentsParser {
                 }
                 if (args[i].compareToIgnoreCase(sStorepass) == 0) {
                     param.setStorePass(args[++i].toCharArray());
+                    if (param.getStorePass().length < minPwdLength) {
+                        throw new KeytoolException("The password must be at least "
+                                + minPwdLength + " characters");
+                    }
                     continue;
                 }
                 if (args[i].compareToIgnoreCase(sKeypass) == 0) {
                     param.setKeyPass(args[++i].toCharArray());
+                    if (param.getKeyPass().length < minPwdLength) {
+                        throw new KeytoolException("The password must be at least "
+                                + minPwdLength + " characters");
+                    }
                     continue;
                 }
                 if (args[i].compareToIgnoreCase(sIssuerPass) == 0) {

Modified: harmony/enhanced/java/branches/java6/jdktools/modules/jretools/src/test/java/org/apache/harmony/jretools/tests/keytool/GenKeyTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/jdktools/modules/jretools/src/test/java/org/apache/harmony/jretools/tests/keytool/GenKeyTest.java?rev=988333&r1=988332&r2=988333&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/jdktools/modules/jretools/src/test/java/org/apache/harmony/jretools/tests/keytool/GenKeyTest.java
(original)
+++ harmony/enhanced/java/branches/java6/jdktools/modules/jretools/src/test/java/org/apache/harmony/jretools/tests/keytool/GenKeyTest.java
Mon Aug 23 22:00:52 2010
@@ -238,6 +238,32 @@ public class GenKeyTest extends TestCase
             }
             // set normal issuer alias back
             args[26] = issuerAlias;
+            
+            // bad store password length
+            args[4] = "12345";
+            try {
+                Main.run(args);
+                fail(excNotThrown);
+            } catch (KeytoolException ok) {
+                assertNotNull(ok.getMessage());
+                assertTrue("Expected password length error, got: " + 
+                        ok.getMessage(), 
+                        ok.getMessage().contains("The password must be at least"));
+            }
+            args[4] = TestUtils.ksPass;
+            
+            // bad key password length
+            args[10] = "12345";
+            try {
+                Main.run(args);
+                fail(excNotThrown);
+            } catch (KeytoolException ok) {
+                assertNotNull(ok.getMessage());
+                assertTrue("Expected password length error, got: " + 
+                        ok.getMessage(), 
+                        ok.getMessage().contains("The password must be at least"));
+            }
+            args[10] = TestUtils.keyPass;
         } finally {
             keyStoreFile.delete();
         }



Mime
View raw message