Index: crypto/rsa_private_key.h |
diff --git a/crypto/rsa_private_key.h b/crypto/rsa_private_key.h |
index f0b9efaa58fbd2bf3f1659a01be6790f16ae6787..987b3bfc70134e32df966bc3bd936874a68b89b8 100644 |
--- a/crypto/rsa_private_key.h |
+++ b/crypto/rsa_private_key.h |
@@ -5,6 +5,7 @@ |
#ifndef CRYPTO_RSA_PRIVATE_KEY_H_ |
#define CRYPTO_RSA_PRIVATE_KEY_H_ |
+#include <openssl/base.h> |
#include <stddef.h> |
#include <stdint.h> |
@@ -15,9 +16,6 @@ |
#include "build/build_config.h" |
#include "crypto/crypto_export.h" |
-// Forward declaration for openssl/*.h |
-typedef struct evp_pkey_st EVP_PKEY; |
- |
namespace crypto { |
// Encapsulates an RSA private key. Can be used to generate new keys, export |
@@ -41,7 +39,7 @@ class CRYPTO_EXPORT RSAPrivateKey { |
// failure. |
static std::unique_ptr<RSAPrivateKey> CreateFromKey(EVP_PKEY* key); |
- EVP_PKEY* key() { return key_; } |
+ EVP_PKEY* key() { return key_.get(); } |
// Creates a copy of the object. |
std::unique_ptr<RSAPrivateKey> Copy() const; |
@@ -56,7 +54,7 @@ class CRYPTO_EXPORT RSAPrivateKey { |
// Constructor is private. Use one of the Create*() methods above instead. |
RSAPrivateKey(); |
- EVP_PKEY* key_; |
+ bssl::UniquePtr<EVP_PKEY> key_; |
DISALLOW_COPY_AND_ASSIGN(RSAPrivateKey); |
}; |