| | |
| | | message( STATUS "Project base dir : " ${LCC_PROJECTS_BASE_DIR}/${LCC_PROJECT_NAME} ) |
| | | |
| | | add_subdirectory(src) |
| | | |
| | | #boost is required only for tests |
| | | #bug in cmake win32 - can't find boost compiled with mingw |
| | | if(WIN32 AND "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x") |
| | |
| | | ENDIF(NOT EXISTS "${LCC_INCLUDE_DIR}/licensecc_properties.h") |
| | | |
| | | add_subdirectory("library") |
| | | |
| | |
| | | #include "../library/os/cpu_info.hpp" |
| | | #include "../library/os/dmi_info.hpp" |
| | | #include "../library/os/network.hpp" |
| | | |
| | | //硬件的设备信息获取 |
| | | using namespace std; |
| | | using namespace license::os; |
| | | |
| | |
| | | std::cout << x.second << ": NA" << endl; |
| | | } |
| | | } |
| | | cout << "Virtualiz. class :" << descByVirt.find(exec_env_info.virtualization)->second << endl; |
| | | cout << "Virtualiz. detail:" << descByVirtDetail.find(exec_env_info.virtualization_detail)->second << endl; |
| | | cout << "Cloud provider :" << descByCloudProvider.find(exec_env_info.cloud_provider)->second << endl; |
| | | |
| | | std::vector<license::os::OsAdapterInfo> adapterInfos; |
| | | FUNCTION_RETURN ret = license::os::getAdapterInfos(adapterInfos); |
| | |
| | | add_subdirectory("hw_identifier") |
| | | |
| | | ADD_LIBRARY(licensecc_static STATIC |
| | | |
| | | licensecc.cpp |
| | | LicenseReader.cpp |
| | | limits/license_verifier.cpp |
| | |
| | | endif(CODE_COVERAGE AND UNIX) |
| | | |
| | | define_property(TARGET PROPERTY WITH_OPENSSL BRIEF_DOCS "need openssl to compile" FULL_DOCS "ff") |
| | | |
| | | IF(UNIX OR OPENSSL_FOUND) |
| | | target_compile_definitions(licensecc_static PUBLIC HAS_OPENSSL) |
| | | set_target_properties(licensecc_static PROPERTIES WITH_OPENSSL 1) |
| | | target_link_libraries(licensecc_static PUBLIC OpenSSL::Crypto ${EXTERNAL_LIBS} ${CMAKE_DL_LIBS}) |
| | | target_link_libraries(licensecc_static PUBLIC |
| | | |
| | | OpenSSL::Crypto |
| | | ${EXTERNAL_LIBS} ${CMAKE_DL_LIBS} |
| | | |
| | | ) |
| | | ELSE(UNIX OR OPENSSL_FOUND) |
| | | set_target_properties(licensecc_static PROPERTIES WITH_OPENSSL 0) |
| | | target_link_libraries(licensecc_static PUBLIC ${EXTERNAL_LIBS}) |
| | | ENDIF(UNIX OR OPENSSL_FOUND) |
| | | |
| | | |
| | | |
| | | #set_property(TARGET licensecc_static PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") |
| | | |
| | | target_include_directories(licensecc_static |
| | |
| | | } |
| | | } |
| | | |
| | | #ifndef NDEBUG |
| | | cout << "license to sign [" << oss.str() << "]" << endl; |
| | | #endif |
| | | return oss.str(); |
| | | } |
| | | |
| | |
| | | #include <errno.h> |
| | | #include <cstring> |
| | | #include "file_utils.hpp" |
| | | |
| | | #include "../test/functional/generate-license.h" |
| | | namespace license { |
| | | using namespace std; |
| | | |
| | |
| | | return path.substr(0, dotpos); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | #include <list> |
| | | #include <algorithm> |
| | | #include <stdio.h> |
| | | #include <functional> |
| | | |
| | | #ifdef SI_SUPPORT_IOSTREAMS |
| | | # include <iostream> |
| | |
| | | }; |
| | | |
| | | #define SI_UTF8_SIGNATURE "\xEF\xBB\xBF" |
| | | |
| | | #include <functional> |
| | | #ifdef _WIN32 |
| | | # define SI_NEWLINE_A "\r\n" |
| | | # define SI_NEWLINE_W L"\r\n" |
| | |
| | | #endif |
| | | |
| | | /** Strict less ordering by name of key only */ |
| | | struct KeyOrder : std::binary_function<Entry, Entry, bool> { |
| | | |
| | | struct KeyOrder /*: std::binary_function<Entry, Entry, bool>*/{ |
| | | bool operator()(const Entry & lhs, const Entry & rhs) const { |
| | | const static SI_STRLESS isLess = SI_STRLESS(); |
| | | return isLess(lhs.pItem, rhs.pItem); |
| | |
| | | }; |
| | | |
| | | /** Strict less ordering by order, and then name of key */ |
| | | struct LoadOrder : std::binary_function<Entry, Entry, bool> { |
| | | struct LoadOrder /*: std::binary_function<Entry, Entry, bool>*/ |
| | | { |
| | | |
| | | bool operator()(const Entry & lhs, const Entry & rhs) const { |
| | | if (lhs.nOrder != rhs.nOrder) { |
| | | return lhs.nOrder < rhs.nOrder; |
| | |
| | | #include "limits/license_verifier.hpp" |
| | | #include "base/string_utils.h" |
| | | #include "LicenseReader.hpp" |
| | | |
| | | #include "../test/functional/generate-license.h" |
| | | using namespace license; |
| | | using namespace std; |
| | | |
| | | void print_error(char out_buffer[LCC_API_ERROR_BUFFER_SIZE], LicenseInfo* licenseInfo) {} |
| | |
| | | } |
| | | |
| | | static void mergeLicenses(const vector<LicenseInfo>& licenses, LicenseInfo* license_out) { |
| | | |
| | | if (license_out != nullptr) { |
| | | int days_left = INT_MIN; |
| | | for (auto it = licenses.begin(); it != licenses.end(); it++) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | LCC_EVENT_TYPE acquire_license(const CallerInformations* callerInformation, const LicenseLocation* licenseLocation, |
| | | LicenseInfo* license_out) { |
| | | const license::LicenseReader lr = license::LicenseReader(licenseLocation); |
| | |
| | | if (license_out != nullptr) { |
| | | er.exportLastEvents(license_out->status, LCC_API_AUDIT_EVENT_NUM); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | |
| | | LCC_EVENT_TYPE confirm_license(char* product, LicenseLocation licenseLocation) { return LICENSE_OK; } |
| | | |
| | | LCC_EVENT_TYPE release_license(char* product, LicenseLocation licenseLocation) { return LICENSE_OK; } |
| | |
| | | using namespace license; |
| | | using namespace std; |
| | | |
| | | //测试一个通用的许可证 |
| | | /** |
| | | * Test a generic license, passing a bad license number trough the api. |
| | | * see projects/DEFAULT/include/licensecc/DEFAULT/licensecc_properties.h (magic should be 0) |
| | |
| | | #include <licensecc_properties_test.h> |
| | | #include <licensecc_properties.h> |
| | | |
| | | #include "../../src/library/base/base.h" |
| | | #include"licensecc/licensecc.h" |
| | | #include "../../src/library/ini/SimpleIni.h" |
| | | #include "generate-license.h" |
| | | |
| | | #include "../src/library/base/file_utils.hpp" |
| | | namespace fs = boost::filesystem; |
| | | using namespace std; |
| | | |
| | |
| | | |
| | | std::string generate_license(const std::string& fname, const std::vector<std::string>& other_args); |
| | | std::string sign_data(const std::string& data, const std::string& test_name); |
| | | void tetsMultiple_features(); |
| | | |
| | | } // namespace test |
| | | } // namespace license |
| | |
| | | } |
| | | #endif |
| | | |
| | | |
| | | // |
| | | // BOOST_AUTO_TEST_CASE( hw_identifier ) { |
| | | // const string licLocation(PROJECT_TEST_TEMP_DIR "/hw_identifier.lic"); |