OSDN Git Service

Fix testAuthNeeded test
authorChad Brubaker <cbrubaker@google.com>
Thu, 7 May 2015 18:31:32 +0000 (11:31 -0700)
committerChad Brubaker <cbrubaker@google.com>
Thu, 7 May 2015 18:31:32 +0000 (11:31 -0700)
begin now returns OP_AUTH_REQUIRED for per operations with per op
authorization instead of NO_ERROR.

Change-Id: I1f472125f46155833e03ab30bf18363ff51b2c58

keystore/tests/src/android/security/KeyStoreTest.java

index 916b1ba..f3c4787 100644 (file)
@@ -944,7 +944,8 @@ public class KeyStoreTest extends ActivityUnitTestCase<Activity> {
         assertEquals("Generate should succeed", KeyStore.NO_ERROR, rc);
         OperationResult result = mKeyStore.begin(name, KeymasterDefs.KM_PURPOSE_ENCRYPT,
                 true, args, null, out);
-        assertEquals("Begin should succeed", KeyStore.NO_ERROR, result.resultCode);
+        assertEquals("Begin should expect authorization", KeyStore.OP_AUTH_NEEDED,
+                result.resultCode);
         IBinder token = result.token;
         result = mKeyStore.update(token, null, new byte[] {0x01, 0x02, 0x03, 0x04});
         assertEquals("Update should require authorization",