From 90bd57fe40e66fc829ecb01482d32d604b0df19c Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 25 Nov 2015 01:41:37 +0100 Subject: Windows: Full UNICODE rewrite and implement support for UNICODE passwords. --- src/Common/SecurityToken.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/Common/SecurityToken.cpp') diff --git a/src/Common/SecurityToken.cpp b/src/Common/SecurityToken.cpp index 4d2e9c63..d7dacf57 100644 --- a/src/Common/SecurityToken.cpp +++ b/src/Common/SecurityToken.cpp @@ -47,7 +47,7 @@ namespace VeraCrypt SlotId = slotId; size_t keyIdPos = pathStr.find (L"/" TC_SECURITY_TOKEN_KEYFILE_URL_FILE L"/"); - if (keyIdPos == string::npos) + if (keyIdPos == wstring::npos) throw InvalidSecurityTokenKeyfilePath(); Id = pathStr.substr (keyIdPos + wstring (L"/" TC_SECURITY_TOKEN_KEYFILE_URL_FILE L"/").size()); @@ -510,13 +510,17 @@ namespace VeraCrypt } } +#ifdef TC_WINDOWS + void SecurityToken::InitLibrary (const wstring &pkcs11LibraryPath, auto_ptr pinCallback, auto_ptr warningCallback) +#else void SecurityToken::InitLibrary (const string &pkcs11LibraryPath, auto_ptr pinCallback, auto_ptr warningCallback) +#endif { if (Initialized) CloseLibrary(); #ifdef TC_WINDOWS - Pkcs11LibraryHandle = LoadLibraryA (pkcs11LibraryPath.c_str()); + Pkcs11LibraryHandle = LoadLibraryW (pkcs11LibraryPath.c_str()); #else Pkcs11LibraryHandle = dlopen (pkcs11LibraryPath.c_str(), RTLD_NOW | RTLD_LOCAL); #endif -- cgit v1.2.3