[ 
https://issues.apache.org/jira/browse/CXF-7983?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16808584#comment-16808584
 ] 

Zsolt Beothy-Elo edited comment on CXF-7983 at 4/3/19 2:02 PM:
---------------------------------------------------------------

[~coheigea], [~ashakirin]: fix works, thx for that.  I saw you only fixed the 
problem for the JWEClientResponseFilter, but I would assume the same scenario 
will also cause problems for other filters, e.g. 
[JwsClientResponseFilter.java|https://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsClientResponseFilter.java]
 I think it would make sense to fix all filters where the problem can occur. 
ShalI create a new Jira for it?

 


was (Author: zbeothy):
[~coheigea], [~ashakirin]: fix works, thx for that.  I saw you only fixed the 
problem for the JWEClientResponseFilter, but I would assume the same scenario 
will also cause problems for other filters, e.g. 
[JwsClientResponseFilter.java|[https://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsClientResponseFilter.java]]
 I think it would make sense to fix all filters where the problem can occur. 
ShalI create a new Jira for it?

[link title|http://example.com]

> JweClientResponseFilter fails to decrypt response, when it has status 204 No 
> Content
> ------------------------------------------------------------------------------------
>
>                 Key: CXF-7983
>                 URL: https://issues.apache.org/jira/browse/CXF-7983
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS Security
>    Affects Versions: 3.2.4, 3.3.0
>            Reporter: Zsolt Beothy-Elo
>            Assignee: Andrei Shakirin
>            Priority: Major
>             Fix For: 3.2.9, 3.3.2
>
>         Attachments: encryption-exception.zip, test-output.txt
>
>
> JweClientResponseFilter fails to decrypt response, when it has status 204 No 
> Content
> For my current project I am trying to get familiar with the cxf JOSE 
> framework. Currently I am running into a problem with JWE trying to encrypt 
> request and response with compact serialization. I have a GET request where 
> the response is correctly encrypted and decrypted, and I have a POST request 
> where the response sends status code 204 and the body is obviously empty.
> The response fails with a warning "WARNUNG: 5 JWE parts are expected" and an 
> exception
> org.apache.cxf.rs.security.jose.jwe.JweException: INVALID_COMPACT_JWE
>     at 
> org.apache.cxf.rs.security.jose.jwe.JweCompactConsumer.<init>(JweCompactConsumer.java:40)
>     at 
> org.apache.cxf.rs.security.jose.jaxrs.AbstractJweDecryptingFilter.decrypt(AbstractJweDecryptingFilter.java:44)
>     at 
> org.apache.cxf.rs.security.jose.jaxrs.JweClientResponseFilter.filter(JweClientResponseFilter.java:42)
> ...
> Test case and test log with exception are attached.
> I debugged the code a bit and it seems to me the filter method in 
> JweClientResponseFilter fails to identify the body is empty and therefor 
> calls the decrypt method, which it shouldn't
>  
> I ran the test case using 3.2.4 and 3.3.0, but also other versions will be 
> affected.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to