directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1731681 - in /directory/studio/trunk: eclipse-trgt-platform/ eclipse-trgt-platform/template/ plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/password/
Date Mon, 22 Feb 2016 16:26:06 GMT
Author: seelmann
Date: Mon Feb 22 16:26:06 2016
New Revision: 1731681

URL: http://svn.apache.org/viewvc?rev=1731681&view=rev
Log:
DIRSTUDIO-738: Add support for modular crypt format password

Modified:
    directory/studio/trunk/eclipse-trgt-platform/pom-first.xml
    directory/studio/trunk/eclipse-trgt-platform/template/org.apache.directory.studio.eclipse-trgt-platform.template
    directory/studio/trunk/plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/password/PasswordDialog.java
    directory/studio/trunk/plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/password/PasswordValueEditor.java

Modified: directory/studio/trunk/eclipse-trgt-platform/pom-first.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/eclipse-trgt-platform/pom-first.xml?rev=1731681&r1=1731680&r2=1731681&view=diff
==============================================================================
--- directory/studio/trunk/eclipse-trgt-platform/pom-first.xml (original)
+++ directory/studio/trunk/eclipse-trgt-platform/pom-first.xml Mon Feb 22 16:26:06 2016
@@ -45,6 +45,12 @@
 
     <!-- Commons jars -->
     <dependency>
+      <groupId>commons-codec</groupId>
+      <artifactId>commons-codec</artifactId>
+      <version>${org.apache.commons.codec.version}</version>
+    </dependency>
+
+    <dependency>
       <groupId>commons-collections</groupId>
       <artifactId>commons-collections</artifactId>
       <version>${org.apache.commons.collections.version}</version>

Modified: directory/studio/trunk/eclipse-trgt-platform/template/org.apache.directory.studio.eclipse-trgt-platform.template
URL: http://svn.apache.org/viewvc/directory/studio/trunk/eclipse-trgt-platform/template/org.apache.directory.studio.eclipse-trgt-platform.template?rev=1731681&r1=1731680&r2=1731681&view=diff
==============================================================================
--- directory/studio/trunk/eclipse-trgt-platform/template/org.apache.directory.studio.eclipse-trgt-platform.template
(original)
+++ directory/studio/trunk/eclipse-trgt-platform/template/org.apache.directory.studio.eclipse-trgt-platform.template
Mon Feb 22 16:26:06 2016
@@ -19,7 +19,7 @@
   @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
 -->
 <?pde version="3.8"?>
-<target name="Apache Directory Studio Platform" sequenceNumber="207">
+<target name="Apache Directory Studio Platform" sequenceNumber="227">
   <locations>
 
     <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner"
includeSource="true" type="InstallableUnit">
@@ -30,6 +30,7 @@
       <unit id="net.sf.ehcache" version="${net.sf.ehcache.bundleversion}"/>
 
       <!-- Commons jars -->
+      <unit id="org.apache.commons.codec" version="${org.apache.commons.codec.bundleversion}"/>
       <unit id="org.apache.commons.collections" version="${org.apache.commons.collections.bundleversion}"/>
       <unit id="org.apache.commons.io" version="${org.apache.commons.io.bundleversion}"/>
       <unit id="org.apache.commons.lang" version="${org.apache.commons.lang.bundleversion}"/>

Modified: directory/studio/trunk/plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/password/PasswordDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/password/PasswordDialog.java?rev=1731681&r1=1731680&r2=1731681&view=diff
==============================================================================
--- directory/studio/trunk/plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/password/PasswordDialog.java
(original)
+++ directory/studio/trunk/plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/password/PasswordDialog.java
Mon Feb 22 16:26:06 2016
@@ -26,6 +26,7 @@ import org.apache.directory.studio.commo
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionParameter.AuthenticationMethod;
 import org.apache.directory.studio.connection.core.jobs.CheckBindRunnable;
+import org.apache.directory.studio.connection.ui.ConnectionUIPlugin;
 import org.apache.directory.studio.connection.ui.RunnableContextRunner;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
@@ -34,6 +35,7 @@ import org.apache.directory.studio.ldapb
 import org.apache.directory.studio.valueeditors.ValueEditorsActivator;
 import org.apache.directory.studio.valueeditors.ValueEditorsConstants;
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.dialogs.MessageDialog;
@@ -87,6 +89,9 @@ public class PasswordDialog extends Dial
             LdapSecurityConstants.HASH_METHOD_SMD5,
             LdapSecurityConstants.HASH_METHOD_PKCS5S2,
             LdapSecurityConstants.HASH_METHOD_CRYPT,
+            LdapSecurityConstants.HASH_METHOD_CRYPT_MD5,
+            LdapSecurityConstants.HASH_METHOD_CRYPT_SHA256,
+            LdapSecurityConstants.HASH_METHOD_CRYPT_SHA512,
             NO_HASH_METHOD };
 
     /** Constant for the Current Password tab */
@@ -656,12 +661,9 @@ public class PasswordDialog extends Dial
             }
             else
             {
-                MessageDialog dialog = new MessageDialog(
-                    getShell(),
-                    Messages.getString( "PasswordDialog.PasswordVerification" ), getShell().getImage(),
//$NON-NLS-1$
-                    Messages.getString( "PasswordDialog.PasswordVerificationFailed" ), MessageDialog.ERROR,
new String[] //$NON-NLS-1$
-                        { IDialogConstants.OK_LABEL }, 0 );
-                dialog.open();
+                IStatus status = new Status( IStatus.ERROR, ValueEditorsConstants.PLUGIN_ID,
1,
+                    Messages.getString( "PasswordDialog.PasswordVerificationFailed" ), null
); //$NON-NLS-1$
+                ConnectionUIPlugin.getDefault().getExceptionHandler().handleException( status
);
             }
         }
     }

Modified: directory/studio/trunk/plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/password/PasswordValueEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/password/PasswordValueEditor.java?rev=1731681&r1=1731680&r2=1731681&view=diff
==============================================================================
--- directory/studio/trunk/plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/password/PasswordValueEditor.java
(original)
+++ directory/studio/trunk/plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/password/PasswordValueEditor.java
Mon Feb 22 16:26:06 2016
@@ -22,6 +22,8 @@ package org.apache.directory.studio.valu
 
 
 import org.apache.directory.api.ldap.model.constants.LdapSecurityConstants;
+import org.apache.directory.api.ldap.model.password.PasswordUtil;
+import org.apache.directory.api.util.Strings;
 import org.apache.directory.studio.ldapbrowser.common.dialogs.TextDialog;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
@@ -106,9 +108,8 @@ public class PasswordValueEditor extends
                 }
                 else if ( ( password.indexOf( '{' ) == 0  )&& ( password.indexOf(
'}' ) > 0 ) )
                 {
-                    String hashMethod = password.substring( password.indexOf( '{' ) + 1,
password.indexOf( '}' ) );
                     text = NLS.bind(
-                        Messages.getString( "PasswordValueEditor.HashedPassword" ), getHashMethodName(
hashMethod ) ); //$NON-NLS-1$
+                        Messages.getString( "PasswordValueEditor.HashedPassword" ), getHashMethodName(
password ) ); //$NON-NLS-1$
                 }
                 else
                 {
@@ -128,7 +129,7 @@ public class PasswordValueEditor extends
      */
     private String getHashMethodName( String s )
     {
-        LdapSecurityConstants hashMethod = LdapSecurityConstants.getAlgorithm( s );
+        LdapSecurityConstants hashMethod = PasswordUtil.findAlgorithm( Strings.getBytesUtf8(
s ) );
 
         if ( hashMethod != null )
         {



Mime
View raw message