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..adff2c9d7dc73f975c396368303e5520457a0aa2 100644 |
--- a/crypto/ec_signature_creator_openssl.cc |
+++ b/crypto/ec_signature_creator_openssl.cc |
@@ -13,9 +13,16 @@ |
#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 ScopedOpenSSL<ECDSA_SIG, ECDSA_SIG_free>::Type ScopedECDSA_SIG; |
+ |
+} // namespace |
+ |
ECSignatureCreatorImpl::ECSignatureCreatorImpl(ECPrivateKey* key) |
: key_(key), signature_len_(0) { |
EnsureOpenSSLInit(); |
@@ -27,7 +34,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 +59,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; |