Merge pull request #626 from Giraffe1966/issue-624

Prevent 'send' from interpreting passwords beginning with '-' as options.
This commit is contained in:
redfast00 2018-10-19 22:00:56 +01:00 committed by GitHub
commit ff86557cf3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -116,8 +116,8 @@ function keyPASS() {
expect << EOF
set timeout -1
spawn ./easyrsa build-client-full "${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 eof
EOF
@ -126,9 +126,9 @@ EOF
expect << EOF
set timeout -1
spawn openssl rsa -in ${KEY_FILE} -aes128 -out ${KEY_FILE}
expect "Enter pass phrase" { send "${PASSWD}\r" }
expect "Enter PEM pass phrase" { send "${PASSWD}\r" }
expect "Verifying - Enter PEM pass phrase" { send "${PASSWD}\r" }
expect "Enter pass phrase" { send -- "${PASSWD}\r" }
expect "Enter PEM pass phrase" { send -- "${PASSWD}\r" }
expect "Verifying - Enter PEM pass phrase" { send -- "${PASSWD}\r" }
expect eof
EOF