cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [2/4] cxf git commit: Fixing backmerge
Date Fri, 31 Jul 2015 11:11:59 GMT
Fixing backmerge


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

Branch: refs/heads/2.7.x-fixes
Commit: 4056b2e38c0d276788b6d81fe489270eafe10706
Parents: ef06a56
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Fri Jul 31 12:06:16 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Fri Jul 31 12:06:54 2015 +0100

----------------------------------------------------------------------
 .../saml/sso/CombinedValidatorTest.java         | 38 ++++++++++----------
 1 file changed, 18 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/4056b2e3/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/CombinedValidatorTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/CombinedValidatorTest.java
b/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/CombinedValidatorTest.java
index 466f97f..dc2f167 100644
--- a/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/CombinedValidatorTest.java
+++ b/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/CombinedValidatorTest.java
@@ -63,21 +63,15 @@ import org.apache.wss4j.dom.WSConstants;
 import org.apache.wss4j.dom.WSSConfig;
 >>>>>>> a61db28... Adding more SAML SSO tests
 import org.joda.time.DateTime;
-<<<<<<< HEAD
+import org.opensaml.common.SignableSAMLObject;
 import org.opensaml.common.xml.SAMLConstants;
 import org.opensaml.saml2.core.Response;
 import org.opensaml.saml2.core.Status;
-=======
-import org.opensaml.saml.common.SignableSAMLObject;
-import org.opensaml.saml.common.xml.SAMLConstants;
-import org.opensaml.saml.saml2.core.Response;
-import org.opensaml.saml.saml2.core.Status;
-import org.opensaml.security.x509.BasicX509Credential;
-import org.opensaml.xmlsec.keyinfo.impl.X509KeyInfoGeneratorFactory;
-import org.opensaml.xmlsec.signature.KeyInfo;
-import org.opensaml.xmlsec.signature.Signature;
-import org.opensaml.xmlsec.signature.support.SignatureConstants;
->>>>>>> 3228637... Adding more SAML SSO tests
+import org.opensaml.xml.security.x509.BasicX509Credential;
+import org.opensaml.xml.security.x509.X509KeyInfoGeneratorFactory;
+import org.opensaml.xml.signature.KeyInfo;
+import org.opensaml.xml.signature.Signature;
+import org.opensaml.xml.signature.SignatureConstants;
 
 /**
  * Some unit tests for the SAMLProtocolResponseValidator and the SAMLSSOResponseValidator
@@ -363,14 +357,15 @@ public class CombinedValidatorTest extends org.junit.Assert {
         //
         Signature signature = OpenSAMLUtil.buildSignature();
         signature.setCanonicalizationAlgorithm(SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
-
+        
         // prepare to sign the SAML token
         CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS);
         cryptoType.setAlias(issuerKeyName);
         X509Certificate[] issuerCerts = issuerCrypto.getX509Certificates(cryptoType);
         if (issuerCerts == null) {
             throw new Exception(
-                "No issuer certs were found to sign the SAML Assertion using issuer name:
" + issuerKeyName);
+                    "No issuer certs were found to sign the SAML Assertion using issuer name:
"
+                            + issuerKeyName);
         }
 
         String sigAlgo = SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA1;
@@ -379,24 +374,27 @@ public class CombinedValidatorTest extends org.junit.Assert {
         if (pubKeyAlgo.equalsIgnoreCase("DSA")) {
             sigAlgo = SignatureConstants.ALGO_ID_SIGNATURE_DSA;
         }
-
+        
         PrivateKey privateKey = issuerCrypto.getPrivateKey(issuerKeyName, issuerKeyPassword);
 
         signature.setSignatureAlgorithm(sigAlgo);
 
-        BasicX509Credential signingCredential = 
-            new BasicX509Credential(issuerCerts[0], privateKey);
+        BasicX509Credential signingCredential = new BasicX509Credential();
+        signingCredential.setEntityCertificate(issuerCerts[0]);
+        signingCredential.setPrivateKey(privateKey);
+
         signature.setSigningCredential(signingCredential);
 
         if (useKeyInfo) {
             X509KeyInfoGeneratorFactory kiFactory = new X509KeyInfoGeneratorFactory();
             kiFactory.setEmitEntityCertificate(true);
-
+            
             try {
                 KeyInfo keyInfo = kiFactory.newInstance().generate(signingCredential);
                 signature.setKeyInfo(keyInfo);
-            } catch (org.opensaml.security.SecurityException ex) {
-                throw new Exception("Error generating KeyInfo from signing credential", ex);
+            } catch (org.opensaml.xml.security.SecurityException ex) {
+                throw new Exception(
+                        "Error generating KeyInfo from signing credential", ex);
             }
         }
 


Mime
View raw message