When we hadn't forked, but were just not initialized, still return
CKR_CRYPTOKI_NOT_INITIALIZED from managed modules.
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.