|
@@ -127,13 +127,14 @@ if [ ${#CURR_PASSWORD} -eq 0 ]; then
|
127
|
127
|
exit 4
|
128
|
128
|
else
|
129
|
129
|
pass=$(gpg -dq --passphrase "$MASTER_PASSWORD" ~/.passwords/$CURR_USERNAME/$CURR_APP)
|
130
|
|
- echo ${pass}
|
|
130
|
+ echo "${pass}" | xargs
|
131
|
131
|
fi
|
132
|
132
|
else
|
133
|
133
|
# store password
|
134
|
134
|
if [ ! -d ~/.passwords/$CURR_USERNAME ]; then
|
135
|
135
|
mkdir -p ~/.passwords/$CURR_USERNAME
|
136
|
136
|
fi
|
|
137
|
+ # padding helps to ensure than nothing can be learned from the length of the cyphertext
|
137
|
138
|
pad_string "${CURR_PASSWORD}" | gpg -ca --cipher-algo AES256 --passphrase "$MASTER_PASSWORD" > ~/.passwords/$CURR_USERNAME/$CURR_APP
|
138
|
139
|
if [ ! -f ~/.passwords/$CURR_USERNAME/$CURR_APP ]; then
|
139
|
140
|
exit 5
|