VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/SecurityToken.cpp
diff options
context:
space:
mode:
authorChristopher Bergqvist <chris@digitalpoetry.se>2020-06-11 18:02:28 +0200
committerGitHub <noreply@github.com>2020-06-11 18:02:28 +0200
commit0a2c565aa98fa7bc9623a753370e565fc5ed1e63 (patch)
treef89c65090af0da4ef3c1915ba797b9a2cda75f9c /src/Common/SecurityToken.cpp
parent8250e83e6188dffd26d6310e36af3132d93412dd (diff)
downloadVeraCrypt-0a2c565aa98fa7bc9623a753370e565fc5ed1e63.tar.gz
VeraCrypt-0a2c565aa98fa7bc9623a753370e565fc5ed1e63.zip
Switch from auto_ptr to unique_ptr (#638)
Diffstat (limited to 'src/Common/SecurityToken.cpp')
-rw-r--r--src/Common/SecurityToken.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Common/SecurityToken.cpp b/src/Common/SecurityToken.cpp
index 841ca720..a6759bf8 100644
--- a/src/Common/SecurityToken.cpp
+++ b/src/Common/SecurityToken.cpp
@@ -513,9 +513,9 @@ namespace VeraCrypt
}
#ifdef TC_WINDOWS
- void SecurityToken::InitLibrary (const wstring &pkcs11LibraryPath, auto_ptr <GetPinFunctor> pinCallback, auto_ptr <SendExceptionFunctor> warningCallback)
+ void SecurityToken::InitLibrary (const wstring &pkcs11LibraryPath, unique_ptr <GetPinFunctor> pinCallback, unique_ptr <SendExceptionFunctor> warningCallback)
#else
- void SecurityToken::InitLibrary (const string &pkcs11LibraryPath, auto_ptr <GetPinFunctor> pinCallback, auto_ptr <SendExceptionFunctor> warningCallback)
+ void SecurityToken::InitLibrary (const string &pkcs11LibraryPath, unique_ptr <GetPinFunctor> pinCallback, unique_ptr <SendExceptionFunctor> warningCallback)
#endif
{
if (Initialized)
@@ -548,8 +548,8 @@ namespace VeraCrypt
if (status != CKR_OK)
throw Pkcs11Exception (status);
- PinCallback = pinCallback;
- WarningCallback = warningCallback;
+ PinCallback = std::move(pinCallback);
+ WarningCallback = std::move(warningCallback);
Initialized = true;
}
@@ -728,8 +728,8 @@ namespace VeraCrypt
}
#endif // TC_HEADER_Common_Exception
- auto_ptr <GetPinFunctor> SecurityToken::PinCallback;
- auto_ptr <SendExceptionFunctor> SecurityToken::WarningCallback;
+ unique_ptr <GetPinFunctor> SecurityToken::PinCallback;
+ unique_ptr <SendExceptionFunctor> SecurityToken::WarningCallback;
bool SecurityToken::Initialized;
CK_FUNCTION_LIST_PTR SecurityToken::Pkcs11Functions;