From 3ca533c6216e9d0738210f62e475dfa845f5073c Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Fri, 14 Sep 2018 14:15:05 +0200 Subject: softhsm-testtoken: Update paths for token import. And bump aktualizr recipe --- recipes-sota/aktualizr/aktualizr_git.bb | 2 +- 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 = " \ file://aktualizr-secondary.socket \ file://aktualizr-serialcan.service \ " -SRCREV = "062ab7756c375ee2c913d3197cafe4ee2f97ef2a" +SRCREV = "8083d4fa67046689d4bf784b908a048a58457d63" BRANCH ?= "master" 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 exit 0 fi -if ! ls /var/sota/token/pkey.pem /var/sota/token/client.pem; then +if ! ls /var/sota/import/pkey.pem /var/sota/import/client.pem; then # Key/certificate pair is not present, repeat exit 1 fi @@ -13,14 +13,14 @@ fi mkdir -p /var/lib/softhsm/tokens softhsm2-util --init-token --slot 0 --label "Virtual token" --pin 1234 --so-pin 1234 -softhsm2-util --import /var/sota/token/pkey.pem --label "pkey" --id 02 --token 'Virtual token' --pin 1234 -openssl x509 -outform der -in /var/sota/token/client.pem -out /var/sota/token/client.der -pkcs11-tool --module=/usr/lib/softhsm/libsofthsm2.so --id 1 --write-object /var/sota/token/client.der --type cert --login --pin 1234 +softhsm2-util --import /var/sota/import/pkey.pem --label "pkey" --id 02 --token 'Virtual token' --pin 1234 +openssl x509 -outform der -in /var/sota/import/client.pem -out /var/sota/import/client.der +pkcs11-tool --module=/usr/lib/softhsm/libsofthsm2.so --id 1 --write-object /var/sota/import/client.der --type cert --login --pin 1234 # Import UPTANE keypair if it exists -if [ -f /var/sota/token/ecukey.pem ]; then - openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in /var/sota/token/ecukey.pem -out /var/sota/token/ecukey.p8 - softhsm2-util --import /var/sota/token/ecukey.p8 --label "uptanekey" --id 03 --token 'Virtual token' --pin 1234 +if [ -f /var/sota/import/ecukey.pem ]; then + openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in /var/sota/import/ecukey.pem -out /var/sota/import/ecukey.p8 + softhsm2-util --import /var/sota/import/ecukey.p8 --label "uptanekey" --id 03 --token 'Virtual token' --pin 1234 fi exit 0 -- cgit v1.2.3-54-g00ecf