]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
crypto: allow PK11 module to load even if it's already initialized
authorKefu Chai <kchai@redhat.com>
Wed, 21 Jun 2017 06:25:01 +0000 (14:25 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 23 Jun 2017 03:31:07 +0000 (11:31 +0800)
commitfcc3effd8b447ef0c54b4c806b8f6e996d7467dd
tree8232a14b8b4cd1c8087381bee47bee1ae98ea7df
parent6ffb6eb0e8db352a3742071d1554a9e1d02e9f2d
crypto: allow PK11 module to load even if it's already initialized

there is chance that other pieces of application loads PK11 module
already and does not finalize it before calling common_init_finish().

also, upon fork, PK11 module resets its entire status including `nsc_init`,
by which PK11 module tell if it is initialized or not. so the behavior
of NSS_InitContext() could be different before and after fork. that's
another reason to ignore CKR_CRYPTOKI_ALREADY_INITIALIZED error (see
NSS_GetError()).

Fixes: http://tracker.ceph.com/issues/19741
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/ceph_crypto.cc