cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1551231 - /cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
Date Mon, 16 Dec 2013 15:25:35 GMT
Author: coheigea
Date: Mon Dec 16 15:25:35 2013
New Revision: 1551231

URL: http://svn.apache.org/r1551231
Log:
Fixing build

Modified:
    cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java

Modified: cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java?rev=1551231&r1=1551230&r2=1551231&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
(original)
+++ cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
Mon Dec 16 15:25:35 2013
@@ -152,24 +152,18 @@ public class SAMLTokenValidator implemen
                 LOG.log(Level.WARNING, "The received assertion is not signed, and therefore
not trusted");
                 return response;
             }
-
+                
             RequestData requestData = new RequestData();
-            requestData.setSigVerCrypto(sigCrypto);
+            requestData.setSigCrypto(sigCrypto);
             WSSConfig wssConfig = WSSConfig.getNewInstance();
             requestData.setWssConfig(wssConfig);
             requestData.setCallbackHandler(callbackHandler);
             requestData.setMsgContext(tokenParameters.getWebServiceContext().getMessageContext());
 
-            WSDocInfo docInfo = new WSDocInfo(validateTargetElement.getOwnerDocument());
-
             // Verify the signature
-            Signature sig = assertion.getSignature();
-            KeyInfo keyInfo = sig.getKeyInfo();
-            SAMLKeyInfo samlKeyInfo = 
-                SAMLUtil.getCredentialFromKeyInfo(
-                    keyInfo.getDOM(), new WSSSAMLKeyInfoProcessor(requestData, docInfo),
sigCrypto
-                );
-            assertion.verifySignature(samlKeyInfo);
+            assertion.verifySignature(
+                requestData, new WSDocInfo(validateTargetElement.getOwnerDocument())
+            );
                 
             SecurityToken secToken = null;
             byte[] signatureValue = assertion.getSignatureValue();
@@ -187,26 +181,6 @@ public class SAMLTokenValidator implemen
             }
             
             if (secToken == null) {
-<<<<<<< HEAD
-                if (!assertion.isSigned()) {
-                    LOG.log(Level.WARNING, "The received assertion is not signed, and therefore
not trusted");
-                    return response;
-                }
-                
-                RequestData requestData = new RequestData();
-                requestData.setSigCrypto(sigCrypto);
-                WSSConfig wssConfig = WSSConfig.getNewInstance();
-                requestData.setWssConfig(wssConfig);
-                requestData.setCallbackHandler(callbackHandler);
-                requestData.setMsgContext(tokenParameters.getWebServiceContext().getMessageContext());
-
-                // Verify the signature
-                assertion.verifySignature(
-                    requestData, new WSDocInfo(validateTargetElement.getOwnerDocument())
-                );
-                
-=======
->>>>>>> 4b3dbb3... Validation fix in the STS
                 // Validate the assertion against schemas/profiles
                 validateAssertion(assertion);
 



Mime
View raw message