cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-5902] Updating the system test to use the output streaming
Date Wed, 13 Aug 2014 13:17:41 GMT
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 <sberyozkin@talend.com>
Authored: Wed Aug 13 14:15:40 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
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<Object> providers = new LinkedList<Object>();
         // writer
         JweWriterInterceptor jweWriter = new JweWriterInterceptor();
-        //jweWriter.setUseJweOutputStream(true);
+        jweWriter.setUseJweOutputStream(true);
         
         final String cekEncryptionKey = "GawgguFyGrWKav7AX4VKUg";
         AesWrapKeyEncryptionAlgorithm keyEncryption = 


Mime
View raw message