| 394 | } |
| 395 | const auto openAlgorithm = reinterpret_cast<HttpWebSocketBCryptOpenAlgorithmProvider>( |
| 396 | GetProcAddress(library, "BCryptOpenAlgorithmProvider")); |
| 397 | const auto hash = reinterpret_cast<HttpWebSocketBCryptHash>(GetProcAddress(library, "BCryptHash")); |
| 398 | const auto closeAlgorithm = reinterpret_cast<HttpWebSocketBCryptCloseAlgorithmProvider>( |
| 399 | GetProcAddress(library, "BCryptCloseAlgorithmProvider")); |
| 400 | |
| 401 | bool success = false; |
| 402 | if (openAlgorithm != nullptr and hash != nullptr and closeAlgorithm != nullptr) |
| 403 | { |
| 404 | BCRYPT_ALG_HANDLE algorithm = nullptr; |
| 405 | if (openAlgorithm(&algorithm, BCRYPT_SHA1_ALGORITHM, nullptr, 0) >= 0) |
| 406 | { |
| 407 | success = hash(algorithm, nullptr, 0, const_cast<PUCHAR>(data.data()), dataSize, digest, 20) >= 0; |
| 408 | (void)closeAlgorithm(algorithm, 0); |
| 409 | } |
| 410 | } |
| 411 | FreeLibrary(library); |
nothing calls this directly
no test coverage detected