diff options
author | Scott Lobdell <slobdell@google.com> | 2021-06-04 18:02:44 +0000 |
---|---|---|
committer | Scott Lobdell <slobdell@google.com> | 2021-06-04 18:02:44 +0000 |
commit | c85bde0398d2a185e66a61cdabd26e5435bb4807 (patch) | |
tree | 3d9efc2d95fccc971f519d1d323a19a4621683cd /identity/aidl/default/common/WritableIdentityCredential.cpp | |
parent | a01a9128380dad45a28f4740a57136a058eb9d12 (diff) | |
parent | e013dd1a8b8f0df65b20c4de224effa1a7fcc61b (diff) |
Merge SP1A.210604.001
Change-Id: I78feee65e602d45bb0e3e90536729623b0f3d4f5
Diffstat (limited to 'identity/aidl/default/common/WritableIdentityCredential.cpp')
-rw-r--r-- | identity/aidl/default/common/WritableIdentityCredential.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/identity/aidl/default/common/WritableIdentityCredential.cpp b/identity/aidl/default/common/WritableIdentityCredential.cpp index 25f129b14b..200ee61df4 100644 --- a/identity/aidl/default/common/WritableIdentityCredential.cpp +++ b/identity/aidl/default/common/WritableIdentityCredential.cpp @@ -210,6 +210,15 @@ ndk::ScopedAStatus WritableIdentityCredential::beginAddEntry( "numAccessControlProfileRemaining_ is not zero")); } + // Ensure passed-in profile ids reference valid access control profiles + for (const int32_t id : accessControlProfileIds) { + if (accessControlProfileIds_.find(id) == accessControlProfileIds_.end()) { + return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage( + IIdentityCredentialStore::STATUS_INVALID_DATA, + "An id in accessControlProfileIds references non-existing ACP")); + } + } + if (remainingEntryCounts_.size() == 0) { return ndk::ScopedAStatus(AStatus_fromServiceSpecificErrorWithMessage( IIdentityCredentialStore::STATUS_INVALID_DATA, "No more namespaces to add to")); |