Chromium Code Reviews| Index: crypto/rsa_private_key_win.cc |
| diff --git a/crypto/rsa_private_key_win.cc b/crypto/rsa_private_key_win.cc |
| index f7363422db8b18928e95c8b2bd98690a0bc7f3d4..7462caf73c40d3f5242a92e5a00eca35d1ba642a 100644 |
| --- a/crypto/rsa_private_key_win.cc |
| +++ b/crypto/rsa_private_key_win.cc |
| @@ -134,6 +134,15 @@ bool RSAPrivateKey::InitProvider() { |
| PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); |
| } |
| +RSAPrivateKey* RSAPrivateKey::Copy() const { |
| + scoped_ptr<RSAPrivateKey> copy(new RSAPrivateKey()); |
| + if (!copy->InitProvider()) |
|
wtc
2011/11/30 00:58:10
Instead of calling copy->InitProvider(), I think i
Sergey Ulanov
2011/11/30 22:30:03
Done.
|
| + return NULL; |
| + if (!CryptDuplicateKey(key_.get(), NULL, 0, copy->key_.receive())) |
| + return NULL; |
| + return copy.release(); |
| +} |
| + |
| bool RSAPrivateKey::ExportPrivateKey(std::vector<uint8>* output) { |
| // Export the key |
| DWORD blob_length = 0; |