diff options
author | Patrick Vacek <patrickvacek@gmail.com> | 2018-09-14 16:11:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-14 16:11:32 +0200 |
commit | 6257c2aa06967753759db3f7d5b92e496cfbf71c (patch) | |
tree | fe9e2fd7432d18f12dc4c5e4057aeea08b48b9b7 | |
parent | 376c960e55eecfe20ebe8a9d73e407337f016041 (diff) | |
parent | 3ca533c6216e9d0738210f62e475dfa845f5073c (diff) | |
download | meta-updater-6257c2aa06967753759db3f7d5b92e496cfbf71c.tar.gz |
Merge pull request #387 from advancedtelematic/refactor/OTA-900/hsm-prov-path-master
softhsm-testtoken: Update paths for token import.
-rwxr-xr-x | recipes-sota/aktualizr/aktualizr_git.bb | 2 | ||||
-rw-r--r-- | recipes-support/softhsm-testtoken/files/createtoken.sh | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index b8105a0..fd2fdd5 100755 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb | |||
@@ -26,7 +26,7 @@ SRC_URI = " \ | |||
26 | file://aktualizr-secondary.socket \ | 26 | file://aktualizr-secondary.socket \ |
27 | file://aktualizr-serialcan.service \ | 27 | file://aktualizr-serialcan.service \ |
28 | " | 28 | " |
29 | SRCREV = "062ab7756c375ee2c913d3197cafe4ee2f97ef2a" | 29 | SRCREV = "8083d4fa67046689d4bf784b908a048a58457d63" |
30 | BRANCH ?= "master" | 30 | BRANCH ?= "master" |
31 | 31 | ||
32 | S = "${WORKDIR}/git" | 32 | S = "${WORKDIR}/git" |
diff --git a/recipes-support/softhsm-testtoken/files/createtoken.sh b/recipes-support/softhsm-testtoken/files/createtoken.sh index 7b16f4e..b142945 100644 --- a/recipes-support/softhsm-testtoken/files/createtoken.sh +++ b/recipes-support/softhsm-testtoken/files/createtoken.sh | |||
@@ -5,7 +5,7 @@ if pkcs11-tool --module=/usr/lib/softhsm/libsofthsm2.so -O; then | |||
5 | exit 0 | 5 | exit 0 |
6 | fi | 6 | fi |
7 | 7 | ||
8 | if ! ls /var/sota/token/pkey.pem /var/sota/token/client.pem; then | 8 | if ! ls /var/sota/import/pkey.pem /var/sota/import/client.pem; then |
9 | # Key/certificate pair is not present, repeat | 9 | # Key/certificate pair is not present, repeat |
10 | exit 1 | 10 | exit 1 |
11 | fi | 11 | fi |
@@ -13,14 +13,14 @@ fi | |||
13 | mkdir -p /var/lib/softhsm/tokens | 13 | mkdir -p /var/lib/softhsm/tokens |
14 | softhsm2-util --init-token --slot 0 --label "Virtual token" --pin 1234 --so-pin 1234 | 14 | softhsm2-util --init-token --slot 0 --label "Virtual token" --pin 1234 --so-pin 1234 |
15 | 15 | ||
16 | softhsm2-util --import /var/sota/token/pkey.pem --label "pkey" --id 02 --token 'Virtual token' --pin 1234 | 16 | softhsm2-util --import /var/sota/import/pkey.pem --label "pkey" --id 02 --token 'Virtual token' --pin 1234 |
17 | openssl x509 -outform der -in /var/sota/token/client.pem -out /var/sota/token/client.der | 17 | openssl x509 -outform der -in /var/sota/import/client.pem -out /var/sota/import/client.der |
18 | pkcs11-tool --module=/usr/lib/softhsm/libsofthsm2.so --id 1 --write-object /var/sota/token/client.der --type cert --login --pin 1234 | 18 | pkcs11-tool --module=/usr/lib/softhsm/libsofthsm2.so --id 1 --write-object /var/sota/import/client.der --type cert --login --pin 1234 |
19 | 19 | ||
20 | # Import UPTANE keypair if it exists | 20 | # Import UPTANE keypair if it exists |
21 | if [ -f /var/sota/token/ecukey.pem ]; then | 21 | if [ -f /var/sota/import/ecukey.pem ]; then |
22 | openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in /var/sota/token/ecukey.pem -out /var/sota/token/ecukey.p8 | 22 | openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in /var/sota/import/ecukey.pem -out /var/sota/import/ecukey.p8 |
23 | softhsm2-util --import /var/sota/token/ecukey.p8 --label "uptanekey" --id 03 --token 'Virtual token' --pin 1234 | 23 | softhsm2-util --import /var/sota/import/ecukey.p8 --label "uptanekey" --id 03 --token 'Virtual token' --pin 1234 |
24 | fi | 24 | fi |
25 | 25 | ||
26 | exit 0 | 26 | exit 0 |