jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mets...@apache.org
Subject svn commit: r737114 - in /incubator/jspwiki/trunk: ChangeLog src/com/ecyrd/jspwiki/Release.java src/com/ecyrd/jspwiki/util/CryptoUtil.java
Date Fri, 23 Jan 2009 17:40:52 GMT
Author: metskem
Date: Fri Jan 23 09:40:51 2009
New Revision: 737114

URL: http://svn.apache.org/viewvc?rev=737114&view=rev
Log:
3.0.0-svn-55 JSPWIKI-472, userdatabase.xml corrupted on EBCDIC platforms by CryptoUtil

Modified:
    incubator/jspwiki/trunk/ChangeLog
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/Release.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/util/CryptoUtil.java

Modified: incubator/jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=737114&r1=737113&r2=737114&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Fri Jan 23 09:40:51 2009
@@ -1,3 +1,9 @@
+2009-01-23  Harry Metske <metskem@apache.org>
+
+        * 3.0.0-svn-55
+        
+        * JSPWIKI-472, userdatabase.xml corrupted on EBCDIC platforms by CryptoUtil
+        
 2009-01-19 Florian Holeczek <florianh@apache.org>
 
         * 3.0.0-svn-54

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/Release.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/Release.java?rev=737114&r1=737113&r2=737114&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/Release.java Fri Jan 23 09:40:51 2009
@@ -77,7 +77,7 @@
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "54";
+    public static final String     BUILD         = "55";
     
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/util/CryptoUtil.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/util/CryptoUtil.java?rev=737114&r1=737113&r2=737114&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/util/CryptoUtil.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/util/CryptoUtil.java Fri Jan 23 09:40:51
2009
@@ -29,12 +29,16 @@
 
 import org.apache.commons.codec.binary.Base64;
 
+import com.ecyrd.jspwiki.log.Logger;
+import com.ecyrd.jspwiki.log.LoggerFactory;
+
 /**
  * Hashes and verifies salted SHA-1 passwords, which are compliant with RFC
  * 2307.
  */
 public final class CryptoUtil
 {
+    private static final Logger log = LoggerFactory.getLogger( CryptoUtil.class );
 
     private static final String SSHA = "{SSHA}";
 
@@ -184,7 +188,17 @@
             all[hash.length + i] = salt[i];
         }
         byte[] base64 = Base64.encodeBase64( all );
-        return SSHA + new String( base64 );
+        
+        String base64String = null;
+        try
+        {
+            base64String = SSHA + new String( base64, "UTF8" );
+        }
+        catch( UnsupportedEncodingException e )
+        {
+            log.error( "You do not have UTF-8!?!" );
+        }
+        return base64String;
     }
 
     /**



Mime
View raw message