mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-23 21:30:15 +00:00
Fixes Issue #148
This commit is contained in:
parent
cf9f052445
commit
7d34c0cae6
1 changed files with 8 additions and 5 deletions
|
@ -68,13 +68,16 @@ function keyPASS() {
|
|||
exit 1
|
||||
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
|
||||
|
||||
expect << EOF
|
||||
set timeout -1
|
||||
spawn ./build-key-pass "$NAME"
|
||||
expect "Enter PEM pass phrase" { send "$PASSWD\r" }
|
||||
expect "Verifying - 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 "Country Name" { send "\r" }
|
||||
expect "State or Province Name" { send "\r" }
|
||||
expect "Locality Name" { send "\r" }
|
||||
|
@ -95,9 +98,9 @@ EOF
|
|||
expect << EOF
|
||||
set timeout -1
|
||||
spawn openssl rsa -in "$NAME$OKEY" -des3 -out "$NAME$KEY"
|
||||
expect "Enter pass phrase for" { send "$PASSWD\r" }
|
||||
expect "Enter PEM pass phrase" { send "$PASSWD\r" }
|
||||
expect "Verifying - Enter PEM pass" { send "$PASSWD\r" }
|
||||
expect "Enter pass phrase for" { send "\\\$PASSWD\\r" }
|
||||
expect "Enter PEM pass phrase" { send "\\\$PASSWD\\r" }
|
||||
expect "Verifying - Enter PEM pass" { send "\\\$PASSWD\\r" }
|
||||
expect eof
|
||||
EOF
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue