From: "Diaz de Grenu, Jose" <Jose.DiazdeGrenu@digi.com>
Date: Fri, 29 Jul 2016 17:20:28 +0200
Subject: [PATCH] hab4_pki_tree.sh: usa a random password for the default PKI
 generation

Signed-off-by: Diaz de Grenu, Jose <Jose.DiazdeGrenu@digi.com>
---
 keys/hab4_pki_tree.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/keys/hab4_pki_tree.sh b/keys/hab4_pki_tree.sh
index b2c6b71b604e..93347521cea1 100755
--- a/keys/hab4_pki_tree.sh
+++ b/keys/hab4_pki_tree.sh
@@ -95,9 +95,10 @@ fi
 # Check that the file "key_pass.txt" is present, if not create it with default user/pwd:
 if [ ! -f key_pass.txt ]
 then
-    echo "test" > key_pass.txt
-    echo "test" >> key_pass.txt
-    echo "A default file 'key_pass.txt' was created with password = test!"
+    password="$(openssl rand -base64 32)"
+    echo "${password}" > key_pass.txt
+    echo "${password}" >> key_pass.txt
+    echo "A file 'key_pass.txt' was created with a random password!"
 fi
 
 # The following is required otherwise OpenSSL complains
