Skip to content
Merged
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
21 changes: 18 additions & 3 deletions src/electronic-ids/pkcs11/Pkcs11ElectronicID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,26 @@ inline fs::path lithuanianPKCS11ModulePath()
inline fs::path croatianPkcs11ModulePath()
{
#ifdef _WIN32
return programFilesPath() / L"AKD/eID Middleware/pkcs11/AkdEidPkcs11_64.dll";
fs::path certiliaPath =
programFilesPath() / L"AKD/Certilia Middleware/pkcs11/AkdEidPkcs11_64.dll";
fs::path eidPath = programFilesPath() / L"AKD/eID Middleware/pkcs11/AkdEidPkcs11_64.dll";
return fs::exists(certiliaPath) ? certiliaPath : eidPath;
#elif defined __APPLE__
return "/Library/AKD/eID Middleware/pkcs11/libEidPkcs11.so"; // NB! Not tested.
// The driver provider installs the library to /usr/local/lib/pkcs11, but
// sandboxed applications cannot access /usr/local/ due to macOS restrictions.
// To make the solution work, the library libEidPkcs11.dylib and License.bin must be
// copied to /Library/AKD/pkcs11, which is accessible in sandboxed environments:
//
// sudo mkdir -p /Library/AKD/pkcs11
// sudo cp -a /usr/local/lib/pkcs11/{libEidPkcs11.dylib,License.bin} /Library/AKD/pkcs11/
//
// This workaround is required until the driver provider addresses the issue.
// NB! This is not tested.
return "/Library/AKD/pkcs11/libEidPkcs11.dylib";
#else // Linux
return "/usr/lib/akd/eidmiddleware/pkcs11/libEidPkcs11.so";
fs::path certiliaPath = "/usr/lib/akd/certiliamiddleware/pkcs11/libEidPkcs11.so";
fs::path eidPath = "/usr/lib/akd/eidmiddleware/pkcs11/libEidPkcs11.so";
return fs::exists(certiliaPath) ? certiliaPath : eidPath;
#endif
}

Expand Down
Loading