ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1852721 - in /webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom: action/EncryptionDerivedAction.java action/SignatureDerivedAction.java message/WSSecBase.java message/WSSecDerivedKeyBase.java
Date Fri, 01 Feb 2019 11:21:04 GMT
Author: coheigea
Date: Fri Feb  1 11:21:03 2019
New Revision: 1852721

URL: http://svn.apache.org/viewvc?rev=1852721&view=rev
Log:
Adding a clean method to WSSecBase

Modified:
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/EncryptionDerivedAction.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SignatureDerivedAction.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecBase.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecDerivedKeyBase.java

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/EncryptionDerivedAction.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/EncryptionDerivedAction.java?rev=1852721&r1=1852720&r2=1852721&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/EncryptionDerivedAction.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/EncryptionDerivedAction.java
Fri Feb  1 11:21:03 2019
@@ -144,6 +144,7 @@ public class EncryptionDerivedAction ext
                 WSSecurityUtil.prependChildElement(reqData.getSecHeader().getSecurityHeaderElement(),
tokenElement);
             }
 
+            wsEncrypt.clean();
         } catch (WSSecurityException e) {
             throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e,
                                           "empty", new Object[] {"Error during Encryption:
"});

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SignatureDerivedAction.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SignatureDerivedAction.java?rev=1852721&r1=1852720&r2=1852721&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SignatureDerivedAction.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SignatureDerivedAction.java
Fri Feb  1 11:21:03 2019
@@ -160,6 +160,8 @@ public class SignatureDerivedAction exte
             }
 
             reqData.getSignatureValues().add(wsSign.getSignatureValue());
+
+            wsSign.clean();
         } catch (WSSecurityException e) {
             throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e, "empty",
                                           new Object[] {"Error during Signature: "});

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecBase.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecBase.java?rev=1852721&r1=1852720&r2=1852721&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecBase.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecBase.java
Fri Feb  1 11:21:03 2019
@@ -234,4 +234,9 @@ public class WSSecBase {
     public void setWsDocInfo(WSDocInfo wsDocInfo) {
         this.wsDocInfo = wsDocInfo;
     }
+
+    public void clean() {
+        user = null;
+        password = null;
+    }
 }

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecDerivedKeyBase.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecDerivedKeyBase.java?rev=1852721&r1=1852720&r2=1852721&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecDerivedKeyBase.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecDerivedKeyBase.java
Fri Feb  1 11:21:03 2019
@@ -21,6 +21,7 @@ package org.apache.wss4j.dom.message;
 
 import java.nio.charset.StandardCharsets;
 import java.security.cert.X509Certificate;
+import java.util.Arrays;
 
 import javax.crypto.SecretKey;
 
@@ -364,4 +365,12 @@ public abstract class WSSecDerivedKeyBas
     protected SecretKey getDerivedKey(String algorithm) {
         return KeyUtils.prepareSecretKey(algorithm, derivedKeyBytes);
     }
+
+    @Override
+    public void clean() {
+        super.clean();
+        if (derivedKeyBytes != null) {
+            Arrays.fill(derivedKeyBytes, (byte)0);
+        }
+    }
 }



Mime
View raw message