Skip to content

Commit 3317fc4

Browse files
committed
One small test
1 parent 802ede3 commit 3317fc4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

crypto/cipher_extra/cipher_test.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,6 +1500,11 @@ TEST(CipherTest, CopyErrorPathReleasesCipherData) {
15001500
EXPECT_FALSE(EVP_CIPHER_CTX_copy(dst.get(), src.get()));
15011501
EXPECT_EQ(dst->cipher, nullptr);
15021502
EXPECT_EQ(dst->cipher_data, nullptr);
1503+
1504+
// A follow-up init with a real cipher on |dst| must still work and must not
1505+
// depend on leaked state from the failed copy.
1506+
EXPECT_TRUE(EVP_CipherInit_ex(dst.get(), EVP_aes_128_ecb(), nullptr,
1507+
key.data(), nullptr, 1));
15031508
}
15041509

15051510
struct CipherInfo {

0 commit comments

Comments
 (0)