mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Don't require UNKNOWN_ERROR
Negative test cases should not expect UNKNOWN_ERROR from Keymint since the exact cause of failure is known. In general, we should avoid UNKNOWN_ERROR because it makes error attribution difficult. To avoid adding retroactive requirements KM implementation, relax the check to expect any error. Bug: 298194325 Test: VtsAidlKeyMintTargetTest Change-Id: I136fb6d36ae92c9e3722ffefe9a067d3515dcbf9
This commit is contained in:
@@ -4792,7 +4792,7 @@ TEST_P(ImportKeyTest, RsaOaepMGFDigestSuccess) {
|
||||
|
||||
EXPECT_EQ(ErrorCode::OK, Begin(KeyPurpose::DECRYPT, params));
|
||||
string result;
|
||||
EXPECT_EQ(ErrorCode::UNKNOWN_ERROR, Finish(ciphertext1, &result));
|
||||
EXPECT_NE(ErrorCode::OK, Finish(ciphertext1, &result));
|
||||
EXPECT_EQ(0U, result.size());
|
||||
}
|
||||
}
|
||||
@@ -5300,7 +5300,7 @@ TEST_P(EncryptionOperationsTest, RsaOaepSuccess) {
|
||||
|
||||
EXPECT_EQ(ErrorCode::OK, Begin(KeyPurpose::DECRYPT, params));
|
||||
string result;
|
||||
EXPECT_EQ(ErrorCode::UNKNOWN_ERROR, Finish(ciphertext1, &result));
|
||||
EXPECT_NE(ErrorCode::OK, Finish(ciphertext1, &result));
|
||||
EXPECT_EQ(0U, result.size());
|
||||
}
|
||||
}
|
||||
@@ -5367,7 +5367,7 @@ TEST_P(EncryptionOperationsTest, RsaOaepDecryptWithWrongDigest) {
|
||||
.Digest(Digest::SHA_2_256)
|
||||
.Padding(PaddingMode::RSA_OAEP)));
|
||||
string result;
|
||||
EXPECT_EQ(ErrorCode::UNKNOWN_ERROR, Finish(ciphertext, &result));
|
||||
EXPECT_NE(ErrorCode::OK, Finish(ciphertext, &result));
|
||||
EXPECT_EQ(0U, result.size());
|
||||
}
|
||||
|
||||
@@ -5437,7 +5437,7 @@ TEST_P(EncryptionOperationsTest, RsaOaepWithMGFDigestSuccess) {
|
||||
|
||||
EXPECT_EQ(ErrorCode::OK, Begin(KeyPurpose::DECRYPT, params));
|
||||
string result;
|
||||
EXPECT_EQ(ErrorCode::UNKNOWN_ERROR, Finish(ciphertext1, &result));
|
||||
EXPECT_NE(ErrorCode::OK, Finish(ciphertext1, &result));
|
||||
EXPECT_EQ(0U, result.size());
|
||||
}
|
||||
}
|
||||
@@ -5481,7 +5481,7 @@ TEST_P(EncryptionOperationsTest, RsaOaepMGFDigestDefaultSuccess) {
|
||||
|
||||
EXPECT_EQ(ErrorCode::OK, Begin(KeyPurpose::DECRYPT, params));
|
||||
string result;
|
||||
EXPECT_EQ(ErrorCode::UNKNOWN_ERROR, Finish(ciphertext, &result));
|
||||
EXPECT_NE(ErrorCode::OK, Finish(ciphertext, &result));
|
||||
EXPECT_EQ(0U, result.size());
|
||||
}
|
||||
|
||||
@@ -5613,7 +5613,7 @@ TEST_P(EncryptionOperationsTest, RsaPkcs1Success) {
|
||||
|
||||
EXPECT_EQ(ErrorCode::OK, Begin(KeyPurpose::DECRYPT, params));
|
||||
string result;
|
||||
EXPECT_EQ(ErrorCode::UNKNOWN_ERROR, Finish(ciphertext1, &result));
|
||||
EXPECT_NE(ErrorCode::OK, Finish(ciphertext1, &result));
|
||||
EXPECT_EQ(0U, result.size());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user