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

Commit bb32140a authored by David Drysdale's avatar David Drysdale Committed by Automerger Merge Worker
Browse files

Merge changes from topic "cherrypicker-L84900000961803500:N52200001385298444"...

Merge changes from topic "cherrypicker-L84900000961803500:N52200001385298444" into stage-aosp-udc-ts-dev am: 85105d09 am: fd246a3a

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



Change-Id: I9a8dea0b8ad4b6a7b63a7202835c475090e59e6b
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6d11e19f fd246a3a
Loading
Loading
Loading
Loading
+10 −14
Original line number Original line Diff line number Diff line
@@ -2155,31 +2155,27 @@ void p256_pub_key(const vector<uint8_t>& coseKeyData, EVP_PKEY_Ptr* signingKey)


// Check the error code from an attempt to perform device ID attestation with an invalid value.
// Check the error code from an attempt to perform device ID attestation with an invalid value.
void device_id_attestation_check_acceptable_error(Tag tag, const ErrorCode& result) {
void device_id_attestation_check_acceptable_error(Tag tag, const ErrorCode& result) {
    // Standard/default error code for ID mismatch.
    if (result == ErrorCode::CANNOT_ATTEST_IDS) {
    if (result == ErrorCode::CANNOT_ATTEST_IDS) {
        return;
        // Standard/default error code for ID mismatch.
    }
    } else if (result == ErrorCode::INVALID_TAG) {

        // Depending on the situation, other error codes may be acceptable.  First, allow older
        // Depending on the situation, other error codes may be acceptable.  First, allow older
        // implementations to use INVALID_TAG.
        // implementations to use INVALID_TAG.
    if (result == ErrorCode::INVALID_TAG) {
        ASSERT_FALSE(get_vsr_api_level() > __ANDROID_API_T__)
        ASSERT_FALSE(get_vsr_api_level() > __ANDROID_API_T__)
                << "It is a specification violation for INVALID_TAG to be returned due to ID "
                << "It is a specification violation for INVALID_TAG to be returned due to ID "
                << "mismatch in a Device ID Attestation call. INVALID_TAG is only intended to "
                << "mismatch in a Device ID Attestation call. INVALID_TAG is only intended to "
                << "be used for a case where updateAad() is called after update(). As of "
                << "be used for a case where updateAad() is called after update(). As of "
                << "VSR-14, this is now enforced as an error.";
                << "VSR-14, this is now enforced as an error.";
    }
    } else if (result == ErrorCode::ATTESTATION_IDS_NOT_PROVISIONED) {

        // If the device is not a phone, it will not have IMEI/MEID values available.  Allow
        // If the device is not a phone, it will not have IMEI/MEID values available.  Allow
        // ATTESTATION_IDS_NOT_PROVISIONED in this case.
        // ATTESTATION_IDS_NOT_PROVISIONED in this case.
    if (result == ErrorCode::ATTESTATION_IDS_NOT_PROVISIONED) {
        ASSERT_TRUE((tag == TAG_ATTESTATION_ID_IMEI || tag == TAG_ATTESTATION_ID_MEID ||
        ASSERT_TRUE((tag == TAG_ATTESTATION_ID_IMEI || tag == TAG_ATTESTATION_ID_MEID ||
                     tag == TAG_ATTESTATION_ID_SECOND_IMEI))
                     tag == TAG_ATTESTATION_ID_SECOND_IMEI))
                << "incorrect error code on attestation ID mismatch";
                << "incorrect error code on attestation ID mismatch";
    }
    } else {
        ADD_FAILURE() << "Error code " << result
        ADD_FAILURE() << "Error code " << result
                      << " returned on attestation ID mismatch, should be CANNOT_ATTEST_IDS";
                      << " returned on attestation ID mismatch, should be CANNOT_ATTEST_IDS";
    }
    }
}


// Check whether the given named feature is available.
// Check whether the given named feature is available.
bool check_feature(const std::string& name) {
bool check_feature(const std::string& name) {