summaryrefslogtreecommitdiffstats
path: root/recipes-support
diff options
context:
space:
mode:
authorPatrick Vacek <patrickvacek@gmail.com>2018-09-14 14:15:05 +0200
committerLaurent Bonnans <laurent.bonnans@here.com>2018-09-14 14:31:05 +0200
commit3ca533c6216e9d0738210f62e475dfa845f5073c (patch)
tree805c12944e64181b69eff5ddbafb569081cfd5f6 /recipes-support
parentb252a30428b448b610edf59c0c0116a45039e4c8 (diff)
downloadmeta-updater-3ca533c6216e9d0738210f62e475dfa845f5073c.tar.gz
softhsm-testtoken: Update paths for token import.refactor/OTA-900/hsm-prov-path-master
And bump aktualizr recipe
Diffstat (limited to 'recipes-support')
-rw-r--r--recipes-support/softhsm-testtoken/files/createtoken.sh14
1 files changed, 7 insertions, 7 deletions
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
6fi 6fi
7 7
8if ! ls /var/sota/token/pkey.pem /var/sota/token/client.pem; then 8if ! 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
11fi 11fi
@@ -13,14 +13,14 @@ fi
13mkdir -p /var/lib/softhsm/tokens 13mkdir -p /var/lib/softhsm/tokens
14softhsm2-util --init-token --slot 0 --label "Virtual token" --pin 1234 --so-pin 1234 14softhsm2-util --init-token --slot 0 --label "Virtual token" --pin 1234 --so-pin 1234
15 15
16softhsm2-util --import /var/sota/token/pkey.pem --label "pkey" --id 02 --token 'Virtual token' --pin 1234 16softhsm2-util --import /var/sota/import/pkey.pem --label "pkey" --id 02 --token 'Virtual token' --pin 1234
17openssl x509 -outform der -in /var/sota/token/client.pem -out /var/sota/token/client.der 17openssl x509 -outform der -in /var/sota/import/client.pem -out /var/sota/import/client.der
18pkcs11-tool --module=/usr/lib/softhsm/libsofthsm2.so --id 1 --write-object /var/sota/token/client.der --type cert --login --pin 1234 18pkcs11-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
21if [ -f /var/sota/token/ecukey.pem ]; then 21if [ -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
24fi 24fi
25 25
26exit 0 26exit 0