@@ -4,11 +4,11 @@ Setting up the development environment
4
4
Prerequisites
5
5
~~~~~~~~~~~~~
6
6
7
- In addition to the standard :doc: `../prereqs ` for Fabric, the following prerequisites are also required:
7
+ In addition to the standard :doc: `../prereqs ` for Fabric, the following prerequisites are also required to run the Fabric tests :
8
8
9
9
- (macOS) `Xcode Command Line Tools <https://developer.apple.com/downloads/ >`__
10
- - (All platforms) `SoftHSM <https://github.com/opendnssec/SoftHSMv2 >`__ use version 2.5 as 2.6 is not operable in this environment
11
10
- (All platforms) `jq <https://stedolan.github.io/jq/download/ >`__
11
+ - (All platforms) `SoftHSM <https://github.com/opendnssec/SoftHSMv2 >`__ use version 2.5 as 2.6 is not operable in this environment
12
12
13
13
For Linux platforms, including WSL2 on Windows, also required are various build tools such as gnu-make and
14
14
C compiler. On ubuntu and it's derivatives you can install the required toolset by using the command
20
20
21
21
Installing SoftHSM
22
22
^^^^^^^^^^^^^^^^^^
23
+ SoftHSM is only required if you would like to run the SoftHSM integration tests (integration/pkcs11 directory).
24
+ If you don't install and configure SoftHSM, the integration tests will automatically be skipped.
23
25
Ensure you install ``2.5 `` of softhsm, if you are using a distribution package manager such as ``apt `` on ubuntu
24
26
or Homebrew on Mac OS, make sure that it offers this version otherwise you will need to install from source. Version 2.6
25
- of SoftHSM is known to have problems. Older versions than 2.5 may work however .
27
+ of SoftHSM is known to have problems (but there is evidence integration tests pass on 2.6.1) .
26
28
27
29
When installing SoftHSM, you should note the path where the shared library ``libsofthsm2.so `` is installed
28
30
you may need to have to provide this later in an environment variable to get the PKCS11 tests to pass.
@@ -41,7 +43,12 @@ Once Homebrew is ready, installing the necessary prerequisites is very easy, for
41
43
brew install git jq
42
44
brew install --cask docker
43
45
44
- Go and SoftHSM are also available from Homebrew, but make sure you install the appropriate versions
46
+ Go and SoftHSM are also available from Homebrew, but make sure you install the appropriate versions:
47
+
48
+ ::
49
+
50
+
51
+ brew install softhsm
45
52
46
53
Docker Desktop must be launched to complete the installation, so be sure to open
47
54
the application after installing it:
@@ -72,7 +79,7 @@ the repository.
72
79
Configure SoftHSM
73
80
^^^^^^^^^^^^^^^^^
74
81
75
- A PKCS #11 cryptographic token implementation is required to run the unit
82
+ A PKCS #11 cryptographic token implementation is required to run the integration
76
83
tests. The PKCS #11 API is used by the bccsp component of Fabric to interact
77
84
with hardware security modules (HSMs) that store cryptographic information and
78
85
perform cryptographic computations. For test environments, SoftHSM can be used
@@ -89,23 +96,30 @@ to an appropriate location. Please see the man page for ``softhsm2.conf`` for
89
96
details.
90
97
91
98
After SoftHSM has been configured, the following command can be used to
92
- initialize the token required by the unit tests:
99
+ initialize the token required by the integration tests:
93
100
94
101
::
95
102
96
103
softhsm2-util --init-token --slot 0 --label ForFabric --so-pin 1234 --pin 98765432
97
104
98
105
If tests are unable to locate the libsofthsm2.so library in your environment,
99
106
specify the library path, the PIN, and the label of your token in the
100
- appropriate environment variables. For example, on macOS, depending on where the
101
- library has been installed:
107
+ appropriate environment variables. For example, if installed using Homebrew on macOS (Intel):
102
108
103
109
::
104
110
105
111
export PKCS11_LIB="/usr/local/Cellar/softhsm/2.6.1/lib/softhsm/libsofthsm2.so"
106
112
export PKCS11_PIN=98765432
107
113
export PKCS11_LABEL="ForFabric"
108
114
115
+ And for macOS on Apple silicon:
116
+
117
+ ::
118
+
119
+ export PKCS11_LIB=/opt/homebrew/Cellar/softhsm/2.6.1/lib/softhsm/libsofthsm2.so
120
+ export PKCS11_PIN=98765432
121
+ export PKCS11_LABEL="ForFabric"
122
+
109
123
If you installed SoftHSM on ubuntu from source then the environment variables may look like
110
124
111
125
::
0 commit comments