cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf git commit: NPE fix
Date Mon, 13 Jul 2015 11:13:27 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 71c65e8cc -> b6da59447


NPE fix


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

Branch: refs/heads/3.0.x-fixes
Commit: b6da5944704b1075cc88d5b154786c059eefb447
Parents: 71c65e8
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Mon Jul 13 11:55:49 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Mon Jul 13 12:13:17 2015 +0100

----------------------------------------------------------------------
 .../wss4j/AlgorithmSuiteTranslater.java         | 54 ++++++++++----------
 1 file changed, 28 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/b6da5944/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AlgorithmSuiteTranslater.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AlgorithmSuiteTranslater.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AlgorithmSuiteTranslater.java
index 372dd89..083d2f6 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AlgorithmSuiteTranslater.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AlgorithmSuiteTranslater.java
@@ -101,37 +101,39 @@ public final class AlgorithmSuiteTranslater {
             }
             
             AlgorithmSuiteType algorithmSuiteType = cxfAlgorithmSuite.getAlgorithmSuiteType();
+            if (algorithmSuiteType != null) {
             // Set asymmetric key lengths
-            if (algorithmSuite.getMaximumAsymmetricKeyLength() 
-                < algorithmSuiteType.getMaximumAsymmetricKeyLength()) {
-                algorithmSuite.setMaximumAsymmetricKeyLength(
-                    algorithmSuiteType.getMaximumAsymmetricKeyLength());
-            }
-            if (algorithmSuite.getMinimumAsymmetricKeyLength() 
-                > algorithmSuiteType.getMinimumAsymmetricKeyLength()) {
-                algorithmSuite.setMinimumAsymmetricKeyLength(
-                    algorithmSuiteType.getMinimumAsymmetricKeyLength());
-            }
-            
-            // Set symmetric key lengths
-            if (algorithmSuite.getMaximumSymmetricKeyLength() 
-                < algorithmSuiteType.getMaximumSymmetricKeyLength()) {
-                algorithmSuite.setMaximumSymmetricKeyLength(
-                    algorithmSuiteType.getMaximumSymmetricKeyLength());
-            }
-            if (algorithmSuite.getMinimumSymmetricKeyLength() 
-                > algorithmSuiteType.getMinimumSymmetricKeyLength()) {
-                algorithmSuite.setMinimumSymmetricKeyLength(
-                    algorithmSuiteType.getMinimumSymmetricKeyLength());
-            }
+                if (algorithmSuite.getMaximumAsymmetricKeyLength() 
+                    < algorithmSuiteType.getMaximumAsymmetricKeyLength()) {
+                    algorithmSuite.setMaximumAsymmetricKeyLength(
+                        algorithmSuiteType.getMaximumAsymmetricKeyLength());
+                }
+                if (algorithmSuite.getMinimumAsymmetricKeyLength() 
+                    > algorithmSuiteType.getMinimumAsymmetricKeyLength()) {
+                    algorithmSuite.setMinimumAsymmetricKeyLength(
+                        algorithmSuiteType.getMinimumAsymmetricKeyLength());
+                }
                 
-            algorithmSuite.addEncryptionMethod(algorithmSuiteType.getEncryption());
-            algorithmSuite.addKeyWrapAlgorithm(algorithmSuiteType.getSymmetricKeyWrap());
-            algorithmSuite.addKeyWrapAlgorithm(algorithmSuiteType.getAsymmetricKeyWrap());
+                // Set symmetric key lengths
+                if (algorithmSuite.getMaximumSymmetricKeyLength() 
+                    < algorithmSuiteType.getMaximumSymmetricKeyLength()) {
+                    algorithmSuite.setMaximumSymmetricKeyLength(
+                        algorithmSuiteType.getMaximumSymmetricKeyLength());
+                }
+                if (algorithmSuite.getMinimumSymmetricKeyLength() 
+                    > algorithmSuiteType.getMinimumSymmetricKeyLength()) {
+                    algorithmSuite.setMinimumSymmetricKeyLength(
+                        algorithmSuiteType.getMinimumSymmetricKeyLength());
+                }
+                    
+                algorithmSuite.addEncryptionMethod(algorithmSuiteType.getEncryption());
+                algorithmSuite.addKeyWrapAlgorithm(algorithmSuiteType.getSymmetricKeyWrap());
+                algorithmSuite.addKeyWrapAlgorithm(algorithmSuiteType.getAsymmetricKeyWrap());
+                algorithmSuite.addDigestAlgorithm(algorithmSuiteType.getDigest());
+            }
     
             algorithmSuite.addSignatureMethod(cxfAlgorithmSuite.getAsymmetricSignature());
             algorithmSuite.addSignatureMethod(cxfAlgorithmSuite.getSymmetricSignature());
-            algorithmSuite.addDigestAlgorithm(algorithmSuiteType.getDigest());
             algorithmSuite.addC14nAlgorithm(cxfAlgorithmSuite.getC14n().getValue());
     
             algorithmSuite.addTransformAlgorithm(cxfAlgorithmSuite.getC14n().getValue());


Mime
View raw message