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 988DF11D55 for ; Wed, 13 Aug 2014 13:17:41 +0000 (UTC) Received: (qmail 96230 invoked by uid 500); 13 Aug 2014 13:17:41 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 96167 invoked by uid 500); 13 Aug 2014 13:17:41 -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 96158 invoked by uid 99); 13 Aug 2014 13:17:41 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Aug 2014 13:17:41 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 37F0E9A4EA7; Wed, 13 Aug 2014 13:17:41 +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: <94801fa277fa4b978ec071966d7f554c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: [CXF-5902] Updating the system test to use the output streaming Date: Wed, 13 Aug 2014 13:17:41 +0000 (UTC) Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 12c2906a1 -> 202da725e [CXF-5902] Updating the system test to use the output streaming Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/202da725 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/202da725 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/202da725 Branch: refs/heads/3.0.x-fixes Commit: 202da725e8e3870d7c215db93f2558750f486910 Parents: 12c2906 Author: Sergey Beryozkin Authored: Wed Aug 13 14:15:40 2014 +0100 Committer: Sergey Beryozkin Committed: Wed Aug 13 14:17:20 2014 +0100 ---------------------------------------------------------------------- .../apache/cxf/rs/security/oauth2/jwe/JweOutputStream.java | 8 +++++--- .../cxf/systest/jaxrs/security/jwt/JAXRSJweJwsTest.java | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/202da725/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwe/JweOutputStream.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwe/JweOutputStream.java b/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwe/JweOutputStream.java index 8b8d915..ff6f0bd 100644 --- a/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwe/JweOutputStream.java +++ b/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwe/JweOutputStream.java @@ -112,12 +112,14 @@ public class JweOutputStream extends FilterOutputStream { ? encryptingCipher.doFinal() : encryptingCipher.doFinal(lastRawDataChunk, 0, lastRawDataChunk.length); final int authTagLengthBits = 128; - if (authTagProducer == null) { - encodeAndWrite(finalBytes, 0, finalBytes.length - authTagLengthBits / 8, true); - } else { + if (authTagProducer != null) { authTagProducer.update(finalBytes, 0, finalBytes.length); + encodeAndWrite(finalBytes, 0, finalBytes.length, true); + } else { + encodeAndWrite(finalBytes, 0, finalBytes.length - authTagLengthBits / 8, true); } out.write(new byte[]{'.'}); + if (authTagProducer == null) { encodeAndWrite(finalBytes, finalBytes.length - authTagLengthBits / 8, authTagLengthBits / 8, true); } else { http://git-wip-us.apache.org/repos/asf/cxf/blob/202da725/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJweJwsTest.java ---------------------------------------------------------------------- diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJweJwsTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJweJwsTest.java index 4971c2a..8f937cc 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJweJwsTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJweJwsTest.java @@ -138,7 +138,7 @@ public class JAXRSJweJwsTest extends AbstractBusClientServerTestBase { List providers = new LinkedList(); // writer JweWriterInterceptor jweWriter = new JweWriterInterceptor(); - //jweWriter.setUseJweOutputStream(true); + jweWriter.setUseJweOutputStream(true); final String cekEncryptionKey = "GawgguFyGrWKav7AX4VKUg"; AesWrapKeyEncryptionAlgorithm keyEncryption =