open-license-manager / licensecc

Software licensing, copy protection in C++. It has few dependencies and it's cross-platform.
http://open-license-manager.github.io/licensecc/
BSD 3-Clause "New" or "Revised" License
947 stars 300 forks source link

New commit seems broken #113

Closed kikushah closed 3 years ago

kikushah commented 3 years ago

Hi,

The current commit v1.0.0-435-g48d2775 seems to be broken.

v1.0.0-430-gecd2f38 worked well and my software could verify license perfectly. I just deployed a new build environment in which v1.0.0-435-g48d2775 is being used, and now the acquire_license() keeps returning LICENSE_CORRUPTED.

Although the license inspector keeps showing license OK.

Has something changed in the code? Is there a way I can debug this better?

I am running the software on a virtual box and am passing callerInfo, and licenseLocation to acquire_license()

`CallerInformations callerInfo; strcpy(callerInfo.version, "200"); strcpy(callerInfo.feature_name, "MySW"); callerInfo.magic = 0;
LicenseLocation licenseLocation; licenseLocation.license_data_type = LCC_LICENSE_DATA_TYPE::LICENSE_PATH; strcpy(licenseLocation.licenseData, "./MySW.lic");
LicenseInfo licenseInfo;
size_t bufSize = LCC_API_PC_IDENTIFIER_SIZE + 1; char pc_identifier[LCC_API_PC_IDENTIFIER_SIZE + 1]; ExecutionEnvironmentInfo exec_env_info; bool isPCIdentified = identify_pc( STRATEGY_DEFAULT, pc_identifier, &bufSize, &exec_env_info);

LCC_EVENT_TYPE result = acquire_license(&callerInfo, &licenseLocation, &licenseInfo);`
kikushah commented 3 years ago

On further investigation this is failing at /src/library/os/openssl/signature_verifier.cpp:53

if (rsa == NULL) { LOG_ERROR("Error reading public key"); return FUNC_RET_ERROR; }

kikushah commented 3 years ago

I got it to work.

My SW was linking to boringssl instead of openssl which was causing the difference in behaviour between my sw and lccinspector.