cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [3/3] cxf git commit: Unregister BouncyCastle properly
Date Thu, 15 Oct 2015 13:53:20 GMT
Unregister BouncyCastle properly


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

Branch: refs/heads/3.0.x-fixes
Commit: 7a02829e62aa273db3e0966ee961ae6f0c25183a
Parents: e139b83
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Thu Oct 15 14:47:27 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Thu Oct 15 14:49:32 2015 +0100

----------------------------------------------------------------------
 .../cxf/rs/security/jose/jwe/AbstractJweEncryption.java      | 1 +
 .../cxf/rs/security/jose/cookbook/JwsJoseCookBookTest.java   | 8 ++++----
 .../cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java | 2 +-
 .../apache/cxf/rs/security/jose/jwe/JweJsonConsumerTest.java | 2 +-
 .../apache/cxf/rs/security/jose/jwe/JweJsonProducerTest.java | 2 +-
 .../cxf/rs/security/jose/jwe/JwePbeHmacAesWrapTest.java      | 2 +-
 .../org/apache/cxf/rs/security/jose/jwk/JsonWebKeyTest.java  | 4 ++--
 .../cxf/rs/security/jose/jws/JwsCompactReaderWriterTest.java | 2 +-
 .../cxf/systest/jaxrs/security/jwt/JAXRSJweJwsTest.java      | 2 +-
 .../cxf/systest/jaxrs/security/jwt/JAXRSJwsJsonTest.java     | 2 +-
 10 files changed, 14 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/7a02829e/rt/rs/security/jose/jose-core/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractJweEncryption.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/jose-core/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractJweEncryption.java
b/rt/rs/security/jose/jose-core/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractJweEncryption.java
index 561df8d..acc9933 100644
--- a/rt/rs/security/jose/jose-core/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractJweEncryption.java
+++ b/rt/rs/security/jose/jose-core/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractJweEncryption.java
@@ -128,6 +128,7 @@ public abstract class AbstractJweEncryption implements JweEncryptionProvider
{
         try {
             return CryptoUtils.encryptBytes(content, createCekSecretKey(state), state.keyProps);
         } catch (SecurityException ex) {
+            LOG.fine(ex.getMessage());
             if (ex.getCause() instanceof NoSuchAlgorithmException) {
                 LOG.warning("Unsupported algorithm: " + state.keyProps.getKeyAlgo());
                 throw new JweException(JweException.Error.INVALID_CONTENT_ALGORITHM);

http://git-wip-us.apache.org/repos/asf/cxf/blob/7a02829e/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/cookbook/JwsJoseCookBookTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/cookbook/JwsJoseCookBookTest.java
b/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/cookbook/JwsJoseCookBookTest.java
index 1c1bb04..40fb210 100644
--- a/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/cookbook/JwsJoseCookBookTest.java
+++ b/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/cookbook/JwsJoseCookBookTest.java
@@ -434,7 +434,7 @@ public class JwsJoseCookBookTest {
         jsonConsumer = new JwsJsonConsumer(jsonProducer.getJwsJsonSignedDocument());
         assertTrue(jsonConsumer.verifySignatureWith(rsaPublicKey, SignatureAlgorithm.PS384));
 
-        Security.removeProvider(BouncyCastleProvider.class.getName());
+        Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);
     }
     @Test
     public void testECDSASignature() throws Exception {
@@ -468,7 +468,7 @@ public class JwsJoseCookBookTest {
             JsonWebKey ecPublicKey = publicKeys.get(0);
             assertTrue(compactConsumer.verifySignatureWith(ecPublicKey, SignatureAlgorithm.ES512));
         } finally {
-            Security.removeProvider(BouncyCastleProvider.class.getName());
+            Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);
         }
     }
     @Test
@@ -654,7 +654,7 @@ public class JwsJoseCookBookTest {
             assertTrue(jsonConsumer.verifySignatureWith(ecPublicKey, SignatureAlgorithm.ES512));
             assertTrue(jsonConsumer.verifySignatureWith(hmacKey, SignatureAlgorithm.HS256));
         } finally {
-            Security.removeProvider(BouncyCastleProvider.class.getName());
+            Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);
         }
     }
     public JsonWebKeys readKeySet(String fileName) throws Exception {
@@ -662,4 +662,4 @@ public class JwsJoseCookBookTest {
         String s = IOUtils.readStringFromStream(is);
         return JwkUtils.readJwkSet(s);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/7a02829e/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
b/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
index 8f8c147..2cdda1a 100644
--- a/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
+++ b/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
@@ -103,7 +103,7 @@ public class JweCompactReaderWriterTest extends Assert {
     }
     @AfterClass
     public static void unregisterBouncyCastleIfNeeded() throws Exception {
-        Security.removeProvider(BouncyCastleProvider.class.getName());    
+        Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);    
     }
     
     @Test

http://git-wip-us.apache.org/repos/asf/cxf/blob/7a02829e/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumerTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumerTest.java
b/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumerTest.java
index 580c886..de7bc94 100644
--- a/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumerTest.java
+++ b/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumerTest.java
@@ -73,7 +73,7 @@ public class JweJsonConsumerTest extends Assert {
     }
     @AfterClass
     public static void unregisterBouncyCastleIfNeeded() throws Exception {
-        Security.removeProvider(BouncyCastleProvider.class.getName());    
+        Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);    
     }
     
     @Test

