| |
@@ -34,6 +34,8 @@
|
| |
#include "store-int.h"
|
| |
#include "util-n.h"
|
| |
|
| |
+ #include <talloc.h>
|
| |
+
|
| |
#define NODE "/proc/sys/crypto/fips_enabled"
|
| |
|
| |
static PRBool force_fips = PR_FALSE;
|
| |
@@ -289,7 +291,13 @@
|
| |
}
|
| |
|
| |
char *
|
| |
- util_internal_token_name()
|
| |
+ util_internal_token_name(void *ctx)
|
| |
{
|
| |
- return PK11_GetTokenName(PK11_GetInternalKeySlot());
|
| |
+ PK11SlotInfo *slot = NULL;
|
| |
+ char *name = NULL;
|
| |
+
|
| |
+ slot = PK11_GetInternalKeySlot();
|
| |
+ name = talloc_strdup(ctx, PK11_GetTokenName(slot));
|
| |
+ PK11_FreeSlot(slot);
|
| |
+ return name;
|
| |
}
|
| |
The slot wasn't being freed every time util_internal_token_name()
was called which caused NSS_Shutdown() and NSS_ShutdownContext()
to return SEC_ERROR_BUSY.
Discovered in IPA issue https://pagure.io/freeipa/issue/8533