[jboss-cvs] JBossAS SVN: r65482 - branches/Branch_4_0/security/src/main/org/jboss/security/plugins.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Sep 19 16:50:08 EDT 2007


Author: sguilhen at redhat.com
Date: 2007-09-19 16:50:07 -0400 (Wed, 19 Sep 2007)
New Revision: 65482

Modified:
   branches/Branch_4_0/security/src/main/org/jboss/security/plugins/JaasSecurityDomain.java
Log:
Fixed the location of the code that loads the PBE secret key. The old location, inside the setKeyStorePass method, was causing the JaasSecurityDomainUnitTestCase to fail.

Modified: branches/Branch_4_0/security/src/main/org/jboss/security/plugins/JaasSecurityDomain.java
===================================================================
--- branches/Branch_4_0/security/src/main/org/jboss/security/plugins/JaasSecurityDomain.java	2007-09-19 20:49:51 UTC (rev 65481)
+++ branches/Branch_4_0/security/src/main/org/jboss/security/plugins/JaasSecurityDomain.java	2007-09-19 20:50:07 UTC (rev 65482)
@@ -242,12 +242,6 @@
       throws Exception
    {
       this.keyStorePassword = this.loadPassword(password);
-
-      // Create the PBE secret key
-      cipherSpec = new PBEParameterSpec(salt, iterationCount);
-      PBEKeySpec keySpec = new PBEKeySpec(this.keyStorePassword);
-      SecretKeyFactory factory = SecretKeyFactory.getInstance("PBEwithMD5andDES");
-      cipherKey = factory.generateSecret(keySpec);
    }
 
    private char[] loadPassword(String passwordString) 
@@ -411,6 +405,9 @@
    protected void startService()
       throws Exception
    {
+	   // Load the secret key
+	   loadPBESecretKey();
+
       // Load the key and/or truststore into memory
       loadKeyAndTrustStore();
 
@@ -438,6 +435,16 @@
       cipherKey = null;
    }
 
+   private void loadPBESecretKey()
+      throws Exception
+   {
+      // Create the PBE secret key
+      cipherSpec = new PBEParameterSpec(salt, iterationCount);
+      PBEKeySpec keySpec = new PBEKeySpec(keyStorePassword);
+      SecretKeyFactory factory = SecretKeyFactory.getInstance("PBEwithMD5andDES");
+      cipherKey = factory.generateSecret(keySpec);
+   }
+
    private void loadKeyAndTrustStore()
       throws Exception
    {




More information about the jboss-cvs-commits mailing list