Skip to content

AlreadyInitilized reports new library instead of previous #193

Closed
@msetina

Description

@msetina
Contributor
def lib(so):
    """
    Wrap the main library call coming from Cython with a preemptive
    dynamic loading.
    """
    global _lib
    global _so

    if _lib:
        if _so != so:
            raise AlreadyInitialized(  # noqa: F405
-                "Already initialized with %s" % so)
+                "Already initialized with %s" % _so)
        else:
            return _lib

    from . import _pkcs11

    _lib = _pkcs11.lib(so)
    _so = so

    return _lib

Activity

msetina

msetina commented on Feb 13, 2025

@msetina
ContributorAuthor

Is it possible to switch to another library?

HRio

HRio commented on Feb 14, 2025

@HRio
Contributor

This happens when for instance switching between opensc and softhsm

See PR #185

msetina

msetina commented on Feb 14, 2025

@msetina
ContributorAuthor

Had different libraries, but I agree. I was wondering why switching is not possible. What is it protecting?
If user takes out card while running and inserts another in this case they can not switch library if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @HRio@msetina

        Issue actions

          AlreadyInitilized reports new library instead of previous · Issue #193 · pyauth/python-pkcs11