diff --git a/include/WinStd/BCrypt.h b/include/WinStd/BCrypt.h index 559e0ebb..edb31ea4 100644 --- a/include/WinStd/BCrypt.h +++ b/include/WinStd/BCrypt.h @@ -31,7 +31,7 @@ public: \ private: template -static _Must_inspect_result_ NTSTATUS BCryptSignHash(_In_ BCRYPT_KEY_HANDLE hKey, _In_opt_ VOID *pPaddingInfo, _In_reads_bytes_(cbInput) PUCHAR pbInput, _In_ ULONG cbInput, _Out_ std::vector<_Ty, _Ax> &aOutput, _In_ ULONG dwFlags) +static _Must_inspect_result_ NTSTATUS BCryptSignHash(_In_ BCRYPT_KEY_HANDLE hKey, _In_opt_ VOID* pPaddingInfo, _In_reads_bytes_(cbInput) PUCHAR pbInput, _In_ ULONG cbInput, _Out_ std::vector<_Ty, _Ax>& aOutput, _In_ ULONG dwFlags) { ULONG cbSignature = 0; NTSTATUS status = BCryptSignHash(hKey, pPaddingInfo, pbInput, cbInput, NULL, 0, &cbSignature, dwFlags); @@ -45,7 +45,7 @@ static _Must_inspect_result_ NTSTATUS BCryptSignHash(_In_ BCRYPT_KEY_HANDLE hKey } template -static _Must_inspect_result_ NTSTATUS BCryptExportKey(_In_ BCRYPT_KEY_HANDLE hKey, _In_opt_ BCRYPT_KEY_HANDLE hExportKey, _In_z_ LPCWSTR pszBlobType, _Out_ std::vector<_Ty, _Ax> &aOutput, _In_ ULONG dwFlags) +static _Must_inspect_result_ NTSTATUS BCryptExportKey(_In_ BCRYPT_KEY_HANDLE hKey, _In_opt_ BCRYPT_KEY_HANDLE hExportKey, _In_z_ LPCWSTR pszBlobType, _Out_ std::vector<_Ty, _Ax>& aOutput, _In_ ULONG dwFlags) { DWORD cbBlob = 0; NTSTATUS status = BCryptExportKey(hKey, hExportKey, pszBlobType, NULL, 0, &cbBlob, dwFlags); @@ -111,7 +111,7 @@ namespace winstd /// bcrypt_handle_with_object(_Inout_ bcrypt_handle_with_object&& h) noexcept : handle(std::move(h)), - m_hash_object(std::move(h.m_hash_object)) + m_object(std::move(h.m_object)) { } @@ -142,7 +142,7 @@ namespace winstd { if (this != std::addressof(h)) { handle::operator=(std::move(h)); - m_hash_object = std::move(h.m_hash_object); + m_object = std::move(h.m_object); } return *this; } @@ -156,7 +156,7 @@ namespace winstd virtual void duplicate_internal(_In_ const bcrypt_handle_with_object& h) = 0; protected: - std::vector m_hash_object; + std::vector m_object; }; /// @@ -178,8 +178,8 @@ namespace winstd NTSTATUS status = BCryptGetProperty(hAlgorithm, BCRYPT_OBJECT_LENGTH, reinterpret_cast(&hashObjectSize), sizeof(hashObjectSize), &bytesRead, 0); if (status || bytesRead != sizeof(hashObjectSize)) throw ntstatus_error(status, "Failed to get hash object size"); - m_hash_object.resize(hashObjectSize); - status = BCryptCreateHash(hAlgorithm, &m_h, m_hash_object.data(), static_cast(m_hash_object.size()), pbSecret, cbSecret, dwFlags); + m_object.resize(hashObjectSize); + status = BCryptCreateHash(hAlgorithm, &m_h, m_object.data(), static_cast(m_object.size()), pbSecret, cbSecret, dwFlags); if (status) throw ntstatus_error(status, "Failed to create hash"); } @@ -214,9 +214,9 @@ namespace winstd void duplicate_internal(_In_ const bcrypt_handle_with_object& h) override { auto h2 = reinterpret_cast(&h); - m_hash_object.resize(h2->m_hash_object.size()); - assert(m_hash_object.size() < ULONG_MAX); - NTSTATUS status = BCryptDuplicateHash(h2->m_h, &m_h, m_hash_object.data(), static_cast(m_hash_object.size()), 0); + m_object.resize(h2->m_object.size()); + assert(m_object.size() < ULONG_MAX); + NTSTATUS status = BCryptDuplicateHash(h2->m_h, &m_h, m_object.data(), static_cast(m_object.size()), 0); if (status) throw ntstatus_error(status, "Failed to duplicate hash"); }