Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B748517B73 for ; Fri, 10 Oct 2014 12:26:09 +0000 (UTC) Received: (qmail 86021 invoked by uid 500); 10 Oct 2014 12:26:09 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 85959 invoked by uid 500); 10 Oct 2014 12:26:09 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 85948 invoked by uid 99); 10 Oct 2014 12:26:09 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Oct 2014 12:26:09 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 5BA9519ECE; Fri, 10 Oct 2014 12:26:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergeyb@apache.org To: commits@cxf.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: Updating Jwe/Jws consumers to strip double quotes Date: Fri, 10 Oct 2014 12:26:09 +0000 (UTC) Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 7bdfd5970 -> e31e934b9 Updating Jwe/Jws consumers to strip double quotes Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e31e934b Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e31e934b Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e31e934b Branch: refs/heads/3.0.x-fixes Commit: e31e934b9634d8ccb42f2ec20f55984f08078f6e Parents: 7bdfd59 Author: Sergey Beryozkin Authored: Fri Oct 10 13:25:01 2014 +0100 Committer: Sergey Beryozkin Committed: Fri Oct 10 13:25:51 2014 +0100 ---------------------------------------------------------------------- .../org/apache/cxf/rs/security/jose/jwe/JweCompactConsumer.java | 3 +++ .../org/apache/cxf/rs/security/jose/jws/JwsCompactConsumer.java | 3 +++ 2 files changed, 6 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/e31e934b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweCompactConsumer.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweCompactConsumer.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweCompactConsumer.java index 7794102..c2461e3 100644 --- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweCompactConsumer.java +++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweCompactConsumer.java @@ -39,6 +39,9 @@ public class JweCompactConsumer { this(jweContent, new JoseHeadersReaderWriter()); } public JweCompactConsumer(String jweContent, JoseHeadersReader reader) { + if (jweContent.startsWith("\"") && jweContent.endsWith("\"")) { + jweContent = jweContent.substring(1, jweContent.length() - 1); + } String[] parts = jweContent.split("\\."); if (parts.length != 5) { throw new SecurityException("5 JWE parts are expected"); http://git-wip-us.apache.org/repos/asf/cxf/blob/e31e934b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jws/JwsCompactConsumer.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jws/JwsCompactConsumer.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jws/JwsCompactConsumer.java index f202c36..aa06fcc 100644 --- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jws/JwsCompactConsumer.java +++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jws/JwsCompactConsumer.java @@ -40,6 +40,9 @@ public class JwsCompactConsumer { if (r != null) { this.reader = r; } + if (encodedJws.startsWith("\"") && encodedJws.endsWith("\"")) { + encodedJws = encodedJws.substring(1, encodedJws.length() - 1); + } String[] parts = encodedJws.split("\\."); if (parts.length != 3) { if (parts.length == 2 && encodedJws.endsWith(".")) {