Update location of passphrase in distcenter 75/69175/2
authorKiran Kamineni <kiran.k.kamineni@intel.com>
Wed, 26 Sep 2018 19:48:34 +0000 (12:48 -0700)
committerKiran Kamineni <kiran.k.kamineni@intel.com>
Wed, 26 Sep 2018 20:11:05 +0000 (13:11 -0700)
Location for passphrase needed to be updated in
scenarios where tpm is not available
P2: Add more changes to get the passphrase to be passed
    correctly

Issue-ID: AAF-521
Change-Id: Ibf022e05489e77cdcec642a543abf5cec3c21e53
Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
bin/caservicecontainer/application.sh
bin/caservicecontainer/import.sh
bin/distcenter/entrypoint.sh

index a7c864d..da4d2d8 100755 (executable)
@@ -12,7 +12,7 @@ applicationlibrary="/usr/local/lib/softhsm/libsofthsm2.so"
 # Setting up the java application and running the application
 # 1. Create the configuration pkcs11.cfg for the application
 # Remove any existing cfg file first from the CWD
-rm pkcs11.cfg
+rm -f pkcs11.cfg
 touch pkcs11.cfg
 chmod 755 pkcs11.cfg
 echo "name = ${key_label}" >> pkcs11.cfg
index 7fa8909..e8ead2e 100755 (executable)
@@ -60,9 +60,7 @@ else
     cd ${DATA_FOLDER}
 
     # 3.a Extract the Private key using passphrase
-    passphrase="$(cat passphrase)"
-    echo "${passphrase}"
-    echo "${passphrase}" | gpg --batch --yes --passphrase-fd 0 privkey.pem.gpg
+    cat passphrase | gpg --batch --yes --passphrase-fd 0 privkey.pem.gpg
 
     # 3.b Convert the Private key pem into der format
     openssl rsa -in ./privkey.pem -outform DER -out privatekey.der
index 6aac3ca..92778f7 100755 (executable)
@@ -19,7 +19,7 @@ then
   done
 else
   cd /distcenter/ca
-  cat /distcenter/passphrase/passphrase | gpg --no-tty --symmetric -z 9 --require-secmem \
+  cat /distcenter/data/passphrase | gpg --no-tty --symmetric -z 9 --require-secmem \
     --cipher-algo AES256 --s2k-cipher-algo AES256 --s2k-digest-algo SHA512 \
     --s2k-mode 3 --s2k-count 65000000 --compress-algo BZIP2 \
     --passphrase-fd 0 privkey.pem