[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlrpc-user
Subject:    [jira] [Closed] (WSS-563) Cannot decrypt non XML conform attachements
From:       "Colm O hEigeartaigh (JIRA)" <jira () apache ! org>
Date:       2016-03-22 8:49:25
Message-ID: JIRA.12924011.1450881648000.15108.1458636565918 () Atlassian ! JIRA
[Download RAW message or body]


     [ https://issues.apache.org/jira/browse/WSS-563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel \
]

Colm O hEigeartaigh closed WSS-563.
-----------------------------------

> Cannot decrypt non XML conform attachements
> -------------------------------------------
> 
> Key: WSS-563
> URL: https://issues.apache.org/jira/browse/WSS-563
> Project: WSS4J
> Issue Type: Bug
> Components: WSS4J Core
> Affects Versions: 2.1.3
> Reporter: Andreas Pokrzywinski
> Assignee: Colm O hEigeartaigh
> Fix For: 2.0.7, 2.1.5, 2.2.0
> 
> 
> Problem description see:
> http://cxf.547215.n5.nabble.com/WSS-Client-soap-fault-namespace-problem-td5761485.html
>  My not very good solution in the class:
> org.apache.wss4j.dom.util.EncryptionUtils.decryptXopAttachment(SecretKey, String, \
> RequestData, String, Element) {code}
> Document document = null;
> 		try {
> 			document = db.parse(byteArrayInputStream);
> 		} catch (SAXParseException e) {
> 			if (e.getMessage() == null || !e.getMessage().contains("soap:Fault")) {
> 				throw e;
> 			}
> 			// add envelope namespace to root document (soap:Fault) as string
> 			byteArrayInputStream = new ByteArrayInputStream(input);
> 			String docStr = new String(input);
> 			docStr = docStr.replace("<soap:Fault",
> 					"<soap:Fault xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"");
> 			// Try to parse again.
> 			document = db.parse(new ByteArrayInputStream(docStr.getBytes()));
> 		}
> 		Node decryptedNode = \
> encData.getOwnerDocument().importNode(document.getDocumentElement(), true);  \
> encData.getParentNode().appendChild(decryptedNode);  \
> org.apache.xml.security.utils.XMLUtils.repoolDocumentBuilder(db);  \
> encData.getParentNode().removeChild(encData);  return decryptedNode;
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic