You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by Willy Chen <ch...@in.tum.de> on 2004/04/26 16:30:23 UTC
Bug Encrypting Parts
hello
i found a possible bug, when encrypting parts of a soap message. when
calling WSEncryptBody.build(Document, Crypto) the setting of the EncDataId
is done by following code:
body = (Element) WSSecurityUtil.findElement(envelope, "EncryptedData",
WSConstants.ENC_NS);
xencEncryptedDataId = "EncDataId-" + body.hashCode();
body.setAttribute("Id", xencEncryptedDataId);
however if you try to encrypt more than one part, the findElement-method
will always return the first element in the soap message, that is encrypted
and will therefore set the EncDataID for that element again - it will not
always set the Id for the element that is currently being encrypted and you
will get following error when trying to decrypt the message:
org.apache.ws.security.WSSecurityException: An error was discovered
processing the <wsse:Security> header. (WSSecurityEngine: DataReference -
referenced data not found).
cheers
willy
Re: Bug Encrypting Parts
Posted by Werner Dittmann <We...@t-online.de>.
Willy,
thanks. I'll have a look at it.
Regards,
Werner
----- Original Message -----
From: "Willy Chen" <ch...@in.tum.de>
To: <fx...@ws.apache.org>
Sent: Monday, April 26, 2004 4:30 PM
Subject: Bug Encrypting Parts
> hello
>
> i found a possible bug, when encrypting parts of a soap message. when
> calling WSEncryptBody.build(Document, Crypto) the setting of the EncDataId
> is done by following code:
>
> body = (Element) WSSecurityUtil.findElement(envelope, "EncryptedData",
> WSConstants.ENC_NS);
> xencEncryptedDataId = "EncDataId-" + body.hashCode();
> body.setAttribute("Id", xencEncryptedDataId);
>
> however if you try to encrypt more than one part, the findElement-method
> will always return the first element in the soap message, that is
encrypted
> and will therefore set the EncDataID for that element again - it will not
> always set the Id for the element that is currently being encrypted and
you
> will get following error when trying to decrypt the message:
> org.apache.ws.security.WSSecurityException: An error was discovered
> processing the <wsse:Security> header. (WSSecurityEngine: DataReference -
> referenced data not found).
>
> cheers
> willy
>