Author: schultz
Date: Tue Nov 20 17:39:02 2018
New Revision: 1847041

URL: http://svn.apache.org/viewvc?rev=1847041&view=rev
Log:
Simplify the initialization of text keys for encryption.
Make it more clear that a 128-bit key requires 32-characters of hex-encoded 
key, and that the larger keys require 48-character and 64-character hex-encoded 
keys.

Modified:
    
tomcat/trunk/test/org/apache/catalina/tribes/group/interceptors/TestEncryptInterceptor.java

Modified: 
tomcat/trunk/test/org/apache/catalina/tribes/group/interceptors/TestEncryptInterceptor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/tribes/group/interceptors/TestEncryptInterceptor.java?rev=1847041&r1=1847040&r2=1847041&view=diff
==============================================================================
--- 
tomcat/trunk/test/org/apache/catalina/tribes/group/interceptors/TestEncryptInterceptor.java
 (original)
+++ 
tomcat/trunk/test/org/apache/catalina/tribes/group/interceptors/TestEncryptInterceptor.java
 Tue Nov 20 17:39:02 2018
@@ -16,8 +16,6 @@
  */
 package org.apache.catalina.tribes.group.interceptors;
 
-import java.nio.charset.StandardCharsets;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Ignore;
@@ -32,7 +30,6 @@ import org.apache.catalina.tribes.group.
 import org.apache.catalina.tribes.group.InterceptorPayload;
 import org.apache.catalina.tribes.io.ChannelData;
 import org.apache.catalina.tribes.io.XByteBuffer;
-import org.apache.tomcat.util.buf.HexUtils;
 
 /**
  * Tests the EncryptInterceptor.
@@ -42,9 +39,9 @@ import org.apache.tomcat.util.buf.HexUti
  * for readability for the tests and their outputs.
  */
 public class TestEncryptInterceptor {
-    private static final String encryptionKey128 = 
HexUtils.toHexString("cafebabedeadbeef".getBytes(StandardCharsets.UTF_8));
-    private static final String encryptionKey192 = 
HexUtils.toHexString("cafebabedeadbeefbeefcafe".getBytes(StandardCharsets.UTF_8));
-    private static final String encryptionKey256 = 
HexUtils.toHexString("cafebabedeadbeefcafebabedeadbeef".getBytes(StandardCharsets.UTF_8));
+    private static final String encryptionKey128 = 
"cafebabedeadbeefcafebabedeadbeef";
+    private static final String encryptionKey192 = 
"cafebabedeadbeefbeefcafecafebabedeadbeefbeefcafe";
+    private static final String encryptionKey256 = 
"cafebabedeadbeefcafebabedeadbeefcafebabedeadbeefcafebabedeadbeef";
 
     EncryptInterceptor src;
     EncryptInterceptor dest;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to