Chromium Code Reviews| Index: crypto/ec_signature_creator_openssl.cc |
| diff --git a/crypto/ec_signature_creator_openssl.cc b/crypto/ec_signature_creator_openssl.cc |
| index 7f0a873f9936798df6c9f1173b695dad6de2767c..7908fd2e660e9e16169f79fa9328c9ef6e0631b9 100644 |
| --- a/crypto/ec_signature_creator_openssl.cc |
| +++ b/crypto/ec_signature_creator_openssl.cc |
| @@ -13,9 +13,17 @@ |
| #include "base/logging.h" |
| #include "crypto/ec_private_key.h" |
| #include "crypto/openssl_util.h" |
| +#include "crypto/scoped_openssl_types.h" |
| namespace crypto { |
| +namespace { |
| + |
| +typedef scoped_ptr<ECDSA_SIG, OpenSSLDestroyer<ECDSA_SIG, ECDSA_SIG_free> > |
| + ScopedECDSA_SIG; |
|
wtc
2014/07/02 20:13:13
You can use the ScopedECDSA_SIG typedef from "cryp
|
| + |
| +} // namespace |
| + |
| ECSignatureCreatorImpl::ECSignatureCreatorImpl(ECPrivateKey* key) |
| : key_(key), signature_len_(0) { |
| EnsureOpenSSLInit(); |
| @@ -27,7 +35,7 @@ bool ECSignatureCreatorImpl::Sign(const uint8* data, |
| int data_len, |
| std::vector<uint8>* signature) { |
| OpenSSLErrStackTracer err_tracer(FROM_HERE); |
| - ScopedOpenSSL<EVP_MD_CTX, EVP_MD_CTX_destroy> ctx(EVP_MD_CTX_create()); |
| + ScopedEVP_MD_CTX ctx(EVP_MD_CTX_create()); |
| size_t sig_len = 0; |
| if (!ctx.get() || |
| !EVP_DigestSignInit(ctx.get(), NULL, EVP_sha256(), NULL, key_->key()) || |
| @@ -52,7 +60,7 @@ bool ECSignatureCreatorImpl::DecodeSignature(const std::vector<uint8>& der_sig, |
| OpenSSLErrStackTracer err_tracer(FROM_HERE); |
| // Create ECDSA_SIG object from DER-encoded data. |
| const unsigned char* der_data = &der_sig.front(); |
| - ScopedOpenSSL<ECDSA_SIG, ECDSA_SIG_free> ecdsa_sig( |
| + ScopedECDSA_SIG ecdsa_sig( |
| d2i_ECDSA_SIG(NULL, &der_data, static_cast<long>(der_sig.size()))); |
| if (!ecdsa_sig.get()) |
| return false; |