Fix segfault in EncryptionOperationsTest.RsaPkcs1Success am: 478715818f am: 64e8e72963

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic002d7e31ca2dcb19c603eb9e780a170619834b1
This commit is contained in:
Bill Richardson 2021-03-02 02:08:23 +00:00 committed by Automerger Merge Worker
commit adb0da89b4

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());