Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b23f14eb authored by David Zeuthen's avatar David Zeuthen Committed by Automerger Merge Worker
Browse files

identity: Don't pass invalid profileIds in VTS test. am: 1b8be716

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1721603

Change-Id: I05b8f9dc2a8e63727ded9424fc0d8e2ba3b37c7d
parents bb1b56ab 1b8be716
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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"));
+1 −1
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ void DeleteCredentialTests::provisionData() {
    ASSERT_TRUE(wc->addAccessControlProfile(1, {}, false, 0, 0, &sacp).isOk());

    // Single entry - don't care about the returned encrypted data
    ASSERT_TRUE(wc->beginAddEntry({0}, "ns", "Some Data", 1).isOk());
    ASSERT_TRUE(wc->beginAddEntry({1}, "ns", "Some Data", 1).isOk());
    vector<uint8_t> encryptedData;
    ASSERT_TRUE(wc->addEntryValue({9}, &encryptedData).isOk());

+1 −1
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ void ProveOwnershipTests::provisionData() {
    ASSERT_TRUE(wc->addAccessControlProfile(1, {}, false, 0, 0, &sacp).isOk());

    // Single entry - don't care about the returned encrypted data
    ASSERT_TRUE(wc->beginAddEntry({0}, "ns", "Some Data", 1).isOk());
    ASSERT_TRUE(wc->beginAddEntry({1}, "ns", "Some Data", 1).isOk());
    vector<uint8_t> encryptedData;
    ASSERT_TRUE(wc->addEntryValue({9}, &encryptedData).isOk());