Return-Path: X-Original-To: apmail-ws-dev-archive@www.apache.org Delivered-To: apmail-ws-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 93B77184FA for ; Tue, 5 Jan 2016 15:47:40 +0000 (UTC) Received: (qmail 20739 invoked by uid 500); 5 Jan 2016 15:47:40 -0000 Delivered-To: apmail-ws-dev-archive@ws.apache.org Received: (qmail 20547 invoked by uid 500); 5 Jan 2016 15:47:40 -0000 Mailing-List: contact dev-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ws.apache.org Delivered-To: mailing list dev@ws.apache.org Received: (qmail 20376 invoked by uid 99); 5 Jan 2016 15:47:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jan 2016 15:47:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id DE9652C1F69 for ; Tue, 5 Jan 2016 15:47:39 +0000 (UTC) Date: Tue, 5 Jan 2016 15:47:39 +0000 (UTC) From: "Colm O hEigeartaigh (JIRA)" To: dev@ws.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (WSS-563) Cannot decrypt non XML conform attachements MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WSS-563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Colm O hEigeartaigh resolved WSS-563. ------------------------------------- Resolution: Fixed > 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(" " // 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