Fix limited use key keymint vts test when using
pure software keymaster context to pretend some sort of hardwares.

When hardware can't enforce the authorizations, it should put all
of these into keystore list.

Test: atest -c VtsAidlKeyMintTargetTest
when modify securitylevel from software to trusted_environment

Change-Id: I100559fb75634f0755d6d8b6886d189d4e87baf2
diff --git a/ng/AndroidKeyMintDevice.cpp b/ng/AndroidKeyMintDevice.cpp
index 690abf2..9cc32d4 100644
--- a/ng/AndroidKeyMintDevice.cpp
+++ b/ng/AndroidKeyMintDevice.cpp
@@ -41,10 +41,11 @@
     KeyCharacteristics keyMintEnforced{keyMintSecurityLevel, {}};
 
     if (keyMintSecurityLevel != SecurityLevel::SOFTWARE) {
-        // We're pretending to be TRUSTED_ENVIRONMENT or STRONGBOX.  Only the entries in hw_enforced
-        // should be returned.
+        // We're pretending to be TRUSTED_ENVIRONMENT or STRONGBOX.
         keyMintEnforced.authorizations = kmParamSet2Aidl(hw_enforced);
-        return {std::move(keyMintEnforced)};
+        // Put all the software authorizations in the keystore list.
+        KeyCharacteristics keystoreEnforced{SecurityLevel::KEYSTORE, kmParamSet2Aidl(sw_enforced)};
+        return {std::move(keyMintEnforced), std::move(keystoreEnforced)};
     }
 
     KeyCharacteristics keystoreEnforced{SecurityLevel::KEYSTORE, {}};