Register manager of pkcs11 plugin as library object
This commit is contained in:
@@ -323,17 +323,11 @@ METHOD(pkcs11_manager_t, create_token_enumerator, enumerator_t*,
|
||||
return &enumerator->public;
|
||||
}
|
||||
|
||||
/**
|
||||
* Singleton instance
|
||||
*/
|
||||
static private_pkcs11_manager_t *singleton = NULL;
|
||||
|
||||
METHOD(pkcs11_manager_t, destroy, void,
|
||||
private_pkcs11_manager_t *this)
|
||||
{
|
||||
this->libs->destroy_function(this->libs, (void*)lib_entry_destroy);
|
||||
free(this);
|
||||
singleton = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -386,8 +380,6 @@ pkcs11_manager_t *pkcs11_manager_create(pkcs11_manager_token_event_t cb,
|
||||
}
|
||||
enumerator->destroy(enumerator);
|
||||
|
||||
singleton = this;
|
||||
|
||||
enumerator = this->libs->create_enumerator(this->libs);
|
||||
while (enumerator->enumerate(enumerator, &entry))
|
||||
{
|
||||
@@ -401,10 +393,3 @@ pkcs11_manager_t *pkcs11_manager_create(pkcs11_manager_token_event_t cb,
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
/**
|
||||
* See header
|
||||
*/
|
||||
pkcs11_manager_t *pkcs11_manager_get()
|
||||
{
|
||||
return (pkcs11_manager_t*)singleton;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user