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:48:50 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/6d630272
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6d630272
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6d630272

Branch: refs/heads/master
Commit: 6d6302720706434c10b8581bc2d06b19db8fb7ed
Parents: 2f9874b
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:47:27 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/6d630272/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/6d630272/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/6d630272/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 ce13422..c93fb0e 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
@@ -92,7 +92,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/6d630272/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 a5c178c..c5d7d58 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
@@ -65,7 +65,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/6d630272/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 bc5f556..86c1425 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
@@ -156,7 +156,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/6d630272/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 56cd65a..8898bf0 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
@@ -36,7 +36,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/6d630272/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/6d630272/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/6d630272/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 4af6fa8..3d558d5 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
@@ -75,7 +75,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/6d630272/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 989d1ab..33f55737 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
@@ -70,7 +70,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