You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2015/09/14 11:54:53 UTC
svn commit: r1702889 - in
/webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output:
TimestampOutputProcessor.java UsernameTokenOutputProcessor.java
Author: coheigea
Date: Mon Sep 14 09:54:53 2015
New Revision: 1702889
URL: http://svn.apache.org/r1702889
Log:
[WSS-553] <wsu:Expires> and <wsu:created> elements not use UTC time format - Applying patch from Jim Ma - Thanks!
Modified:
webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/TimestampOutputProcessor.java
webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/UsernameTokenOutputProcessor.java
Modified: webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/TimestampOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/TimestampOutputProcessor.java?rev=1702889&r1=1702888&r2=1702889&view=diff
==============================================================================
--- webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/TimestampOutputProcessor.java (original)
+++ webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/TimestampOutputProcessor.java Mon Sep 14 09:54:53 2015
@@ -63,9 +63,9 @@ public class TimestampOutputProcessor ex
final QName headerElementName = WSSConstants.TAG_wsu_Timestamp;
WSSUtils.updateSecurityHeaderOrder(outputProcessorChain, headerElementName, getAction(), false);
- XMLGregorianCalendar created = WSSConstants.datatypeFactory.newXMLGregorianCalendar(new GregorianCalendar());
+ XMLGregorianCalendar created = WSSConstants.datatypeFactory.newXMLGregorianCalendar(new GregorianCalendar(TimeZone.getTimeZone("UTC")));
- GregorianCalendar expiresCalendar = new GregorianCalendar();
+ GregorianCalendar expiresCalendar = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
expiresCalendar.add(Calendar.SECOND, ((WSSSecurityProperties) getSecurityProperties()).getTimestampTTL());
XMLGregorianCalendar expires = WSSConstants.datatypeFactory.newXMLGregorianCalendar(expiresCalendar);
Modified: webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/UsernameTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/UsernameTokenOutputProcessor.java?rev=1702889&r1=1702888&r2=1702889&view=diff
==============================================================================
--- webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/UsernameTokenOutputProcessor.java (original)
+++ webservices/wss4j/branches/2_0_x-fixes/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/UsernameTokenOutputProcessor.java Mon Sep 14 09:54:53 2015
@@ -42,6 +42,7 @@ import javax.xml.stream.XMLStreamExcepti
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.List;
+import java.util.TimeZone;
public class UsernameTokenOutputProcessor extends AbstractOutputProcessor {
@@ -97,7 +98,7 @@ public class UsernameTokenOutputProcesso
String createdStr = "";
if (usernameTokenPasswordType == WSSConstants.UsernameTokenPasswordType.PASSWORD_DIGEST
|| ((WSSSecurityProperties) getSecurityProperties()).isAddUsernameTokenCreated()) {
- created = WSSConstants.datatypeFactory.newXMLGregorianCalendar(new GregorianCalendar());
+ created = WSSConstants.datatypeFactory.newXMLGregorianCalendar(new GregorianCalendar(TimeZone.getTimeZone("UTC")));
createdStr = created.toXMLFormat();
}