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

Unified Diff: content/renderer/webcrypto/webcrypto_impl_openssl.cc

Issue 138953016: [style] Remove braces from single-line if statements for style consistency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 11 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
Index: content/renderer/webcrypto/webcrypto_impl_openssl.cc
diff --git a/content/renderer/webcrypto/webcrypto_impl_openssl.cc b/content/renderer/webcrypto/webcrypto_impl_openssl.cc
index c69d5e6d0cffc1341dbd61f0ec0d26f5db2425c2..21f58cb38a00cf7c3c88c07b76541e43707a443e 100644
--- a/content/renderer/webcrypto/webcrypto_impl_openssl.cc
+++ b/content/renderer/webcrypto/webcrypto_impl_openssl.cc
@@ -121,8 +121,9 @@ Status AesCbcEncryptDecrypt(CipherOperation cipher_operation,
return Status::Error();
int final_output_chunk_len = 0;
if (!EVP_CipherFinal_ex(
- context.get(), buffer_data + output_len, &final_output_chunk_len))
+ context.get(), buffer_data + output_len, &final_output_chunk_len)) {
return Status::Error();
+ }
const unsigned final_output_len =
static_cast<unsigned>(output_len) +
@@ -219,9 +220,8 @@ Status WebCryptoImpl::DigestInternal(const blink::WebCryptoAlgorithm& algorithm,
crypto::ScopedOpenSSL<EVP_MD_CTX, EVP_MD_CTX_destroy> digest_context(
EVP_MD_CTX_create());
- if (!digest_context.get()) {
+ if (!digest_context.get())
return Status::Error();
- }
if (!EVP_DigestInit_ex(digest_context.get(), digest_algorithm, NULL) ||
!EVP_DigestUpdate(digest_context.get(), data, data_size)) {
@@ -264,20 +264,18 @@ Status WebCryptoImpl::GenerateSecretKeyInternal(
if (params->lengthBits() % 8)
return Status::ErrorGenerateKeyLength();
keylen_bytes = params->lengthBits() / 8;
- if (!GetAESCipherByKeyLength(keylen_bytes)) {
+ if (!GetAESCipherByKeyLength(keylen_bytes))
return Status::Error();
- }
key_type = blink::WebCryptoKeyTypeSecret;
break;
}
case blink::WebCryptoAlgorithmIdHmac: {
const blink::WebCryptoHmacKeyParams* params = algorithm.hmacKeyParams();
DCHECK(params);
- if (params->hasLengthBytes()) {
+ if (params->hasLengthBytes())
keylen_bytes = params->optionalLengthBytes();
- } else {
+ else
keylen_bytes = webcrypto::ShaBlockSizeBytes(params->hash().id());
- }
key_type = blink::WebCryptoKeyTypeSecret;
break;
}
@@ -285,16 +283,14 @@ Status WebCryptoImpl::GenerateSecretKeyInternal(
default: { return Status::ErrorUnsupported(); }
}
- if (keylen_bytes == 0) {
+ if (keylen_bytes == 0)
return Status::ErrorGenerateKeyLength();
- }
crypto::OpenSSLErrStackTracer(FROM_HERE);
std::vector<unsigned char> random_bytes(keylen_bytes, 0);
- if (!(RAND_bytes(&random_bytes[0], keylen_bytes))) {
+ if (!(RAND_bytes(&random_bytes[0], keylen_bytes)))
return Status::Error();
- }
*key = blink::WebCryptoKey::create(
new SymKeyHandle(&random_bytes[0], random_bytes.size()),
@@ -486,9 +482,8 @@ Status WebCryptoImpl::VerifySignatureInternal(
case blink::WebCryptoAlgorithmIdHmac: {
blink::WebArrayBuffer result;
Status status = SignInternal(algorithm, key, data, data_size, &result);
- if (status.IsError()) {
+ if (status.IsError())
return status;
- }
// Handling of truncated signatures is underspecified in the WebCrypto
// spec, so here we fail verification if a truncated signature is being
« no previous file with comments | « content/renderer/webcrypto/webcrypto_impl_nss.cc ('k') | content/renderer/webcrypto/webcrypto_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698