jdk/test/sun/security/krb5/auto/KDC.java
changeset 4532 f39917c8cf46
parent 4531 3a9206343ab2
child 5506 202f599c92aa
child 5617 1b0d8c3d6223
--- a/jdk/test/sun/security/krb5/auto/KDC.java	Thu Dec 24 13:56:19 2009 +0800
+++ b/jdk/test/sun/security/krb5/auto/KDC.java	Thu Dec 24 13:56:28 2009 +0800
@@ -484,8 +484,9 @@
             Method stringToKey = EncryptionKey.class.getDeclaredMethod("stringToKey", char[].class, String.class, byte[].class, Integer.TYPE);
             stringToKey.setAccessible(true);
             Integer kvno = null;
-            // For service whose password ending with a number, use it as kvno
-            if (p.toString().indexOf('/') >= 0) {
+            // For service whose password ending with a number, use it as kvno.
+            // Kvno must be postive.
+            if (p.toString().indexOf('/') > 0) {
                 char[] pass = getPassword(p, server);
                 if (Character.isDigit(pass[pass.length-1])) {
                     kvno = pass[pass.length-1] - '0';