Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Croatian PKCS11 module path #85

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rborosak
Copy link

Fixed paths for croatian pkcs11 modul from eid to certilia

Signed-off-by: Firstname Lastname [email protected]

Fixed paths for croatian pkcs11 modul from eid to certilia
@mrts
Copy link
Member

mrts commented Sep 24, 2024

Thanks a lot for the fix! We will include this soon.

@mrts mrts changed the title Croatian pkcs11 modul path Fixed Croatian PKCS11 module path Sep 24, 2024
metsma
metsma previously approved these changes Sep 25, 2024
@mrts
Copy link
Member

mrts commented Nov 1, 2024

We should make this backwards-compatible, something along the lines of the following:

#include <filesystem>
namespace fs = std::filesystem;

inline fs::path croatianPkcs11ModulePath()
{
    #ifdef _WIN32
        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__
        fs::path certiliaPath = "/Library/AKD/Certilia Middleware/pkcs11/libEidPkcs11.so";
        fs::path eidPath = "/Library/AKD/eID Middleware/pkcs11/libEidPkcs11.so";
        return fs::exists(certiliaPath) ? certiliaPath : eidPath;
    #else // Linux
        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
}

Can you please test this?

@mrts mrts requested a review from metsma November 1, 2024 16:21
@mrts mrts dismissed metsma’s stale review November 1, 2024 16:22

We need backwards-compatiblity

@mrts
Copy link
Member

mrts commented Nov 1, 2024

Another thing, in macOS the library is in a different place (same for both the old and new driver):

image

Made the Croatian PKCS11 module path  backwards-compatible
@rborosak
Copy link
Author

Hi, I have made the Croatian PKCS11 module path backward compatible. Also, fixed the path for macOS since the old one was invalid. @mrts since I'm not familiar with macOS I've created a check for .so and .dylib file extensions which may be unnecessary.
Can you please take a look and merge the changes so you can make a new version of the web-id extensions because there is a lot of new users which have a "new" path for pkcs11 module

@mrts
Copy link
Member

mrts commented Dec 2, 2024

Thanks! In macOS the only path should be /usr/local/lib/pkcs11/libEidPkcs11.so. But I can fix that myself. OK, if it is becoming a problem, we will make an unofficial, untested version 2.6.1 release candidate as soon as possible for you.

@mrts
Copy link
Member

mrts commented Dec 3, 2024

We have made an unofficial, untested version 2.6.1 release candidate with support for Luxembourg cards and new version of Croatian eID middleware, it is available here.

I included your work by cherry-picking your commit to this PR: #92.

Thanks for your contribution again! Please test v2.6.1-rc1 and let us know if it works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants