diff options
Diffstat (limited to 'luni/src/test/java/libcore/javax/crypto/CipherTest.java')
-rw-r--r-- | luni/src/test/java/libcore/javax/crypto/CipherTest.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/luni/src/test/java/libcore/javax/crypto/CipherTest.java b/luni/src/test/java/libcore/javax/crypto/CipherTest.java index f995a7cba09..6592eb52edd 100644 --- a/luni/src/test/java/libcore/javax/crypto/CipherTest.java +++ b/luni/src/test/java/libcore/javax/crypto/CipherTest.java @@ -68,8 +68,27 @@ import junit.framework.TestCase; import libcore.java.security.StandardNames; import libcore.java.security.TestKeyStore; +import dalvik.system.VMRuntime; +import sun.security.jca.Providers; + public final class CipherTest extends TestCase { + // Allow access to deprecated BC algorithms in this test, so we can ensure they + // continue to work + @Override + public void setUp() throws Exception { + super.setUp(); + Providers.setMaximumAllowableApiLevelForBcDeprecation( + VMRuntime.getRuntime().getTargetSdkVersion()); + } + + @Override + public void tearDown() throws Exception { + Providers.setMaximumAllowableApiLevelForBcDeprecation( + Providers.DEFAULT_MAXIMUM_ALLOWABLE_TARGET_API_LEVEL_FOR_BC_DEPRECATION); + super.tearDown(); + } + /** GCM tag size used for tests. */ private static final int GCM_TAG_SIZE_BITS = 96; |