mirror of
https://github.com/octoleo/Purse.git
synced 2024-12-29 12:32:39 +00:00
encrypt function is already using stdin. add todo.
This commit is contained in:
parent
ec371cbeb7
commit
51faf2ef6b
6
pwd.sh
6
pwd.sh
@ -5,6 +5,7 @@
|
|||||||
set -o errtrace
|
set -o errtrace
|
||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
set -x
|
||||||
|
|
||||||
gpg=$(which gpg)
|
gpg=$(which gpg)
|
||||||
safe=${PWDSH_SAFE:=pwd.sh.safe}
|
safe=${PWDSH_SAFE:=pwd.sh.safe}
|
||||||
@ -57,9 +58,10 @@ decrypt () {
|
|||||||
encrypt () {
|
encrypt () {
|
||||||
# Encrypt with a password.
|
# Encrypt with a password.
|
||||||
|
|
||||||
echo "${1}" | ${gpg} \
|
# TODO(drduh): don't retrieve passphrase as arg
|
||||||
|
${gpg} \
|
||||||
--symmetric --armor --batch --yes \
|
--symmetric --armor --batch --yes \
|
||||||
--passphrase-fd 0 \
|
--command-fd 0 --passphrase "${1}" \
|
||||||
--output "${2}" "${3}" 2>/dev/null
|
--output "${2}" "${3}" 2>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user