Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2458)

Unified Diff: crypto/encryptor_unittest.cc

Issue 420883003: Desupport AES-192 in crypto::SymmetricKey. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Whitelist rather than blacklist Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | crypto/symmetric_key_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/encryptor_unittest.cc
diff --git a/crypto/encryptor_unittest.cc b/crypto/encryptor_unittest.cc
index 2a21a8e13db6acdd0cd909234d3c9fce8c9be2b8..f095659c521271ac9825e869d8273c2be9b6b83b 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)
« no previous file with comments | « no previous file | crypto/symmetric_key_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698