diff options
author | Alex Klyubin <klyubin@google.com> | 2015-04-15 20:02:25 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-04-15 20:02:25 +0000 |
commit | bceeae5a7f0894ab723955cc49a66066c2e10db0 (patch) | |
tree | 7f89456cb3d85f0c90437f3936f83cf6a2bf6d79 /luni | |
parent | 29faa03fc0ac5733a82f0f098aabd41848abe1f2 (diff) | |
parent | 1c36e9665d7462715a01f1936ec1805125e83e57 (diff) | |
download | libcore-bceeae5a7f0894ab723955cc49a66066c2e10db0.zip libcore-bceeae5a7f0894ab723955cc49a66066c2e10db0.tar.gz libcore-bceeae5a7f0894ab723955cc49a66066c2e10db0.tar.bz2 |
Merge "Unbreak Harmony MacTest."
Diffstat (limited to 'luni')
-rw-r--r-- | luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/MacTest.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/MacTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/MacTest.java index 9b7dc18..e90452d 100644 --- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/MacTest.java +++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/MacTest.java @@ -100,6 +100,12 @@ public class MacTest extends TestCase { macList.add(Mac.getInstance(defaultAlgorithm, defaultProvider)); macList.add(Mac.getInstance(defaultAlgorithm, defaultProviderName)); for (Provider p : Security.getProviders("Mac." + defaultAlgorithm)) { + // Do not test AndroidKeyStore's Mac. It cannot be initialized without providing an + // AndroidKeyStore-backed SecretKey instance. It's OKish not to test here because it's + // tested by cts/tests/test/keystore. + if ("AndroidKeyStore".equals(p.getName())) { + continue; + } macList.add(Mac.getInstance(defaultAlgorithm, p)); } return macList.toArray(new Mac[macList.size()]); @@ -845,6 +851,13 @@ public class MacTest extends TestCase { byte[] output = null; byte[] output2 = null; for (int i = 0; i < providers.length; i++) { + // Do not test AndroidKeyStore's Mac. It cannot be initialized without providing an + // AndroidKeyStore-backed SecretKey instance. It's OKish not to test here because it's + // tested by cts/tests/test/keystore. + if ("AndroidKeyStore".equals(providers[i].getName())) { + continue; + } + System.out.println("provider = " + providers[i].getName()); Mac mac = Mac.getInstance("HmacMD5", providers[i]); mac.init(key); |