Revision: 819
          http://stripes.svn.sourceforge.net/stripes/?rev=819&view=rev
Author:   bengunter
Date:     2008-01-30 20:49:08 -0800 (Wed, 30 Jan 2008)

Log Message:
-----------
Fixed STS-485: Debug mode should disable encryption.

Modified Paths:
--------------
    trunk/stripes/src/net/sourceforge/stripes/util/CryptoUtil.java

Modified: trunk/stripes/src/net/sourceforge/stripes/util/CryptoUtil.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/util/CryptoUtil.java      
2008-01-31 04:41:17 UTC (rev 818)
+++ trunk/stripes/src/net/sourceforge/stripes/util/CryptoUtil.java      
2008-01-31 04:49:08 UTC (rev 819)
@@ -114,8 +114,13 @@
      * @return the encrypted, base64 encoded String
      */
     public static String encrypt(String input) {
-        if (input == null) return null;
+        if (input == null)
+            return null;
 
+        // encryption is disabled in debug mode
+        if (StripesFilter.getConfiguration().isDebugMode())
+            return input;
+
         try {
             // First size the output
             Cipher cipher = getCipher(Cipher.ENCRYPT_MODE);
@@ -164,8 +169,13 @@
      *         can be caused by session expiration as it loses the original 
key.
      */
     public static String decrypt(String input) {
-        if (input == null) return null;
+        if (input == null)
+            return null;
 
+        // encryption is disabled in debug mode
+        if (StripesFilter.getConfiguration().isDebugMode())
+            return input;
+
         // First un-base64 the String
         byte[] bytes = Base64.decode(input, BASE64_OPTIONS);
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to