diff options
author | davidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-25 21:04:15 +0000 |
---|---|---|
committer | davidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-25 21:04:15 +0000 |
commit | a534bab7a45f72c4453c6f83ffc53236573720b1 (patch) | |
tree | eb9495b4207cfc00dbeebc58697eee786d7e6c55 /crypto/encryptor_unittest.cc | |
parent | df94963550e10f9ab06970ff8ed77eab2116b625 (diff) | |
download | chromium_src-a534bab7a45f72c4453c6f83ffc53236573720b1.zip chromium_src-a534bab7a45f72c4453c6f83ffc53236573720b1.tar.gz chromium_src-a534bab7a45f72c4453c6f83ffc53236573720b1.tar.bz2 |
Desupport AES-192 in crypto::SymmetricKey.
BoringSSL does not support AES-192. No current consumer uses AES-192, so remove
the test which asserts it works. This fixes crypto_unittests in the Mac OpenSSL
port. Blacklist AES-192 in the NSS implementation so that we do not
accidentally grow a new dependency on it.
BUG=338885
Review URL: https://codereview.chromium.org/420883003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285678 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'crypto/encryptor_unittest.cc')
-rw-r--r-- | crypto/encryptor_unittest.cc | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/crypto/encryptor_unittest.cc b/crypto/encryptor_unittest.cc index 2a21a8e..f095659 100644 --- a/crypto/encryptor_unittest.cc +++ b/crypto/encryptor_unittest.cc @@ -456,32 +456,6 @@ TEST(EncryptorTest, EncryptAES128CBCRegression) { EXPECT_EQ(plaintext, decrypted); } -// Expected output derived from the NSS implementation. -TEST(EncryptorTest, EncryptAES192CBCRegression) { - std::string key = "192bitsIsTwentyFourByte!"; - std::string iv = "Sweet Sixteen IV"; - std::string plaintext = "Small text"; - std::string expected_ciphertext_hex = "78DE5D7C2714FC5C61346C5416F6C89A"; - - scoped_ptr<crypto::SymmetricKey> sym_key(crypto::SymmetricKey::Import( - crypto::SymmetricKey::AES, key)); - ASSERT_TRUE(sym_key.get()); - - crypto::Encryptor encryptor; - // The IV must be exactly as long a the cipher block size. - EXPECT_EQ(16U, iv.size()); - EXPECT_TRUE(encryptor.Init(sym_key.get(), crypto::Encryptor::CBC, iv)); - - std::string ciphertext; - EXPECT_TRUE(encryptor.Encrypt(plaintext, &ciphertext)); - EXPECT_EQ(expected_ciphertext_hex, base::HexEncode(ciphertext.data(), - ciphertext.size())); - - std::string decrypted; - EXPECT_TRUE(encryptor.Decrypt(ciphertext, &decrypted)); - EXPECT_EQ(plaintext, decrypted); -} - // Not all platforms allow import/generation of symmetric keys with an // unsupported size. #if !defined(USE_NSS) && !defined(OS_WIN) && !defined(OS_MACOSX) |