| 1 |
The following are the system resources used by openCryptoki |
| 2 |
|
| 3 |
Please also see https://www.ibm.com/docs/en/linux-on-systems?topic=features-architecture-components-opencryptoki |
| 4 |
|
| 5 |
1.Shared memory = 1 per token + 1 segment between pkcsslotd & api + 1 statistic |
| 6 |
segment per user (if statistics are enabled) |
| 7 |
a. Between pkcsslotd and api |
| 8 |
The pkcsslotd daemon has its own shared memory segment that it creates |
| 9 |
and shares with API. Part of the data is passed through sockets but |
| 10 |
there is still some data shared via shared memory. |
| 11 |
|
| 12 |
b. Each token has its own shared memory segment. Opencryptoki processes |
| 13 |
attach to the token segment and shared memory acts as a global state |
| 14 |
tracking mechanism. |
| 15 |
# ls /dev/shm |
| 16 |
var.lib.opencryptoki.ccatok var.lib.opencryptoki.swtok |
| 17 |
var.lib.opencryptoki.ep11tok var.lib.opencryptoki.tpm.root |
| 18 |
var.lib.opencryptoki.lite |
| 19 |
|
| 20 |
c. If collection of statistics is enabled, there is one shared memory |
| 21 |
segment per user. It is created at the first usage of openCryptoki of |
| 22 |
a user, and is named var.lib.opencryptoki_stats_<uid> where <uid> is |
| 23 |
the numeric user id of the user. |
| 24 |
Use the pkcsstats tool to display the statistics, and remove statistics |
| 25 |
segments for users no longer needed. |
| 26 |
|
| 27 |
2. Sockets - 1 |
| 28 |
a.Unix socket between pkcsslotd and api to transfer slot information. |
| 29 |
|
| 30 |
b.Unix socket between pkcsslotd and an event source to deliver events to |
| 31 |
tokens of running openCryptoki applications. |
| 32 |
|
| 33 |
c.Netlink socket owned by pkcsslotd to listen for udev events (s390 platform |
| 34 |
only). This is used to produce events on APQNs becoming online or offline. |
| 35 |
|
| 36 |
d.epoll socket owned by pkcsslotd to wait for events on all the other |
| 37 |
sockets. |
| 38 |
|
| 39 |
3. Files |
| 40 |
a. Lock files - 1 global API LCK file + 1 per token (except tpm) + |
| 41 |
1 lock file per user on tpm token |
| 42 |
# ls -lh /var/lock/opencryptoki/ |
| 43 |
LCK..APIlock |
| 44 |
ccatok/LCK..ccatok |
| 45 |
ep11tok/LCK..ep11tok |
| 46 |
icsf/LCK..icsf |
| 47 |
lite/LCK..lite |
| 48 |
swtok/LCK..swtok |
| 49 |
tpm/<USER>/LCK..tpm |
| 50 |
|
| 51 |
b. Trace files - These are generated based on the environment variable |
| 52 |
OPENCRYPTOKI_TRACE_LEVEL per process in /var/log/opencryptoki. No max |
| 53 |
limit. |
| 54 |
|
| 55 |
c. Config files (some are optional) |
| 56 |
# ls -lh /etc/opencryptoki/ |
| 57 |
total 32K |
| 58 |
-rw-r--r--. 1 root root 4.6K Mar 15 13:47 ep11cpfilter.conf |
| 59 |
-rw-r--r--. 1 root root 4.0K Mar 15 13:24 ep11tok.conf |
| 60 |
-rw-r--r--. 1 root root 808 Mar 15 13:49 opencryptoki.conf |
| 61 |
-rw-r-----. 1 root pkcs11 584 Feb 1 16:38 p11sak_defined_attrs.conf |
| 62 |
-rw-r-----. 1 root pkcs11 5.6K Mar 2 16:45 policy.conf |
| 63 |
-rw-r-----. 1 root pkcs11 865 Feb 1 16:38 strength.conf |
| 64 |
|
| 65 |
d. Token data files - 3 files per token + 1 additional RACF file for icsf |
| 66 |
token + 1 MK_PRIVATE file for tpm token |
| 67 |
NVTOK.DAT - Token data like user pin, so pin etc |
| 68 |
MK_SO - Master key used for internal encryption hashed with SOPIN. This |
| 69 |
file does not exist on tpm token. |
| 70 |
MK_USER - Master key used for internal encryption hashed with USERPIN. |
| 71 |
This file does not exist on tpm token. |
| 72 |
RACF - icsf racf password encrypted. tpm token has wrapped keys per user |
| 73 |
/var/lib/opencryptoki/tpm/${USER}/PRIVATE_ROOT_KEY.pem |
| 74 |
/var/lib/opencryptoki/tpm/${USER}/PUBLIC_ROOT_KEY.pem |
| 75 |
|
| 76 |
e. Token object files - 1 OBJ_IDX file per token and the private object |
| 77 |
files + as many number of private token objects for tokens |
| 78 |
OBJ_IDX - A list of current token objects. |
| 79 |
|