Repository: syncope Updated Branches: refs/heads/master 278525b7c -> 1afd1a705
Use the Santuario JCEMapper instead to get the JCE signature algorithm Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/1afd1a70 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/1afd1a70 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/1afd1a70 Branch: refs/heads/master Commit: 1afd1a7053a2fb5d56b9f9ec4a858909e1957c6c Parents: 278525b Author: Colm O hEigeartaigh <cohei...@apache.org> Authored: Wed Aug 16 16:00:11 2017 +0100 Committer: Colm O hEigeartaigh <cohei...@apache.org> Committed: Wed Aug 16 16:00:11 2017 +0100 ---------------------------------------------------------------------- .../org/apache/syncope/core/logic/saml2/SAML2ReaderWriter.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/syncope/blob/1afd1a70/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/saml2/SAML2ReaderWriter.java ---------------------------------------------------------------------- diff --git a/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/saml2/SAML2ReaderWriter.java b/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/saml2/SAML2ReaderWriter.java index 4aebdbb..8bf0c47 100644 --- a/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/saml2/SAML2ReaderWriter.java +++ b/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/saml2/SAML2ReaderWriter.java @@ -52,6 +52,7 @@ import org.apache.syncope.core.logic.init.SAML2SPLoader; import org.apache.wss4j.common.crypto.Merlin; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.saml.OpenSAMLUtil; +import org.apache.xml.security.algorithms.JCEMapper; import org.opensaml.core.xml.XMLObject; import org.opensaml.saml.common.SignableSAMLObject; import org.opensaml.saml.saml2.core.RequestAbstractType; @@ -99,15 +100,13 @@ public class SAML2ReaderWriter { keyInfoGenerator = keyInfoGeneratorFactory.newInstance(); sigAlgo = SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA1; - jceSigAlgo = "SHA1withRSA"; String pubKeyAlgo = loader.getCredential().getPublicKey().getAlgorithm(); if (pubKeyAlgo.equalsIgnoreCase("DSA")) { sigAlgo = SignatureConstants.ALGO_ID_SIGNATURE_DSA_SHA1; - jceSigAlgo = "SHA1withDSA"; } else if (pubKeyAlgo.equalsIgnoreCase("EC")) { sigAlgo = SignatureConstants.ALGO_ID_SIGNATURE_ECDSA_SHA1; - jceSigAlgo = "SHA1withECDSA"; } + jceSigAlgo = JCEMapper.translateURItoJCEID(sigAlgo); callbackHandler = new SAMLSPCallbackHandler(loader.getKeyPass()); }