File tree Expand file tree Collapse file tree 5 files changed +188
-126
lines changed Expand file tree Collapse file tree 5 files changed +188
-126
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1515
1616option (COVERAGE "Build with coverage" ON )
1717
18+ find_package (OpenSSL REQUIRED COMPONENTS Crypto)
19+ find_package (PkgConfig REQUIRED)
20+ pkg_check_modules(P11Kit REQUIRED p11-kit-1)
21+
1822if (COVERAGE)
1923 message (STATUS "Compiling test targets with coverage enabled" )
2024 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage -fprofile-update=atomic" )
@@ -25,5 +29,5 @@ file(GLOB_RECURSE SRC_FILES src/*.cpp)
2529
2630add_library (pkcs11-to-cmd SHARED ${SRC_FILES} )
2731
28- target_link_libraries (pkcs11-to-cmd PRIVATE pthread)
29- target_include_directories (pkcs11-to-cmd PRIVATE /usr/ include /p11-kit-1/p11-kit )
32+ target_link_libraries (pkcs11-to-cmd PRIVATE OpenSSL::Crypto pthread)
33+ target_include_directories (pkcs11-to-cmd PRIVATE ${P11Kit_INCLUDE_DIRS} )
Original file line number Diff line number Diff line change 1010
1111#include " debug.hpp"
1212
13- #include < pkcs11.h>
13+ #define CRYPTOKI_EXPORTS
14+ #include < p11-kit/pkcs11.h>
1415
1516extern " C" {
1617// LCOV_EXCL_START
1718// --- PKCS#11 dummy implementations for all functions ---
1819#define BLIND_FUNC_IMPL (name, ...) \
19- CK_RV blind_##name(__VA_ARGS__) \
20+ CK_RV CK_SPEC blind_##name(__VA_ARGS__) \
2021 { \
2122 debug (" blind_" #name " called" ); \
2223 return CKR_FUNCTION_NOT_SUPPORTED; \
Original file line number Diff line number Diff line change 99#pragma once
1010
1111constexpr const char * PROVIDER_NAME = " pkcs11-to-cmd" ;
12+ constexpr unsigned char PROVIDER_VERSION_MAJOR = 1 ;
13+ constexpr unsigned char PROVIDER_VERSION_MINOR = 0 ;
1214constexpr const char * ENV_CMD = " P2C_CMD" ;
1315constexpr const char * ENV_DATA = " P2C_DATA" ;
1416constexpr const char * ENV_SIG = " P2C_SIG" ;
You can’t perform that action at this time.
0 commit comments