diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-08-01 12:59:39 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-08-04 12:40:43 +0000 |
commit | 28b1110370900897ab652cb420c371fab8857ad4 (patch) | |
tree | 41b32127d23b0df4f2add2a27e12dc87bddb260e /chromium/crypto/encryptor.cc | |
parent | 399c965b6064c440ddcf4015f5f8e9d131c7a0a6 (diff) | |
download | qtwebengine-chromium-28b1110370900897ab652cb420c371fab8857ad4.tar.gz |
BASELINE: Update Chromium to 53.0.2785.41
Also adds a few extra files for extensions.
Change-Id: Iccdd55d98660903331cf8b7b29188da781830af4
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/crypto/encryptor.cc')
-rw-r--r-- | chromium/crypto/encryptor.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/chromium/crypto/encryptor.cc b/chromium/crypto/encryptor.cc index a9f9a9d5dce..06bf00cce94 100644 --- a/chromium/crypto/encryptor.cc +++ b/chromium/crypto/encryptor.cc @@ -23,7 +23,8 @@ const EVP_CIPHER* GetCipherForKey(SymmetricKey* key) { switch (key->key().length()) { case 16: return EVP_aes_128_cbc(); case 32: return EVP_aes_256_cbc(); - default: return NULL; + default: + return nullptr; } } @@ -84,10 +85,7 @@ size_t Encryptor::Counter::GetLengthInBytes() const { ///////////////////////////////////////////////////////////////////////////// // Encryptor Implementation. -Encryptor::Encryptor() - : key_(NULL), - mode_(CBC) { -} +Encryptor::Encryptor() : key_(nullptr), mode_(CBC) {} Encryptor::~Encryptor() { } @@ -102,7 +100,7 @@ bool Encryptor::Init(SymmetricKey* key, if (mode == CBC && iv.size() != AES_BLOCK_SIZE) return false; - if (GetCipherForKey(key) == NULL) + if (GetCipherForKey(key) == nullptr) return false; key_ = key; @@ -191,9 +189,10 @@ bool Encryptor::Crypt(bool do_encrypt, DCHECK_EQ(EVP_CIPHER_key_length(cipher), key.length()); ScopedCipherCTX ctx; - if (!EVP_CipherInit_ex( - ctx.get(), cipher, NULL, reinterpret_cast<const uint8_t*>(key.data()), - reinterpret_cast<const uint8_t*>(iv_.data()), do_encrypt)) + if (!EVP_CipherInit_ex(ctx.get(), cipher, nullptr, + reinterpret_cast<const uint8_t*>(key.data()), + reinterpret_cast<const uint8_t*>(iv_.data()), + do_encrypt)) return false; // When encrypting, add another block size of space to allow for any padding. |