Skip to content

Commit

Permalink
[webcrypto] Used named OpenSSLErrStackTracer.
Browse files Browse the repository at this point in the history
Instances of OpenSSLErrStackTracer should have a name, otherwise it is just creating a temporary that is instantly destroyed.

BUG=388488

Review URL: https://codereview.chromium.org/330883006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279622 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
eroman@chromium.org committed Jun 25, 2014
1 parent 56ea558 commit e07862b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions content/child/webcrypto/platform_crypto_openssl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class DigestorOpenSSL : public blink::WebCryptoDigestor {
}

Status ConsumeWithStatus(const unsigned char* data, unsigned int size) {
crypto::OpenSSLErrStackTracer(FROM_HERE);
crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
Status error = Init();
if (!error.IsSuccess())
return error;
Expand Down Expand Up @@ -215,7 +215,7 @@ class DigestorOpenSSL : public blink::WebCryptoDigestor {
}

Status FinishInternal(unsigned char* result, unsigned int* result_size) {
crypto::OpenSSLErrStackTracer(FROM_HERE);
crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
Status error = Init();
if (!error.IsSuccess())
return error;
Expand Down Expand Up @@ -279,7 +279,7 @@ Status GenerateSecretKey(const blink::WebCryptoAlgorithm& algorithm,
if (keylen_bytes == 0)
return Status::ErrorGenerateKeyLength();

crypto::OpenSSLErrStackTracer(FROM_HERE);
crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);

std::vector<unsigned char> random_bytes(keylen_bytes, 0);
if (!(RAND_bytes(&random_bytes[0], keylen_bytes)))
Expand Down Expand Up @@ -335,6 +335,8 @@ Status SignHmac(SymKey* key,
const blink::WebCryptoAlgorithm& hash,
const CryptoData& data,
std::vector<uint8>* buffer) {
crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);

const EVP_MD* digest_algorithm = GetDigest(hash.id());
if (!digest_algorithm)
return Status::ErrorUnsupported();
Expand All @@ -354,8 +356,6 @@ Status SignHmac(SymKey* key,
crypto::ScopedOpenSSLSafeSizeBuffer<EVP_MAX_MD_SIZE> hmac_result(
Uint8VectorStart(buffer), hmac_expected_length);

crypto::OpenSSLErrStackTracer(FROM_HERE);

unsigned int hmac_actual_length;
unsigned char* const success = HMAC(digest_algorithm,
raw_key_voidp,
Expand Down

0 comments on commit e07862b

Please sign in to comment.