diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2017-09-14 21:28:42 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2017-09-15 06:20:39 +0200 |
commit | ebb985be4462981904cca72727d1872347022d0d (patch) | |
tree | e54ac30198852e559bde5d0651c7239553f9a4eb /svl/source | |
parent | 8d24a4e1feaf88ee3f01393cc84a0747441911c3 (diff) |
cryptosign: don't use 8-bit string functions
Change-Id: I5f0414c85001043cd746bab364a84a00ac9c85e4
Reviewed-on: https://gerrit.libreoffice.org/42305
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svl/source')
-rw-r--r-- | svl/source/crypto/cryptosign.cxx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/svl/source/crypto/cryptosign.cxx b/svl/source/crypto/cryptosign.cxx index a6758519b7cd..8c2d18e0ac87 100644 --- a/svl/source/crypto/cryptosign.cxx +++ b/svl/source/crypto/cryptosign.cxx @@ -1912,12 +1912,12 @@ OUString GetSubjectName(PCCERT_CONTEXT pCertContext) OUString subjectName; // Get Subject name size. - DWORD dwData = CertGetNameString(pCertContext, - CERT_NAME_SIMPLE_DISPLAY_TYPE, - 0, - nullptr, - nullptr, - 0); + DWORD dwData = CertGetNameStringW(pCertContext, + CERT_NAME_SIMPLE_DISPLAY_TYPE, + 0, + nullptr, + nullptr, + 0); if (!dwData) { SAL_WARN("svl.crypto", "ValidateSignature: CertGetNameString failed"); @@ -1925,8 +1925,8 @@ OUString GetSubjectName(PCCERT_CONTEXT pCertContext) } // Allocate memory for subject name. - LPTSTR szName = static_cast<LPTSTR>( - LocalAlloc(LPTR, dwData * sizeof(TCHAR))); + LPWSTR szName = static_cast<LPWSTR>( + LocalAlloc(LPTR, dwData * sizeof(WCHAR))); if (!szName) { SAL_WARN("svl.crypto", "ValidateSignature: Unable to allocate memory for subject name"); @@ -1934,18 +1934,18 @@ OUString GetSubjectName(PCCERT_CONTEXT pCertContext) } // Get subject name. - if (!CertGetNameString(pCertContext, - CERT_NAME_SIMPLE_DISPLAY_TYPE, - 0, - nullptr, - szName, - dwData)) + if (!CertGetNameStringW(pCertContext, + CERT_NAME_SIMPLE_DISPLAY_TYPE, + 0, + nullptr, + szName, + dwData)) { SAL_WARN("svl.crypto", "ValidateSignature: CertGetNameString failed"); return subjectName; } - subjectName = OUString::fromUtf8(OString(szName)); + subjectName = OUString(reinterpret_cast<sal_Unicode*>(szName)); if (szName != nullptr) LocalFree(szName); |