From 3e8f0cf1feaeb41da4ca1d96d9afdb16486d0273 Mon Sep 17 00:00:00 2001 From: gcontini <1121667+gcontini@users.noreply.github.com> Date: 周六, 10 10月 2020 22:53:16 +0800 Subject: [PATCH] added docs for licensing with hardware identifier --- src/library/os/windows/signature_verifier.cpp | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/library/os/windows/signature_verifier.cpp b/src/library/os/windows/signature_verifier.cpp index a47c7dd..a99894b 100644 --- a/src/library/os/windows/signature_verifier.cpp +++ b/src/library/os/windows/signature_verifier.cpp @@ -15,7 +15,7 @@ #include <wincrypt.h> #include <iphlpapi.h> #include <windows.h> -#pragma comment(lib, "bcrypt.lib") +//#pragma comment(lib, "bcrypt.lib") #include <public_key.h> #include "../../base/logger.h" @@ -67,7 +67,7 @@ cout << (len & 0x80) << endl; if ((len & 0x80) > 0) { size_t blen = len & 0x7F; - for (int i = 0; i < blen; i++) { + for (size_t i = 0; i < blen; i++) { result += (*(ptr++) << (i * 8)); } } else { @@ -99,7 +99,7 @@ if (expected_length < length) { return FUNC_RET_ERROR; } - for (int i = 0; i < length; i++) { + for (size_t i = 0; i < length; i++) { location[i] = *(ptr++); } return FUNC_RET_OK; @@ -139,9 +139,9 @@ BCRYPT_ALG_HANDLE hSignAlg = nullptr; vector<uint8_t> signatureBlob = unbase64(signatureBuffer); - DWORD dwSigLen = signatureBlob.size(); - BYTE* sigBlob = &signatureBlob[0]; - + DWORD dwSigLen = (DWORD) signatureBlob.size(); + BYTE* sigBlob = &signatureBlob[0]; + if (NT_SUCCESS(status = BCryptOpenAlgorithmProvider(&hSignAlg, BCRYPT_RSA_ALGORITHM, NULL, 0))) { if ((result = readPublicKey(hSignAlg, &phKey)) == FUNC_RET_OK) { BCRYPT_PKCS1_PADDING_INFO paddingInfo; -- Gitblit v1.9.1