http://git-wip-us.apache.org/repos/asf/cxf/blob/7a02829e/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonProducerTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonProducerTest.java
b/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonProducerTest.java
index fda8879..c3ac760 100644
--- a/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonProducerTest.java
+++ b/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonProducerTest.java
@@ -165,7 +165,7 @@ public class JweJsonProducerTest extends Assert {
     }
     @AfterClass
     public static void unregisterBouncyCastleIfNeeded() throws Exception {
-        Security.removeProvider(BouncyCastleProvider.class.getName());    
+        Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);    
     }
     
     @Test

http://git-wip-us.apache.org/repos/asf/cxf/blob/7a02829e/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwe/JwePbeHmacAesWrapTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwe/JwePbeHmacAesWrapTest.java
b/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwe/JwePbeHmacAesWrapTest.java
index 8c8ef41..b8aad88 100644
--- a/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwe/JwePbeHmacAesWrapTest.java
+++ b/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwe/JwePbeHmacAesWrapTest.java
@@ -42,7 +42,7 @@ public class JwePbeHmacAesWrapTest extends Assert {
     }
     @After
     public void unregisterBouncyCastleIfNeeded() throws Exception {
-        Security.removeProvider(BouncyCastleProvider.class.getName());    
+        Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);    
     }
     @Test
     public void testEncryptDecryptPbesHmacAesWrapA128CBCHS256() throws Exception {

http://git-wip-us.apache.org/repos/asf/cxf/blob/7a02829e/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwk/JsonWebKeyTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwk/JsonWebKeyTest.java
b/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwk/JsonWebKeyTest.java
index 6a60fc9..e647d51 100644
--- a/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwk/JsonWebKeyTest.java
+++ b/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jwk/JsonWebKeyTest.java
@@ -137,7 +137,7 @@ public class JsonWebKeyTest extends Assert {
             jwks = JwkUtils.decryptJwkSet(encryptedKeySet, password.toCharArray());
             validatePrivateSet(jwks);
         } finally {
-            Security.removeProvider(BouncyCastleProvider.class.getName());
+            Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);
         }
     }
     @Test
@@ -161,7 +161,7 @@ public class JsonWebKeyTest extends Assert {
             jwk = JwkUtils.decryptJwkKey(encryptedKey, password.toCharArray());
             validateSecretAesKey(jwk);
         } finally {
-            Security.removeProvider(BouncyCastleProvider.class.getName());
+            Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);
         }
     }
     

http://git-wip-us.apache.org/repos/asf/cxf/blob/7a02829e/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jws/JwsCompactReaderWriterTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jws/JwsCompactReaderWriterTest.java
b/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jws/JwsCompactReaderWriterTest.java
index 79e4ce2..de733c5 100644
--- a/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jws/JwsCompactReaderWriterTest.java
+++ b/rt/rs/security/jose/jose-core/src/test/java/org/apache/cxf/rs/security/jose/jws/JwsCompactReaderWriterTest.java
@@ -250,7 +250,7 @@ public class JwsCompactReaderWriterTest extends Assert {
                          inHeaders.getSignatureAlgorithm());
             validateSpecClaim(token.getClaims());
         } finally {
-            Security.removeProvider(BouncyCastleProvider.class.getName());
+            Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);
         }
     }
     

http://git-wip-us.apache.org/repos/asf/cxf/blob/7a02829e/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 6b4a461..e69191b 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
@@ -81,7 +81,7 @@ public class JAXRSJweJwsTest extends AbstractBusClientServerTestBase {
     }
     @AfterClass
     public static void unregisterBouncyCastleIfNeeded() throws Exception {
-        Security.removeProvider(BouncyCastleProvider.class.getName());    
+        Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);    
     }
     @Test
     public void testJweJwkPlainTextRSA() throws Exception {

http://git-wip-us.apache.org/repos/asf/cxf/blob/7a02829e/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJwsJsonTest.java
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJwsJsonTest.java
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJwsJsonTest.java
index 5ba9dfa..91cc064 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJwsJsonTest.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jwt/JAXRSJwsJsonTest.java
@@ -75,7 +75,7 @@ public class JAXRSJwsJsonTest extends AbstractBusClientServerTestBase {
     }
     @AfterClass
     public static void unregisterBouncyCastleIfNeeded() throws Exception {
-        Security.removeProvider(BouncyCastleProvider.class.getName());    
+        Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);    
     }
     
     @Test


Mime
View raw message