Fixes Issue #148

This commit is contained in:
Kaladin Light 2016-11-11 17:45:48 -05:00
parent cf9f052445
commit 7d34c0cae6

View file

@ -68,13 +68,16 @@ function keyPASS() {
exit 1 exit 1
fi fi
#Escape chars in PASSWD
PASSWD=$(echo -n $PASSWD | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/\$/\\\$/g' -e 's/!/\\!/g' -e 's/\./\\\./g' -e "s/'/\\\'/g" -e 's/"/\\"/g' -e 's/\*/\\\*/g' -e 's/\@/\\\@/g' -e 's/\#/\\\#/g' -e 's/£/\\£/g' -e 's/%/\\%/g' -e 's/\^/\\\^/g' -e 's/\&/\\\&/g' -e 's/(/\\(/g' -e 's/)/\\)/g' -e 's/-/\\-/g' -e 's/_/\\_/g' -e 's/\+/\\\+/g' -e 's/=/\\=/g' -e 's/\[/\\\[/g' -e 's/\]/\\\]/g' -e 's/;/\\;/g' -e 's/:/\\:/g' -e 's/|/\\|/g' -e 's/</\\</g' -e 's/>/\\>/g' -e 's/,/\\,/g' -e 's/?/\\?/g' -e 's/~/\\~/g' -e 's/{/\\{/g' -e 's/}/\\}/g')
#Build the client key and then encrypt the key #Build the client key and then encrypt the key
expect << EOF expect << EOF
set timeout -1 set timeout -1
spawn ./build-key-pass "$NAME" spawn ./build-key-pass "$NAME"
expect "Enter PEM pass phrase" { send "$PASSWD\r" } expect "Enter PEM pass phrase" { send "\\\$PASSWD\\r" }
expect "Verifying - Enter PEM pass phrase" { send "$PASSWD\r" } expect "Verifying - Enter PEM pass phrase" { send "\\\$PASSWD\\r" }
expect "Country Name" { send "\r" } expect "Country Name" { send "\r" }
expect "State or Province Name" { send "\r" } expect "State or Province Name" { send "\r" }
expect "Locality Name" { send "\r" } expect "Locality Name" { send "\r" }
@ -95,9 +98,9 @@ EOF
expect << EOF expect << EOF
set timeout -1 set timeout -1
spawn openssl rsa -in "$NAME$OKEY" -des3 -out "$NAME$KEY" spawn openssl rsa -in "$NAME$OKEY" -des3 -out "$NAME$KEY"
expect "Enter pass phrase for" { send "$PASSWD\r" } expect "Enter pass phrase for" { send "\\\$PASSWD\\r" }
expect "Enter PEM pass phrase" { send "$PASSWD\r" } expect "Enter PEM pass phrase" { send "\\\$PASSWD\\r" }
expect "Verifying - Enter PEM pass" { send "$PASSWD\r" } expect "Verifying - Enter PEM pass" { send "\\\$PASSWD\\r" }
expect eof expect eof
EOF EOF
} }