diff options
author | Stef Walter <stef@thewalter.net> | 2014-08-07 08:37:50 +0200 |
---|---|---|
committer | Stef Walter <stef@thewalter.net> | 2014-08-07 13:38:29 +0200 |
commit | 8bfecc0fc9de01e5a775a1264d6b79e83361a0c5 (patch) | |
tree | db73fe87be58215997b71a89f9e318c1da0d802b | |
parent | 105d2efa18ee542b98fb1d9e68cf77d4b6c00f47 (diff) | |
download | p11-kit-8bfecc0fc9de01e5a775a1264d6b79e83361a0c5.tar.gz |
p11-kit: Tweak last commit, handle the not-forked case
When we hadn't forked, but were just not initialized, still return
CKR_CRYPTOKI_NOT_INITIALIZED from managed modules.
-rw-r--r-- | p11-kit/modules.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/p11-kit/modules.c b/p11-kit/modules.c index c979f2a..3da1a7d 100644 --- a/p11-kit/modules.c +++ b/p11-kit/modules.c @@ -1523,7 +1523,10 @@ managed_C_Finalize (CK_X_FUNCTION_LIST *self, p11_lock (); pid = getpid (); - if (managed->initialized != pid) { + if (managed->initialized == 0) { + rv = CKR_CRYPTOKI_NOT_INITIALIZED; + + } else if (managed->initialized != pid) { /* * In theory we should be returning CKR_CRYPTOKI_NOT_INITIALIZED here * but enough callers are not completely aware of their forking. |