cxf git commit: [CXF-6098] - Use RSA-SHA256 by default when issuing tokens in the STS
Repository: cxf Updated Branches: refs/heads/master 58e6563da - effcaf3f6 [CXF-6098] - Use RSA-SHA256 by default when issuing tokens in the STS Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/effcaf3f Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/effcaf3f Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/effcaf3f Branch: refs/heads/master Commit: effcaf3f6cfb4b3287d683285592f2693af42b29 Parents: 58e6563 Author: Colm O hEigeartaigh cohei...@apache.org Authored: Tue Nov 11 14:08:17 2014 + Committer: Colm O hEigeartaigh cohei...@apache.org Committed: Tue Nov 11 14:08:17 2014 + -- .../org/apache/cxf/sts/SignatureProperties.java | 5 ++- .../token/provider/SAMLProviderKeyTypeTest.java | 47 +--- 2 files changed, 35 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/effcaf3f/services/sts/sts-core/src/main/java/org/apache/cxf/sts/SignatureProperties.java -- diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/SignatureProperties.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/SignatureProperties.java index d446e12..73cbad3 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/SignatureProperties.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/SignatureProperties.java @@ -28,7 +28,7 @@ import org.apache.wss4j.dom.WSConstants; * or generate a symmetric key in the STS. */ public class SignatureProperties { -private String signatureAlgorithm = WSConstants.RSA_SHA1; +private String signatureAlgorithm = http://www.w3.org/2001/04/xmldsig-more#rsa-sha256;; private String c14nAlgorithm = WSConstants.C14N_EXCL_OMIT_COMMENTS; private ListString acceptedSignatureAlgorithms = new ArrayListString(); private ListString acceptedC14nAlgorithms = new ArrayListString(); @@ -36,10 +36,11 @@ public class SignatureProperties { private long keySize = 256; private long minimumKeySize = 128; private long maximumKeySize = 512; -private String digestAlgorithm = WSConstants.SHA1; +private String digestAlgorithm = WSConstants.SHA256; public SignatureProperties() { // Default signature algorithms +acceptedSignatureAlgorithms.add(WSConstants.RSA_SHA1); acceptedSignatureAlgorithms.add(signatureAlgorithm); // Default c14n algorithms http://git-wip-us.apache.org/repos/asf/cxf/blob/effcaf3f/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderKeyTypeTest.java -- diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderKeyTypeTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderKeyTypeTest.java index 38191ab..8b9cdd7 100644 --- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderKeyTypeTest.java +++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderKeyTypeTest.java @@ -507,26 +507,32 @@ public class SAMLProviderKeyTypeTest extends org.junit.Assert { createProviderParameters(WSConstants.WSS_SAML2_TOKEN_TYPE, STSConstants.BEARER_KEY_KEYTYPE); KeyRequirements keyRequirements = providerParameters.getKeyRequirements(); -String signatureAlgorithm = http://www.w3.org/2001/04/xmldsig-more#rsa-sha256;; -keyRequirements.setSignatureAlgorithm(signatureAlgorithm); - -// This will fail as the requested signature algorithm is rejected +// Default TokenProviderResponse providerResponse = samlTokenProvider.createToken(providerParameters); assertTrue(providerResponse != null); assertTrue(providerResponse.getToken() != null providerResponse.getTokenId() != null); Element token = providerResponse.getToken(); String tokenString = DOM2Writer.nodeToString(token); + assertTrue(tokenString.contains(http://www.w3.org/2001/04/xmldsig-more#rsa-sha256;)); + +// Try with unsupported alternative +String signatureAlgorithm = WSConstants.DSA; +keyRequirements.setSignatureAlgorithm(signatureAlgorithm); + +// This will fail as the requested signature algorithm is rejected +providerResponse = samlTokenProvider.createToken(providerParameters); +assertTrue(providerResponse != null); +assertTrue(providerResponse.getToken() != null providerResponse.getTokenId() != null); + +token = providerResponse.getToken(); +tokenString = DOM2Writer.nodeToString(token);
svn commit: r928771 - in /websites/production/cxf/content: cache/docs.pageCache docs/31-migration-guide.html
Author: buildbot Date: Tue Nov 11 14:46:50 2014 New Revision: 928771 Log: Production update by buildbot for cxf Modified: websites/production/cxf/content/cache/docs.pageCache websites/production/cxf/content/docs/31-migration-guide.html Modified: websites/production/cxf/content/cache/docs.pageCache == Binary files - no diff available. Modified: websites/production/cxf/content/docs/31-migration-guide.html == --- websites/production/cxf/content/docs/31-migration-guide.html (original) +++ websites/production/cxf/content/docs/31-migration-guide.html Tue Nov 11 14:46:50 2014 @@ -107,7 +107,7 @@ Apache CXF -- 3.1 Migration Guide td height=100% !-- Content -- div class=wiki-content -div id=ConfluenceContenth3 id=id-3.1MigrationGuide-MajorNotesMajor Notes/h3ulliCXF 3.1 no longer supports Java 6. #160; You must use Java 7 or Java 8./liliThe JAX-WS/Simple frontend ServerFactoryBean will automatically call reset at the end of the create() call. #160; This allows resources to be cleaned up and garbage collected sooner. #160;However, it also prevents multiple calls to create() from sharing the same ServerInfo/EndpointInfo/etc... objects like they would we 3.0.x. #160; That sharing has caused many problems in the past due to sharing of properties (like token caches) that are stored on those objects so the new behavior is more correct, but it is different than previous versions so care must be taken while upgrading./liliThe Karaf features.xml file for CXF 3.1 no longer will install spring or spring-dm when installing the cxf feature. #160;If you require spring/spring-dm, you will need to install those features prior to installing the CXF feature./li/ulp#160;/ph3 id=id-3.1MigrationGuide-NewFeaturesNew Features/h3p#160;/pp#160;/ph3 id=id-3.1MigrationGuide-MajorDependencyChangesMajor Dependency Changes/h3ulliThe Jetty based HTTP transport has been updated to support Jetty 9 as well as Jetty 8. #160; However, support for Jetty 7 has been dropped./liliDue to the Jetty upgrade, support for running Jetty based endpoints in Karaf 2.3.x has been dropped./liliSupport for using JAX-WS 2.1 based API jars has been removed. #160;Java 7 (now required) includes JAX-WS 2.2 so this should not be an issue./li/ul/div +div id=ConfluenceContenth3 id=id-3.1MigrationGuide-MajorNotesMajor Notes/h3ulliCXF 3.1 no longer supports Java 6. #160; You must use Java 7 or Java 8./liliThe JAX-WS/Simple frontend ServerFactoryBean will automatically call reset at the end of the create() call. #160; This allows resources to be cleaned up and garbage collected sooner. #160;However, it also prevents multiple calls to create() from sharing the same ServerInfo/EndpointInfo/etc... objects like they would we 3.0.x. #160; That sharing has caused many problems in the past due to sharing of properties (like token caches) that are stored on those objects so the new behavior is more correct, but it is different than previous versions so care must be taken while upgrading./liliThe Karaf features.xml file for CXF 3.1 no longer will install spring or spring-dm when installing the cxf feature. #160;If you require spring/spring-dm, you will need to install those features prior to installing the CXF feature./liliThe STS (Security Token Service) now issues tokens using the RSA-SHA256 signature algorithm by default (previously RSA-SHA1), and the SHA-256 digest algorithm (previously SHA-1)./li/ulp#160;/ph3 id=id-3.1MigrationGuide-NewFeaturesNew Features/h3p#160;/pp#160;/ph3 id=id-3.1MigrationGuide-MajorDependencyChangesMajor Dependency Changes/h3ulliThe Jetty based HTTP transport has been updated to support Jetty 9 as well as Jetty 8. #160; However, support for Jetty 7 has been dropped./liliDue to the Jetty upgrade, support for running Jetty based endpoints in Karaf 2.3.x has been dropped./liliSupport for using JAX-WS 2.1 based API jars has been removed. #160;Java 7 (now required) includes JAX-WS 2.2 so this should not be an issue./li/ul/div /div !-- Content -- /td
cxf git commit: Recording .gitmergeinfo Changes
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 1bbace692 - df8ebc45a Recording .gitmergeinfo Changes Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/df8ebc45 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/df8ebc45 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/df8ebc45 Branch: refs/heads/3.0.x-fixes Commit: df8ebc45a913a34d9ac8d0d1c6186d0cfe1c6673 Parents: 1bbace6 Author: Colm O hEigeartaigh cohei...@apache.org Authored: Tue Nov 11 14:57:41 2014 + Committer: Colm O hEigeartaigh cohei...@apache.org Committed: Tue Nov 11 14:57:41 2014 + -- .gitmergeinfo | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/df8ebc45/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index 5de5819..770003f 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -95,6 +95,7 @@ B eba07e615684e475772a7a2d23d7e93a0b099485 B ec4435d70cb0097e34f38bc0f47c0faca03b4bb0 B ecbf4e78586870a507fe4cf91239d51c3f202aad B eee2a947d867c403c212677cf942b3d07fa06fd7 +B effcaf3f6cfb4b3287d683285592f2693af42b29 B f18acbcdfc48aca354610614c0ba3a46dcb8332a B f2f6aa016cdd1bb49698b319806a8369f149c8dd B f595ca026d56ec5e58a38780677598d8f9d9ded5 @@ -120,6 +121,7 @@ M 64368a5ddad507fa5d7016cbd07f3e9b5b5fd594 M 67201fdde69488e511deb3d24794984afc01fe2d M 7431af236a19b5b5f899bad317a548a4c5c9cd49 M 816e1a5ef4c0992a7d084a0529e42d9ad6a4a3c6 +M 89b87071f3dedd2cd5ed874e56f69ab7dcf7953d M 8bcb5133c602b1cbe642cfd5fbb46099a28b3016 M 98a578dbf4b7e19c4555bd2011f24c650d0f54c0 M 98f65f2911e063e70e864e7614b062cc124a0f9d
cxf git commit: Recording .gitmergeinfo Changes
Repository: cxf Updated Branches: refs/heads/2.7.x-fixes 8a5c1894f - a170bbb81 Recording .gitmergeinfo Changes Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a170bbb8 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a170bbb8 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a170bbb8 Branch: refs/heads/2.7.x-fixes Commit: a170bbb8197bdefc24cb975238a32f4b826b0197 Parents: 8a5c189 Author: Colm O hEigeartaigh cohei...@apache.org Authored: Tue Nov 11 14:58:15 2014 + Committer: Colm O hEigeartaigh cohei...@apache.org Committed: Tue Nov 11 14:58:15 2014 + -- .gitmergeinfo | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/a170bbb8/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index e667258..b45f868 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -1317,6 +1317,7 @@ B dea6d0726a531ffe6b1834407c74d12f51da4ea6 B deca47d1ff49f43ecd137f3a1a04e771fe1a7712 B df3aa9d613db902539ebef5b0ef47122c86df034 B df457e9b8f456cc571a5a136ffa6f9bc06219588 +B df8ebc45a913a34d9ac8d0d1c6186d0cfe1c6673 B df94a7fe524549455ec65c3068a39a1d1d37acb1 B dfbe1e515a3aa4283655b422b4f717d05cc77415 B e01fc4aae66285c5567eb34d01f8ebc41274424c
cxf git commit: Excluding org.eclipse:org.eclipse.osgi transitive dependency which seems to be not needed and is causing issues as the required version is not in Maven Central
Repository: cxf Updated Branches: refs/heads/master effcaf3f6 - 8fccdd91d Excluding org.eclipse:org.eclipse.osgi transitive dependency which seems to be not needed and is causing issues as the required version is not in Maven Central Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8fccdd91 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8fccdd91 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8fccdd91 Branch: refs/heads/master Commit: 8fccdd91db3557b411fceb6518fead292b4c7e7c Parents: effcaf3 Author: Alessio Soldano asold...@redhat.com Authored: Tue Nov 11 17:07:45 2014 +0100 Committer: Alessio Soldano asold...@redhat.com Committed: Tue Nov 11 17:07:45 2014 +0100 -- osgi/itests/pom.xml | 4 1 file changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/8fccdd91/osgi/itests/pom.xml -- diff --git a/osgi/itests/pom.xml b/osgi/itests/pom.xml index 9575dc8..e8072eb 100644 --- a/osgi/itests/pom.xml +++ b/osgi/itests/pom.xml @@ -160,6 +160,10 @@ artifactIdosgi/artifactId /exclusion exclusion +groupIdorg.eclipse/groupId +artifactIdorg.eclipse.osgi/artifactId +/exclusion +exclusion groupIdorg.apache.karaf/groupId artifactIdorg.apache.karaf.client/artifactId /exclusion
cxf git commit: Updating JWE/JWS filters to postponse setting a jose media type
Repository: cxf Updated Branches: refs/heads/master 8fccdd91d - 6e0451e28 Updating JWE/JWS filters to postponse setting a jose media type Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6e0451e2 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6e0451e2 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6e0451e2 Branch: refs/heads/master Commit: 6e0451e28c02dbb61f11026f2bf6f29e67cdc5c4 Parents: 8fccdd9 Author: Sergey Beryozkin sberyoz...@talend.com Authored: Tue Nov 11 16:38:52 2014 + Committer: Sergey Beryozkin sberyoz...@talend.com Committed: Tue Nov 11 16:38:52 2014 + -- .../jose/jaxrs/JweWriterInterceptor.java| 22 +++--- .../jose/jaxrs/JwsWriterInterceptor.java| 7 +- systests/rs-security/pom.xml| 5 ++ .../jaxrs/security/jwt/JAXRSJweJwsTest.java | 73 ++- .../jaxrs/security/jwt/JAXRSJwsJsonTest.java| 76 +--- .../cxf/systest/jaxrs/security/jwt/server.xml | 4 ++ .../jaxrs/security/jwt/serverJwsJson.xml| 20 ++ 7 files changed, 173 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/6e0451e2/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java -- diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java index 73a749b..cbe4aef 100644 --- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java +++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java @@ -63,18 +63,15 @@ public class JweWriterInterceptor implements WriterInterceptor { JweEncryptionProvider theEncryptionProvider = getInitializedEncryptionProvider(); String ctString = null; -if (contentTypeRequired) { -MediaType mt = ctx.getMediaType(); -if (mt != null) { -if (application.equals(mt.getType())) { -ctString = mt.getSubtype(); -} else { -ctString = JAXRSUtils.mediaTypeToString(mt); -} +MediaType contentMediaType = ctx.getMediaType(); +if (contentTypeRequired contentMediaType != null) { +if (application.equals(contentMediaType.getType())) { +ctString = contentMediaType.getSubtype(); +} else { +ctString = JAXRSUtils.mediaTypeToString(contentMediaType); } } - ctx.setMediaType(JAXRSUtils.toMediaType(JoseConstants.MEDIA_TYPE_JOSE)); if (useJweOutputStream) { JweEncryptionState encryption = theEncryptionProvider.createJweEncryptionState(ctString); try { @@ -94,18 +91,25 @@ public class JweWriterInterceptor implements WriterInterceptor { ctx.setOutputStream(jweStream); ctx.proceed(); +setJoseMediaType(ctx); jweStream.flush(); } else { CachedOutputStream cos = new CachedOutputStream(); ctx.setOutputStream(cos); ctx.proceed(); String jweContent = theEncryptionProvider.encrypt(cos.getBytes(), ctString); +setJoseMediaType(ctx); IOUtils.copy(new ByteArrayInputStream(StringUtils.toBytesUTF8(jweContent)), actualOs); actualOs.flush(); } } +private void setJoseMediaType(WriterInterceptorContext ctx) { +MediaType joseMediaType = JAXRSUtils.toMediaType(JoseConstants.MEDIA_TYPE_JOSE); +ctx.setMediaType(joseMediaType); +} + protected JweEncryptionProvider getInitializedEncryptionProvider() { if (encryptionProvider != null) { return encryptionProvider; http://git-wip-us.apache.org/repos/asf/cxf/blob/6e0451e2/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java -- diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java index 36850c4..c79f305 100644 --- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java +++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java @@ -55,7 +55,6 @@ public class JwsWriterInterceptor extends
cxf git commit: Updating JWE/JWS filters to postponse setting a jose media type
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes df8ebc45a - 2581237df Updating JWE/JWS filters to postponse setting a jose media type Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/2581237d Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/2581237d Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/2581237d Branch: refs/heads/3.0.x-fixes Commit: 2581237dfa35536add09704d74255ea076e99077 Parents: df8ebc4 Author: Sergey Beryozkin sberyoz...@talend.com Authored: Tue Nov 11 16:38:52 2014 + Committer: Sergey Beryozkin sberyoz...@talend.com Committed: Tue Nov 11 16:41:32 2014 + -- .../jose/jaxrs/JweWriterInterceptor.java| 22 +++--- .../jose/jaxrs/JwsWriterInterceptor.java| 7 +- systests/rs-security/pom.xml| 5 ++ .../jaxrs/security/jwt/JAXRSJweJwsTest.java | 73 ++- .../jaxrs/security/jwt/JAXRSJwsJsonTest.java| 76 +--- .../cxf/systest/jaxrs/security/jwt/server.xml | 4 ++ .../jaxrs/security/jwt/serverJwsJson.xml| 20 ++ 7 files changed, 173 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/2581237d/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java -- diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java index 73a749b..cbe4aef 100644 --- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java +++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java @@ -63,18 +63,15 @@ public class JweWriterInterceptor implements WriterInterceptor { JweEncryptionProvider theEncryptionProvider = getInitializedEncryptionProvider(); String ctString = null; -if (contentTypeRequired) { -MediaType mt = ctx.getMediaType(); -if (mt != null) { -if (application.equals(mt.getType())) { -ctString = mt.getSubtype(); -} else { -ctString = JAXRSUtils.mediaTypeToString(mt); -} +MediaType contentMediaType = ctx.getMediaType(); +if (contentTypeRequired contentMediaType != null) { +if (application.equals(contentMediaType.getType())) { +ctString = contentMediaType.getSubtype(); +} else { +ctString = JAXRSUtils.mediaTypeToString(contentMediaType); } } - ctx.setMediaType(JAXRSUtils.toMediaType(JoseConstants.MEDIA_TYPE_JOSE)); if (useJweOutputStream) { JweEncryptionState encryption = theEncryptionProvider.createJweEncryptionState(ctString); try { @@ -94,18 +91,25 @@ public class JweWriterInterceptor implements WriterInterceptor { ctx.setOutputStream(jweStream); ctx.proceed(); +setJoseMediaType(ctx); jweStream.flush(); } else { CachedOutputStream cos = new CachedOutputStream(); ctx.setOutputStream(cos); ctx.proceed(); String jweContent = theEncryptionProvider.encrypt(cos.getBytes(), ctString); +setJoseMediaType(ctx); IOUtils.copy(new ByteArrayInputStream(StringUtils.toBytesUTF8(jweContent)), actualOs); actualOs.flush(); } } +private void setJoseMediaType(WriterInterceptorContext ctx) { +MediaType joseMediaType = JAXRSUtils.toMediaType(JoseConstants.MEDIA_TYPE_JOSE); +ctx.setMediaType(joseMediaType); +} + protected JweEncryptionProvider getInitializedEncryptionProvider() { if (encryptionProvider != null) { return encryptionProvider; http://git-wip-us.apache.org/repos/asf/cxf/blob/2581237d/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java -- diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java index 36850c4..c79f305 100644 --- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java +++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsWriterInterceptor.java @@ -55,7 +55,6 @@ public class JwsWriterInterceptor extends
cxf git commit: [CXF-6089] XmlAccessorOrder.ALPHABETICAL, Exception.getMessage() duplicate WSDL elements generated - applying patch on behalf of Rebecca Searls - thanks!
Repository: cxf Updated Branches: refs/heads/master 6e0451e28 - 4a292c0cc [CXF-6089] XmlAccessorOrder.ALPHABETICAL, Exception.getMessage() duplicate WSDL elements generated - applying patch on behalf of Rebecca Searls - thanks! Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4a292c0c Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4a292c0c Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4a292c0c Branch: refs/heads/master Commit: 4a292c0cc49c0c4eef5d50efc78a499c7a5e1783 Parents: 6e0451e Author: Alessio Soldano asold...@redhat.com Authored: Tue Nov 11 17:48:18 2014 +0100 Committer: Alessio Soldano asold...@redhat.com Committed: Tue Nov 11 17:50:21 2014 +0100 -- .../apache/cxf/jaxb/JAXBSchemaInitializer.java | 23 +--- 1 file changed, 1 insertion(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/4a292c0c/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java -- diff --git a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java index e413963..0e344d2 100644 --- a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java +++ b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java @@ -42,7 +42,6 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorOrder; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlList; -import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.XmlAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; @@ -582,11 +581,7 @@ class JAXBSchemaInitializer extends ServiceModelVisitor { } } } -// Create element in xsd:sequence for Exception.class -if (Exception.class.isAssignableFrom(cls)) { -addExceptionMessage(cls, schema, seq); -} - + if (propertyOrder != null) { if (propertyOrder.length == seq.getItems().size()) { sortItems(seq, propertyOrder); @@ -605,22 +600,6 @@ class JAXBSchemaInitializer extends ServiceModelVisitor { schemas.addCrossImports(); part.setProperty(JAXBDataBinding.class.getName() + .CUSTOM_EXCEPTION, Boolean.TRUE); } -private void addExceptionMessage(Class? cls, XmlSchema schema, XmlSchemaSequence seq) { -try { -//a subclass could mark the message method as transient -Method m = cls.getMethod(getMessage); -if (!m.isAnnotationPresent(XmlTransient.class)) { -JAXBBeanInfo beanInfo = getBeanInfo(java.lang.String.class); -XmlSchemaElement exEle = new XmlSchemaElement(schema, false); -exEle.setName(message); -exEle.setSchemaTypeName(getTypeName(beanInfo)); -exEle.setMinOccurs(0); -seq.getItems().add(exEle); -} -} catch (Exception e) { -//ignore, just won't have the message element -} -} private boolean generateGenericType(Type type) { if (type instanceof ParameterizedType) {
[1/2] cxf git commit: [CXF-6089] XmlAccessorOrder.ALPHABETICAL, Exception.getMessage() duplicate WSDL elements generated - applying patch on behalf of Rebecca Searls - thanks!
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 2581237df - 9053b7a86 [CXF-6089] XmlAccessorOrder.ALPHABETICAL, Exception.getMessage() duplicate WSDL elements generated - applying patch on behalf of Rebecca Searls - thanks! Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/3a469d37 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/3a469d37 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/3a469d37 Branch: refs/heads/3.0.x-fixes Commit: 3a469d377d87a60439103f294010da6605476e70 Parents: 2581237 Author: Alessio Soldano asold...@redhat.com Authored: Tue Nov 11 17:48:18 2014 +0100 Committer: Alessio Soldano asold...@redhat.com Committed: Tue Nov 11 17:57:53 2014 +0100 -- .../apache/cxf/jaxb/JAXBSchemaInitializer.java | 23 +--- 1 file changed, 1 insertion(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/3a469d37/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java -- diff --git a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java index e413963..0e344d2 100644 --- a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java +++ b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java @@ -42,7 +42,6 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorOrder; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlList; -import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.XmlAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; @@ -582,11 +581,7 @@ class JAXBSchemaInitializer extends ServiceModelVisitor { } } } -// Create element in xsd:sequence for Exception.class -if (Exception.class.isAssignableFrom(cls)) { -addExceptionMessage(cls, schema, seq); -} - + if (propertyOrder != null) { if (propertyOrder.length == seq.getItems().size()) { sortItems(seq, propertyOrder); @@ -605,22 +600,6 @@ class JAXBSchemaInitializer extends ServiceModelVisitor { schemas.addCrossImports(); part.setProperty(JAXBDataBinding.class.getName() + .CUSTOM_EXCEPTION, Boolean.TRUE); } -private void addExceptionMessage(Class? cls, XmlSchema schema, XmlSchemaSequence seq) { -try { -//a subclass could mark the message method as transient -Method m = cls.getMethod(getMessage); -if (!m.isAnnotationPresent(XmlTransient.class)) { -JAXBBeanInfo beanInfo = getBeanInfo(java.lang.String.class); -XmlSchemaElement exEle = new XmlSchemaElement(schema, false); -exEle.setName(message); -exEle.setSchemaTypeName(getTypeName(beanInfo)); -exEle.setMinOccurs(0); -seq.getItems().add(exEle); -} -} catch (Exception e) { -//ignore, just won't have the message element -} -} private boolean generateGenericType(Type type) { if (type instanceof ParameterizedType) {
[2/2] cxf git commit: Recording .gitmergeinfo Changes
Recording .gitmergeinfo Changes Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/9053b7a8 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/9053b7a8 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/9053b7a8 Branch: refs/heads/3.0.x-fixes Commit: 9053b7a86a2dac6856be838fd66d812591307e34 Parents: 3a469d3 Author: Alessio Soldano asold...@redhat.com Authored: Tue Nov 11 17:59:57 2014 +0100 Committer: Alessio Soldano asold...@redhat.com Committed: Tue Nov 11 17:59:57 2014 +0100 -- .gitmergeinfo | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/9053b7a8/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index 770003f..75c6bf2 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -110,6 +110,7 @@ B ffd429be404953874e141c52a9c8ba46812d73ca M 0d63846798b590255c45463359e2cb1a28e4d3cb M 1701e6c8d4e794f25d69781e3f69357723ad7fcf M 18a3d43cb0044fcb84d3cc89f138fd9e7110dd04 +M 4a292c0cc49c0c4eef5d50efc78a499c7a5e1783 M 43c8d500b04a13f72077751fdbfaab7bbcfbbf8f M 4640cf1ea20eee09ae650b706bce765a16affc8b M 47b57d723f1468e9d9650617a6013edf4f965900
[1/2] cxf git commit: [CXF-6089] XmlAccessorOrder.ALPHABETICAL, Exception.getMessage() duplicate WSDL elements generated - applying patch on behalf of Rebecca Searls - thanks!
Repository: cxf Updated Branches: refs/heads/2.7.x-fixes a170bbb81 - bb5df0b76 [CXF-6089] XmlAccessorOrder.ALPHABETICAL, Exception.getMessage() duplicate WSDL elements generated - applying patch on behalf of Rebecca Searls - thanks! Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/aef8e5ae Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/aef8e5ae Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/aef8e5ae Branch: refs/heads/2.7.x-fixes Commit: aef8e5ae2ec2882ab09cf1ccfba979f7c7812304 Parents: a170bbb Author: Alessio Soldano asold...@redhat.com Authored: Tue Nov 11 17:48:18 2014 +0100 Committer: Alessio Soldano asold...@redhat.com Committed: Tue Nov 11 18:38:18 2014 +0100 -- .../apache/cxf/jaxb/JAXBSchemaInitializer.java | 23 +--- 1 file changed, 1 insertion(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/aef8e5ae/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java -- diff --git a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java index f367e30..c5d7df5 100644 --- a/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java +++ b/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java @@ -42,7 +42,6 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorOrder; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlList; -import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.XmlAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; @@ -582,11 +581,7 @@ class JAXBSchemaInitializer extends ServiceModelVisitor { } } } -// Create element in xsd:sequence for Exception.class -if (Exception.class.isAssignableFrom(cls)) { -addExceptionMessage(cls, schema, seq); -} - + if (propertyOrder != null) { if (propertyOrder.length == seq.getItems().size()) { sortItems(seq, propertyOrder); @@ -605,22 +600,6 @@ class JAXBSchemaInitializer extends ServiceModelVisitor { schemas.addCrossImports(); part.setProperty(JAXBDataBinding.class.getName() + .CUSTOM_EXCEPTION, Boolean.TRUE); } -private void addExceptionMessage(Class? cls, XmlSchema schema, XmlSchemaSequence seq) { -try { -//a subclass could mark the message method as transient -Method m = cls.getMethod(getMessage); -if (!m.isAnnotationPresent(XmlTransient.class)) { -JAXBBeanInfo beanInfo = getBeanInfo(java.lang.String.class); -XmlSchemaElement exEle = new XmlSchemaElement(schema, false); -exEle.setName(message); -exEle.setSchemaTypeName(getTypeName(beanInfo)); -exEle.setMinOccurs(0); -seq.getItems().add(exEle); -} -} catch (Exception e) { -//ignore, just won't have the message element -} -} private boolean generateGenericType(Type type) { if (type instanceof ParameterizedType) {
[2/2] cxf git commit: Recording .gitmergeinfo Changes
Recording .gitmergeinfo Changes Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/bb5df0b7 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/bb5df0b7 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/bb5df0b7 Branch: refs/heads/2.7.x-fixes Commit: bb5df0b7631adf6fe7f54d634bdaea27ce892cbf Parents: aef8e5a Author: Alessio Soldano asold...@redhat.com Authored: Tue Nov 11 18:46:07 2014 +0100 Committer: Alessio Soldano asold...@redhat.com Committed: Tue Nov 11 18:46:07 2014 +0100 -- .gitmergeinfo | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/bb5df0b7/.gitmergeinfo -- diff --git a/.gitmergeinfo b/.gitmergeinfo index b45f868..71870c2 100644 --- a/.gitmergeinfo +++ b/.gitmergeinfo @@ -1684,6 +1684,7 @@ M 391ab2c4655aa7a1b58fa33ee73b90011ae9c1db M 39857567eaa4dab7fd986c85fed66130e8985724 M 39e35f4f5b57aabbb7b6e391107ce3787ca34358 M 39fc48120bc99a96ca6664f81138d5f8746b31ec +M 3a469d377d87a60439103f294010da6605476e70 M 3aaac231eed2eb123e71afb3d354b1d23169b228 M 3acbca4221ae1d75e31b16ab077a0b8361b4df86 M 3afead5e84ab41a564e973ade0cfcaa51c06
[2/2] cxf git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/cxf
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/cxf Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/cc27d5ba Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/cc27d5ba Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/cc27d5ba Branch: refs/heads/master Commit: cc27d5ba1c00adb4d9de7bf1333be41cf968a90b Parents: 8daf38e 4a292c0 Author: Sergey Beryozkin sberyoz...@talend.com Authored: Tue Nov 11 18:29:13 2014 + Committer: Sergey Beryozkin sberyoz...@talend.com Committed: Tue Nov 11 18:29:13 2014 + -- .../apache/cxf/jaxb/JAXBSchemaInitializer.java | 23 +--- 1 file changed, 1 insertion(+), 22 deletions(-) --
[1/2] cxf git commit: Minor updates to JOSE filters
Repository: cxf Updated Branches: refs/heads/master 4a292c0cc - cc27d5ba1 Minor updates to JOSE filters Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8daf38e7 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8daf38e7 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8daf38e7 Branch: refs/heads/master Commit: 8daf38e7c98c66e22cd38569f230bfc0b3bbb125 Parents: 6e0451e Author: Sergey Beryozkin sberyoz...@talend.com Authored: Tue Nov 11 18:28:40 2014 + Committer: Sergey Beryozkin sberyoz...@talend.com Committed: Tue Nov 11 18:28:40 2014 + -- .../cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java | 10 ++ .../cxf/rs/security/jose/jwe/JweCompactProducer.java | 3 ++- .../apache/cxf/rs/security/jose/jwe/JweOutputStream.java | 5 ++--- .../cxf/rs/security/jose/jws/JwsJsonOutputStream.java | 1 + .../apache/cxf/rs/security/jose/jws/JwsOutputStream.java | 1 + 5 files changed, 12 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/8daf38e7/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java -- diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java index cbe4aef..a50c6a5 100644 --- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java +++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java @@ -83,16 +83,18 @@ public class JweWriterInterceptor implements WriterInterceptor { } catch (IOException ex) { throw new SecurityException(ex); } -OutputStream jweStream = new JweOutputStream(actualOs, encryption.getCipher(), +OutputStream wrappedStream = null; +JweOutputStream jweOutputStream = new JweOutputStream(actualOs, encryption.getCipher(), encryption.getAuthTagProducer()); +wrappedStream = jweOutputStream; if (encryption.isCompressionSupported()) { -jweStream = new DeflaterOutputStream(jweStream); +wrappedStream = new DeflaterOutputStream(jweOutputStream); } -ctx.setOutputStream(jweStream); +ctx.setOutputStream(wrappedStream); ctx.proceed(); setJoseMediaType(ctx); -jweStream.flush(); +jweOutputStream.finalFlush(); } else { CachedOutputStream cos = new CachedOutputStream(); ctx.setOutputStream(cos); http://git-wip-us.apache.org/repos/asf/cxf/blob/8daf38e7/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweCompactProducer.java -- diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweCompactProducer.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweCompactProducer.java index 02b759a..0169fbe 100644 --- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweCompactProducer.java +++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweCompactProducer.java @@ -145,7 +145,8 @@ public class JweCompactProducer { encryptedContentEncryptionKey.length, os); os.write(dotBytes); Base64UrlUtility.encodeAndStream(cipherInitVector, 0, cipherInitVector.length, os); -os.write(dotBytes); +os.write(dotBytes); +os.flush(); } public String getJweContent() { http://git-wip-us.apache.org/repos/asf/cxf/blob/8daf38e7/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweOutputStream.java -- diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweOutputStream.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweOutputStream.java index c6462f1..e8faa37 100644 --- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweOutputStream.java +++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweOutputStream.java @@ -94,7 +94,7 @@ public class JweOutputStream extends FilterOutputStream { } int rem = finalWrite ? 0 : lenToEncode % 3; Base64UrlUtility.encodeAndStream(theChunk, off, lenToEncode - rem, out); - +out.flush(); if
cxf git commit: Minor updates to JOSE filters
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes 9053b7a86 - 467a9d933 Minor updates to JOSE filters Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/467a9d93 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/467a9d93 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/467a9d93 Branch: refs/heads/3.0.x-fixes Commit: 467a9d93355e8e87dc0b47d96499512bcee1b52b Parents: 9053b7a Author: Sergey Beryozkin sberyoz...@talend.com Authored: Tue Nov 11 18:28:40 2014 + Committer: Sergey Beryozkin sberyoz...@talend.com Committed: Tue Nov 11 18:30:35 2014 + -- .../cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java | 10 ++ .../cxf/rs/security/jose/jwe/JweCompactProducer.java | 3 ++- .../apache/cxf/rs/security/jose/jwe/JweOutputStream.java | 5 ++--- .../cxf/rs/security/jose/jws/JwsJsonOutputStream.java | 1 + .../apache/cxf/rs/security/jose/jws/JwsOutputStream.java | 1 + 5 files changed, 12 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/467a9d93/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java -- diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java index cbe4aef..a50c6a5 100644 --- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java +++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JweWriterInterceptor.java @@ -83,16 +83,18 @@ public class JweWriterInterceptor implements WriterInterceptor { } catch (IOException ex) { throw new SecurityException(ex); } -OutputStream jweStream = new JweOutputStream(actualOs, encryption.getCipher(), +OutputStream wrappedStream = null; +JweOutputStream jweOutputStream = new JweOutputStream(actualOs, encryption.getCipher(), encryption.getAuthTagProducer()); +wrappedStream = jweOutputStream; if (encryption.isCompressionSupported()) { -jweStream = new DeflaterOutputStream(jweStream); +wrappedStream = new DeflaterOutputStream(jweOutputStream); } -ctx.setOutputStream(jweStream); +ctx.setOutputStream(wrappedStream); ctx.proceed(); setJoseMediaType(ctx); -jweStream.flush(); +jweOutputStream.finalFlush(); } else { CachedOutputStream cos = new CachedOutputStream(); ctx.setOutputStream(cos); http://git-wip-us.apache.org/repos/asf/cxf/blob/467a9d93/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweCompactProducer.java -- diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweCompactProducer.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweCompactProducer.java index 02b759a..0169fbe 100644 --- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweCompactProducer.java +++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweCompactProducer.java @@ -145,7 +145,8 @@ public class JweCompactProducer { encryptedContentEncryptionKey.length, os); os.write(dotBytes); Base64UrlUtility.encodeAndStream(cipherInitVector, 0, cipherInitVector.length, os); -os.write(dotBytes); +os.write(dotBytes); +os.flush(); } public String getJweContent() { http://git-wip-us.apache.org/repos/asf/cxf/blob/467a9d93/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweOutputStream.java -- diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweOutputStream.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweOutputStream.java index c6462f1..e8faa37 100644 --- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweOutputStream.java +++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweOutputStream.java @@ -94,7 +94,7 @@ public class JweOutputStream extends FilterOutputStream { } int rem = finalWrite ? 0 : lenToEncode % 3; Base64UrlUtility.encodeAndStream(theChunk, off, lenToEncode - rem, out); - +out.flush();