cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf git commit: Some minor merges, disable a test on IBM JDK
Date Mon, 08 Dec 2014 16:12:53 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 922dcbd1b -> 5c8645a4d


Some minor merges, disable a test on IBM JDK


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

Branch: refs/heads/master
Commit: 5c8645a4d5efdd09a6bc7e3badd0125bb92b2f2f
Parents: 922dcbd
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Mon Dec 8 16:12:09 2014 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Mon Dec 8 16:12:31 2014 +0000

----------------------------------------------------------------------
 .../org/apache/cxf/common/util/crypto/MessageDigestUtils.java | 6 ++----
 rt/rs/security/jose/pom.xml                                   | 2 +-
 .../cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java  | 7 ++++++-
 3 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/5c8645a4/core/src/main/java/org/apache/cxf/common/util/crypto/MessageDigestUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/crypto/MessageDigestUtils.java
b/core/src/main/java/org/apache/cxf/common/util/crypto/MessageDigestUtils.java
index 314f791..24b096b 100644
--- a/core/src/main/java/org/apache/cxf/common/util/crypto/MessageDigestUtils.java
+++ b/core/src/main/java/org/apache/cxf/common/util/crypto/MessageDigestUtils.java
@@ -43,7 +43,7 @@ public final class MessageDigestUtils {
     public static String generate(byte[] input, String algo) {    
         try {
             byte[] messageDigest = createDigest(input, algo);
-            StringBuffer hexString = new StringBuffer();
+            StringBuilder hexString = new StringBuilder();
             for (int i = 0; i < messageDigest.length; i++) {
                 hexString.append(Integer.toHexString(0xFF & messageDigest[i]));
             }
@@ -66,9 +66,7 @@ public final class MessageDigestUtils {
     
     public static byte[] createDigest(byte[] input, String algo) throws NoSuchAlgorithmException
{ 
         MessageDigest md = MessageDigest.getInstance(algo);
-        md.reset();
-        md.update(input);
-        return md.digest();
+        return md.digest(input);
     }
     
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/5c8645a4/rt/rs/security/jose/pom.xml
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/pom.xml b/rt/rs/security/jose/pom.xml
index 776686b..11d693b 100644
--- a/rt/rs/security/jose/pom.xml
+++ b/rt/rs/security/jose/pom.xml
@@ -51,7 +51,7 @@
             <artifactId>bcprov-ext-jdk15on</artifactId>
             <version>${cxf.bcprov.version}</version>
             <scope>provided</scope>
-         <optional>true</optional> 
+            <optional>true</optional> 
         </dependency>
         <!--test dependencies-->
         <dependency>

http://git-wip-us.apache.org/repos/asf/cxf/blob/5c8645a4/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
b/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
index 41063f7..abf6e5a 100644
--- a/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
+++ b/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
@@ -31,7 +31,6 @@ import org.apache.cxf.rs.security.jose.JoseConstants;
 import org.apache.cxf.rs.security.jose.jwa.Algorithm;
 import org.apache.cxf.rs.security.jose.jws.JwsCompactReaderWriterTest;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
-
 import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.BeforeClass;
@@ -117,6 +116,12 @@ public class JweCompactReaderWriterTest extends Assert {
     }
     @Test
     public void testEncryptDecryptAesGcmWrapA128CBCHS256() throws Exception {
+        //
+        // This test fails with the IBM JDK
+        //
+        if ("IBM Corporation".equals(System.getProperty("java.vendor"))) {
+            return;
+        }
         final String specPlainText = "Live long and prosper.";
         JweHeaders headers = new JweHeaders();
         headers.setAlgorithm(JoseConstants.A128GCMKW_ALGO);


Mime
View raw message