cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6993] Minor improvements
Date Thu, 23 Mar 2017 16:02:33 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 30c76de21 -> 8e90865f6


[CXF-6993] Minor improvements


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8e90865f
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8e90865f
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8e90865f

Branch: refs/heads/3.1.x-fixes
Commit: 8e90865f6bea6a764193367c57a4a42c2276cc41
Parents: 30c76de
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Thu Mar 23 16:00:46 2017 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Thu Mar 23 16:02:15 2017 +0000

----------------------------------------------------------------------
 .../security/jose/jwe/AbstractContentEncryptionAlgorithm.java  | 4 +++-
 .../java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java     | 6 +++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/8e90865f/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractContentEncryptionAlgorithm.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractContentEncryptionAlgorithm.java
b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractContentEncryptionAlgorithm.java
index af25eac..bfb6a3f 100644
--- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractContentEncryptionAlgorithm.java
+++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractContentEncryptionAlgorithm.java
@@ -53,7 +53,9 @@ public abstract class AbstractContentEncryptionAlgorithm extends AbstractContent
             theCek = CryptoUtils.getSecretKey(AlgorithmUtils.stripAlgoProperties(algoJava),
                           getContentEncryptionKeySize(headers)).getEncoded();
             if (generateCekOnce) {
-                cek = theCek;
+                synchronized (this) {
+                    cek = theCek;
+                }
             }
         } else {
             theCek = cek;

http://git-wip-us.apache.org/repos/asf/cxf/blob/8e90865f/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java
b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java
index b442e53..035ec17 100644
--- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java
+++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java
@@ -269,8 +269,12 @@ public final class JweUtils {
         return null;
     }
     public static ContentEncryptionProvider getContentEncryptionProvider(ContentAlgorithm
algorithm) {
+        return getContentEncryptionProvider(algorithm, false);
+    }
+    public static ContentEncryptionProvider getContentEncryptionProvider(ContentAlgorithm
algorithm, 
+                                                                         boolean generateCekOnce)
{
         if (AlgorithmUtils.isAesGcm(algorithm.getJwaName())) {
-            return new AesGcmContentEncryptionAlgorithm(algorithm);
+            return new AesGcmContentEncryptionAlgorithm(algorithm, generateCekOnce);
         }
         return null;
     }


Mime
View raw message