Commit 9abfeaca authored by Brian Carlstrom's avatar Brian Carlstrom Committed by Android (Google) Code Review
Browse files

Merge "Fix backwards Engine cache test" into ics-mr0

parents bea6b3d2 17b6b6b0
......@@ -139,7 +139,7 @@ public class Engine {
ServiceCacheEntry cacheEntry = this.serviceCache;
if (cacheEntry != null
&& cacheEntry.algorithm.equalsIgnoreCase(algorithm)
&& Services.refreshNumber != cacheEntry.refreshNumber) {
&& Services.refreshNumber == cacheEntry.refreshNumber) {
service = cacheEntry.service;
} else {
if (Services.isEmpty()) {
......
......@@ -94,7 +94,8 @@ public class SignatureTestMD2withRSA extends TestCase {
@AndroidOnly("Android allows usage of MD2withRSA in third party providers")
public void testSignature2() throws Exception{
Security.addProvider(new MyProvider());
Provider provider = new MyProvider();
Security.addProvider(provider);
Signature signature = Signature.getInstance("MD2withRSA");
signature = Signature.getInstance("MD2WithRSA");
......@@ -104,6 +105,8 @@ public class SignatureTestMD2withRSA extends TestCase {
signature = Signature.getInstance("MD2WITHRSAENCRYPTION");
signature = Signature.getInstance("MD2/RSA");
signature = Signature.getInstance("1.2.840.113549.1.1.2");
Security.removeProvider(provider.getName());
}
public final class MyProvider extends Provider {
......
......@@ -616,6 +616,8 @@ public class CertificateTest extends TestCase {
fail("MD2 should not be allowed");
} catch (NoSuchAlgorithmException e) {
// expected
} catch (Throwable e) {
throw new AssertionError(provider.getName(), e);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment