ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1150655 - in /webservices/wss4j/branches/1_5_x-fixes: src/org/apache/ws/security/message/token/UsernameToken.java test/wssec/TestWSSecurityUTDK.java
Date Mon, 25 Jul 2011 12:09:58 GMT
Author: coheigea
Date: Mon Jul 25 12:09:57 2011
New Revision: 1150655

URL: http://svn.apache.org/viewvc?rev=1150655&view=rev
Log:
[WSS-299] - UsernameToken Salt Mac/Encryption Flag on Wrong End of Array

Modified:
    webservices/wss4j/branches/1_5_x-fixes/src/org/apache/ws/security/message/token/UsernameToken.java
    webservices/wss4j/branches/1_5_x-fixes/test/wssec/TestWSSecurityUTDK.java

Modified: webservices/wss4j/branches/1_5_x-fixes/src/org/apache/ws/security/message/token/UsernameToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_5_x-fixes/src/org/apache/ws/security/message/token/UsernameToken.java?rev=1150655&r1=1150654&r2=1150655&view=diff
==============================================================================
--- webservices/wss4j/branches/1_5_x-fixes/src/org/apache/ws/security/message/token/UsernameToken.java
(original)
+++ webservices/wss4j/branches/1_5_x-fixes/src/org/apache/ws/security/message/token/UsernameToken.java
Mon Jul 25 12:09:57 2011
@@ -803,9 +803,9 @@ public class UsernameToken {
         byte[] saltValue = new byte[16];
         random.nextBytes(saltValue);
         if (useForMac) {
-            saltValue[15] = 0x01;
+            saltValue[0] = 0x01;
         } else {
-            saltValue[15] = 0x02;
+            saltValue[0] = 0x02;
         }
         return saltValue;
     }

Modified: webservices/wss4j/branches/1_5_x-fixes/test/wssec/TestWSSecurityUTDK.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_5_x-fixes/test/wssec/TestWSSecurityUTDK.java?rev=1150655&r1=1150654&r2=1150655&view=diff
==============================================================================
--- webservices/wss4j/branches/1_5_x-fixes/test/wssec/TestWSSecurityUTDK.java (original)
+++ webservices/wss4j/branches/1_5_x-fixes/test/wssec/TestWSSecurityUTDK.java Mon Jul 25 12:09:57
2011
@@ -142,7 +142,7 @@ public class TestWSSecurityUTDK extends 
         
         byte[] salt = usernameToken.addSalt(doc, null, false);
         assertTrue(salt.length == 16);
-        assertTrue(salt[15] == 0x02);
+        assertTrue(salt[0] == 0x02);
         byte[] utSalt = usernameToken.getSalt();
         assertTrue(salt.length == utSalt.length);
         for (int i = 0; i < salt.length; i++) {



Mime
View raw message