diff --git a/keymaster/4.0/vts/functional/HmacKeySharingTest.cpp b/keymaster/4.0/vts/functional/HmacKeySharingTest.cpp index f57a6682f9..1bff076859 100644 --- a/keymaster/4.0/vts/functional/HmacKeySharingTest.cpp +++ b/keymaster/4.0/vts/functional/HmacKeySharingTest.cpp @@ -137,7 +137,7 @@ TEST_P(HmacKeySharingTest, ComputeSharedHmac) { auto nonces = copyNonces(params); EXPECT_EQ(allKeymasters().size(), nonces.size()); std::sort(nonces.begin(), nonces.end()); - std::unique(nonces.begin(), nonces.end()); + nonces.erase(std::unique(nonces.begin(), nonces.end()), nonces.end()); EXPECT_EQ(allKeymasters().size(), nonces.size()); auto responses = computeSharedHmac(allKeymasters(), params); diff --git a/security/sharedsecret/aidl/vts/functional/SharedSecretAidlTest.cpp b/security/sharedsecret/aidl/vts/functional/SharedSecretAidlTest.cpp index 51938baa82..7599bce3af 100644 --- a/security/sharedsecret/aidl/vts/functional/SharedSecretAidlTest.cpp +++ b/security/sharedsecret/aidl/vts/functional/SharedSecretAidlTest.cpp @@ -164,7 +164,7 @@ TEST_F(SharedSecretAidlTest, ComputeSharedSecret) { auto nonces = copyNonces(params); EXPECT_EQ(sharedSecrets.size(), nonces.size()); std::sort(nonces.begin(), nonces.end()); - std::unique(nonces.begin(), nonces.end()); + nonces.erase(std::unique(nonces.begin(), nonces.end()), nonces.end()); EXPECT_EQ(sharedSecrets.size(), nonces.size()); auto responses = computeAllSharedSecrets(params);