Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

option(COVERAGE "Build with coverage" ON)

find_package(OpenSSL REQUIRED COMPONENTS Crypto)
find_package(PkgConfig REQUIRED)
pkg_check_modules(P11Kit REQUIRED p11-kit-1)

if(COVERAGE)
message(STATUS "Compiling test targets with coverage enabled")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage -fprofile-update=atomic")
Expand All @@ -25,5 +29,5 @@ file(GLOB_RECURSE SRC_FILES src/*.cpp)

add_library(pkcs11-to-cmd SHARED ${SRC_FILES})

target_link_libraries(pkcs11-to-cmd PRIVATE pthread)
target_include_directories(pkcs11-to-cmd PRIVATE /usr/include/p11-kit-1/p11-kit)
target_link_libraries(pkcs11-to-cmd PRIVATE OpenSSL::Crypto pthread)
target_include_directories(pkcs11-to-cmd PRIVATE ${P11Kit_INCLUDE_DIRS})
5 changes: 3 additions & 2 deletions src/blind_implementations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@

#include "debug.hpp"

#include <pkcs11.h>
#define CRYPTOKI_EXPORTS
#include <p11-kit/pkcs11.h>

extern "C" {
// LCOV_EXCL_START
// --- PKCS#11 dummy implementations for all functions ---
#define BLIND_FUNC_IMPL(name, ...) \
CK_RV blind_##name(__VA_ARGS__) \
CK_RV CK_SPEC blind_##name(__VA_ARGS__) \
{ \
debug("blind_" #name " called"); \
return CKR_FUNCTION_NOT_SUPPORTED; \
Expand Down
2 changes: 2 additions & 0 deletions src/consts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#pragma once

constexpr const char* PROVIDER_NAME = "pkcs11-to-cmd";
constexpr unsigned char PROVIDER_VERSION_MAJOR = 1;
constexpr unsigned char PROVIDER_VERSION_MINOR = 0;
constexpr const char* ENV_CMD = "P2C_CMD";
constexpr const char* ENV_DATA = "P2C_DATA";
constexpr const char* ENV_SIG = "P2C_SIG";
Expand Down
Loading