commit | 3a0c4350b2d628a92f6abd254bd490baef1ef1c6 | [log] [tgz] |
---|---|---|
author | David Drysdale <drysdale@google.com> | Tue Aug 27 09:47:02 2024 +0100 |
committer | Cherrypicker Worker <android-build-cherrypicker-worker@google.com> | Wed Aug 28 09:37:18 2024 +0000 |
tree | 492df0dc5debeb3d56ee2a68faaab4513815876e | |
parent | c2702bf08591b100e6133f5454fa8df77cd6a3a8 [diff] |
Allow more error codes on multi-padding failure Bug: 362162661 Test: keystore2_client_tests keystore2_aes_key_op_fails_multi_padding_modes (cherry picked from https://android-review.googlesource.com/q/commit:7068dda87f03411d3fb8054ad573f46368c5159e) Merged-In: I3b731e7ccf52e561170e99f23c89fca437c156d8 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