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

Unified Diff: components/webcrypto/algorithms/aes_cbc.cc

Issue 2407633002: Use new BoringSSL scopers in //components. (Closed)
Patch Set: Created 4 years, 2 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 | « components/gcm_driver/crypto/p256_key_util.cc ('k') | components/webcrypto/algorithms/aes_ctr.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webcrypto/algorithms/aes_cbc.cc
diff --git a/components/webcrypto/algorithms/aes_cbc.cc b/components/webcrypto/algorithms/aes_cbc.cc
index 6bd6fab90bc1f9eeeafb183b5f4c601ef6a161d1..057ee7285560ec351674d409f9bba08633d5ef1b 100644
--- a/components/webcrypto/algorithms/aes_cbc.cc
+++ b/components/webcrypto/algorithms/aes_cbc.cc
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include <openssl/aes.h>
-#include <openssl/evp.h>
+#include <openssl/cipher.h>
#include <stddef.h>
#include <stdint.h>
@@ -16,7 +16,6 @@
#include "components/webcrypto/crypto_data.h"
#include "components/webcrypto/status.h"
#include "crypto/openssl_util.h"
-#include "crypto/scoped_openssl_types.h"
#include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h"
namespace webcrypto {
@@ -63,15 +62,10 @@ Status AesCbcEncryptDecrypt(EncryptOrDecrypt cipher_operation,
return Status::ErrorDataTooLarge();
// Note: PKCS padding is enabled by default
- crypto::ScopedOpenSSL<EVP_CIPHER_CTX, EVP_CIPHER_CTX_free> context(
- EVP_CIPHER_CTX_new());
-
- if (!context.get())
- return Status::OperationError();
-
const EVP_CIPHER* const cipher = GetAESCipherByKeyLength(raw_key.size());
DCHECK(cipher);
+ bssl::ScopedEVP_CIPHER_CTX context;
if (!EVP_CipherInit_ex(context.get(), cipher, NULL, &raw_key[0],
params->iv().data(), cipher_operation)) {
return Status::OperationError();
« no previous file with comments | « components/gcm_driver/crypto/p256_key_util.cc ('k') | components/webcrypto/algorithms/aes_ctr.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698