diff --git a/security/keymint/support/remote_prov_utils_test.cpp b/security/keymint/support/remote_prov_utils_test.cpp index 630f7bba56..89469f11ad 100644 --- a/security/keymint/support/remote_prov_utils_test.cpp +++ b/security/keymint/support/remote_prov_utils_test.cpp @@ -14,20 +14,23 @@ * limitations under the License. */ -#include "cppbor.h" -#include "keymaster/cppcose/cppcose.h" #include #include +#include #include -#include #include #include #include +#include #include #include #include #include +#include +#include +#include + namespace aidl::android::hardware::security::keymint::remote_prov { namespace { @@ -36,7 +39,11 @@ using ::keymaster::kStatusFailed; using ::keymaster::kStatusInvalidEek; using ::keymaster::StatusOr; using ::testing::ElementsAreArray; -using byte_view = std::basic_string_view; +using byte_view = std::span; + +inline bool equal_byte_views(const byte_view& view1, const byte_view& view2) { + return std::equal(view1.begin(), view1.end(), view2.begin(), view2.end()); +} struct KeyInfoEcdsa { CoseKeyCurve curve; @@ -44,7 +51,8 @@ struct KeyInfoEcdsa { byte_view pubKeyY; bool operator==(const KeyInfoEcdsa& other) const { - return curve == other.curve && pubKeyX == other.pubKeyX && pubKeyY == other.pubKeyY; + return curve == other.curve && equal_byte_views(pubKeyX, other.pubKeyX) && + equal_byte_views(pubKeyY, other.pubKeyY); } };