Fix segfault in EncryptionOperationsTest.RsaPkcs1Success am: 478715818f

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1607102

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8e18c84d8bf699f6a6980d83aa3fd5f3859859c5
This commit is contained in:
Bill Richardson 2021-03-02 00:52:26 +00:00 committed by Automerger Merge Worker
commit 64e8e72963

View file

@ -2562,7 +2562,8 @@ TEST_P(EncryptionOperationsTest, RsaPkcs1Success) {
string message = "Hello World!";
auto params = AuthorizationSetBuilder().Padding(PaddingMode::RSA_PKCS1_1_5_ENCRYPT);
string ciphertext1 = EncryptMessage(message, params);
EXPECT_EQ(2048U / 8, ciphertext1.size());
// Die here on failure because we try to modify ciphertext1 below
ASSERT_EQ(2048U / 8, ciphertext1.size()) << "Failed to encrypt the message";
string ciphertext2 = EncryptMessage(message, params);
EXPECT_EQ(2048U / 8, ciphertext2.size());