[1/3] cxf git commit: NPE fix

2017-04-20 Thread coheigea
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes c5c8f2d97 -> b9b356546


NPE fix

# Conflicts:
#   
rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/7084c99a
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/7084c99a
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/7084c99a

Branch: refs/heads/3.1.x-fixes
Commit: 7084c99ad84fd95f46140162e58421c8c347d751
Parents: c5c8f2d
Author: Colm O hEigeartaigh 
Authored: Thu Apr 20 10:26:02 2017 +0100
Committer: Colm O hEigeartaigh 
Committed: Thu Apr 20 10:26:44 2017 +0100

--
 .../ws/security/wss4j/WSS4JInInterceptor.java   | 47 +++-
 1 file changed, 46 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cxf/blob/7084c99a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
--
diff --git 
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
 
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
index 967917f..56ccf12 100644
--- 
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
+++ 
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
@@ -158,7 +158,7 @@ public class WSS4JInInterceptor extends 
AbstractWSS4JInterceptor {
 }
 
 public void handleMessage(SoapMessage msg) throws Fault {
-if (msg.containsKey(SECURITY_PROCESSED) || isGET(msg)) {
+if (msg.containsKey(SECURITY_PROCESSED) || isGET(msg) || 
msg.getExchange() == null) {
 return;
 }
 
@@ -281,6 +281,10 @@ public class WSS4JInInterceptor extends 
AbstractWSS4JInterceptor {
 }
 
 checkActions(msg, reqData, wsResult.getResults(), actions, 
SAAJUtils.getBody(doc));
+<<< HEAD
+===
+
+>>> 0b7b183... NPE fix
 doResults(
 msg, actor, 
 SAAJUtils.getHeader(doc),
@@ -330,7 +334,48 @@ public class WSS4JInInterceptor extends 
AbstractWSS4JInterceptor {
 reqData = null;
 }
 }
+<<< HEAD
 
+===
+private void importNewDomToSAAJ(SOAPMessage doc, Element elem, Node 
originalNode) throws SOAPException {
+if (DOMUtils.isJava9SAAJ()
+&& originalNode != null && !originalNode.isEqualNode(elem)) {
+//ensure the new decrypted dom element could be imported into the 
SAAJ
+Node node = null;
+Document document = null;
+Element body = SAAJUtils.getBody(doc);
+if (body != null) {
+document = body.getOwnerDocument();
+}
+if (elem != null && elem.getOwnerDocument() != null
+&& elem.getOwnerDocument().getDocumentElement() != null) {
+node = elem.getOwnerDocument().
+
getDocumentElement().getFirstChild().getNextSibling().getFirstChild();
+}
+if (document != null && node != null) {
+Node newNode = null;
+try {
+newNode = document.importNode(node, true);
+if (newNode != null) {
+try {
+Method method = 
newNode.getClass().getMethod("getDomElement");
+newNode = (Element)method.invoke(newNode);
+} catch (java.lang.NoSuchMethodException ex) {
+// do nothing;
+}
+}
+
elem.getOwnerDocument().getDocumentElement().getFirstChild().
+getNextSibling().replaceChild(newNode, node);
+} catch (Exception ex) {
+//just to the best try
+}
+
+}
+
+}
+}
+
+>>> 0b7b183... NPE fix
 private void configureAudienceRestriction(SoapMessage msg, RequestData 
reqData) {
 // Add Audience Restrictions for SAML
 boolean enableAudienceRestriction = 



[1/3] cxf git commit: NPE fix

2015-11-13 Thread coheigea
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 3f240045b -> 1c4ffc8ee


NPE fix


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1da85e32
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1da85e32
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1da85e32

Branch: refs/heads/3.0.x-fixes
Commit: 1da85e324276d380836fb7dcbff2d83526b3946f
Parents: 3f24004
Author: Colm O hEigeartaigh 
Authored: Fri Nov 13 11:15:30 2015 +
Committer: Colm O hEigeartaigh 
Committed: Fri Nov 13 13:38:59 2015 +

--
 .../rs/security/oauth2/services/RedirectionBasedGrantService.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cxf/blob/1da85e32/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
--
diff --git 
a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
 
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
index a6260bd..e260bbc 100644
--- 
a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
+++ 
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/RedirectionBasedGrantService.java
@@ -229,7 +229,7 @@ public abstract class RedirectionBasedGrantService extends 
AbstractOAuthService
 sessionTokenParamName = OAuthConstants.SESSION_AUTHENTICITY_TOKEN;
 }
 String sessionToken = params.getFirst(sessionTokenParamName);
-if (!compareRequestAndSessionTokens(sessionToken, params, 
userSubject)) {
+if (sessionToken == null || 
!compareRequestAndSessionTokens(sessionToken, params, userSubject)) {
 throw ExceptionUtils.toBadRequestException(null, null); 
 }
 //TODO: additionally we can check that the Principal that got 
authenticated