Skip to content

add CKM_EDDSA and CK_EDDSA_PARAMS support - #141

Merged
LudovicRousseau merged 3 commits into
LudovicRousseau:masterfrom
fuzzykat:feature/ckm_eddsa
Jul 27, 2025
Merged

add CKM_EDDSA and CK_EDDSA_PARAMS support#141
LudovicRousseau merged 3 commits into
LudovicRousseau:masterfrom
fuzzykat:feature/ckm_eddsa

Conversation

@fuzzykat

Copy link
Copy Markdown
Contributor

No description provided.

@fuzzykat
fuzzykat force-pushed the feature/ckm_eddsa branch 2 times, most recently from 8290db5 to 6460f10 Compare July 26, 2025 08:35
@fuzzykat
fuzzykat force-pushed the feature/ckm_eddsa branch from 6460f10 to bab5f53 Compare July 26, 2025 08:42
Comment thread test/test_asymetric_ECC.py Outdated
@LudovicRousseau

Copy link
Copy Markdown
Owner

Do yo know why the github action for tox does NOT finish?
https://github.com/LudovicRousseau/PyKCS11/actions/runs/16540031592/job/46779908617

It was working fine before your patch.

@fuzzykat

Copy link
Copy Markdown
Contributor Author

Do yo know why the github action for tox does NOT finish? https://github.com/LudovicRousseau/PyKCS11/actions/runs/16540031592/job/46779908617

It was working fine before your patch.

I have no idea yet, I'll try to investigate, but I need some time to reproduce that workflow locally.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 93.528% (+0.05%) from 93.474%
when pulling 60dbe73 on fuzzykat:feature/ckm_eddsa
into 2094a49 on LudovicRousseau:master.

@fuzzykat

fuzzykat commented Jul 26, 2025

Copy link
Copy Markdown
Contributor Author

Here is what I discovered: the tox workflow likely hangs because of a deadlock caused presumably by a certain sequence of load() and unload() calls. The strange thing is that this only reproduces when I run tests with tox, while python -m unittest discover successfully finishes when invoked directly.

Next I investigated the code in load() and it seems to me that it executes with the lock more code than it really should. By trial and error method I found out that the snippet below is the one which leads to the deadlock:

    if pkcs11dll_filename is None:
        pkcs11dll_filename = os.getenv("PYKCS11LIB")
        if pkcs11dll_filename is None:
            raise PyKCS11Error(
                -1, "No PKCS11 library specified (set PYKCS11LIB env variable)"
            )

I didn't manage to figure out the exact cause of the problem but it appears to be connected with os.getenv("PYKCS11LIB"), since after I moved it outside of the _lock scope the tests don't hang anymore. Anyway the above code should not be placed in the scope of the lock in the first place, since it doesn't modify PyKCS11Lib._loaded_libs, which is protected by the mutex.

tl;dr; I managed to fix the problem by moving os.getenv("PYKCS11LIB") outside of the mutex scope in load(). The commit is included in this PR.

@LudovicRousseau
LudovicRousseau merged commit abea61f into LudovicRousseau:master Jul 27, 2025
18 checks passed
@LudovicRousseau

Copy link
Copy Markdown
Owner

God job.
Thanks

@fuzzykat
fuzzykat deleted the feature/ckm_eddsa branch July 27, 2025 12:26
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