airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r1522732 - /airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/SecurityUtil.java
Date Thu, 12 Sep 2013 21:22:49 GMT
Author: amilaj
Date: Thu Sep 12 21:22:49 2013
New Revision: 1522732

URL: http://svn.apache.org/r1522732
Log:
Changed encoding of password string

Modified:
    airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/SecurityUtil.java

Modified: airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/SecurityUtil.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/SecurityUtil.java?rev=1522732&r1=1522731&r2=1522732&view=diff
==============================================================================
--- airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/SecurityUtil.java
(original)
+++ airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/SecurityUtil.java
Thu Sep 12 21:22:49 2013
@@ -24,6 +24,7 @@ package org.apache.airavata.common.utils
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.UnsupportedEncodingException;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 
@@ -54,7 +55,12 @@ public class SecurityUtil {
         }
 
         MessageDigest messageDigest = MessageDigest.getInstance(digestingAlgorithm);
-        return new String(messageDigest.digest(stringToDigest.getBytes()));
+        try {
+            return new String(messageDigest.digest(stringToDigest.getBytes("UTF-8")));
+        } catch (UnsupportedEncodingException e) {
+            logger.error("Error encoding password string when creating digest", e);
+            throw new RuntimeException("Error encoding password string when creating digest",
e);
+        }
     }
 
     /**



Mime
View raw message