Allow more error codes on multi-padding failure
Bug: 362162661
Test: keystore2_client_tests keystore2_aes_key_op_fails_multi_padding_modes
Change-Id: I3b731e7ccf52e561170e99f23c89fca437c156d8
diff --git a/keystore2/tests/keystore2_client_aes_key_tests.rs b/keystore2/tests/keystore2_client_aes_key_tests.rs
index 9f85c38..4e3e606 100644
--- a/keystore2/tests/keystore2_client_aes_key_tests.rs
+++ b/keystore2/tests/keystore2_client_aes_key_tests.rs
@@ -248,7 +248,7 @@
}
/// Try to create an operation using AES key with multiple padding modes. Test should fail to create
-/// an operation with `UNSUPPORTED_PADDING_MODE` error code.
+/// an operation.
#[test]
fn keystore2_aes_key_op_fails_multi_padding_modes() {
let sl = SecLevel::tee();
@@ -292,7 +292,12 @@
false,
));
assert!(result.is_err());
- assert_eq!(Error::Km(ErrorCode::UNSUPPORTED_PADDING_MODE), result.unwrap_err());
+ assert!(matches!(
+ result.unwrap_err(),
+ Error::Km(ErrorCode::INCOMPATIBLE_PADDING_MODE)
+ | Error::Km(ErrorCode::UNSUPPORTED_PADDING_MODE)
+ | Error::Km(ErrorCode::INVALID_ARGUMENT)
+ ));
}
/// Generate a AES-ECB key with unpadded mode. Try to create an operation using generated key