You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by GitBox <gi...@apache.org> on 2021/10/31 15:03:00 UTC

[GitHub] [cxf] reta commented on a change in pull request #869: [CXF-8535] Query missing from signature request-target AND also to add digest only if request has body

reta commented on a change in pull request #869:
URL: https://github.com/apache/cxf/pull/869#discussion_r739825341



##########
File path: rt/rs/security/http-signature/src/main/java/org/apache/cxf/rs/security/httpsignature/MessageVerifier.java
##########
@@ -119,11 +118,23 @@ public void verifyMessage(Map<String, List<String>> messageHeaders, String metho
 
         // Add the default required headers
         boolean requestor = MessageUtils.isRequestor(m);
+        byte[] payload = null;
         if (addDefaultRequiredHeaders) {
             if (!(requestor || signedHeaders.contains(HTTPSignatureConstants.REQUEST_TARGET))) {
                 signedHeaders.add(HTTPSignatureConstants.REQUEST_TARGET);
             }
-            if (!signedHeaders.contains("digest")) {
+
+            InputStream is = m.getContent(InputStream.class);

Review comment:
       This is not needed, in every place the `verifyMessage` is called (`VerifySignatureClientFilter` / `VerifySignatureFilter`), the message body is available, you could just add the new `byte[] payload` argument and pass it through.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@cxf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org