Skip to content

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

There is a release candidate with the fix, see information here.

Thanks for your contribution again!

@mrts mrts added the duplicate This issue or pull request already exists label Jan 5, 2025
@mrts
Copy link
Member

mrts commented Jan 7, 2025

Closing as duplicate of #93

@mrts mrts closed this Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants