aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto@riseup.net <Silvio Rhatto>2014-04-11 15:45:04 -0300
committerrhatto@riseup.net <Silvio Rhatto>2014-04-11 15:45:04 -0300
commit3c06f7b7a2a8fa6577df7b224e334ca831562798 (patch)
tree23d1aff5164c0bd5af914958318034df05739498
parent14af076627a25b52ca1761c13e9da824db1bcdae (diff)
downloadkeyringer-3c06f7b7a2a8fa6577df7b224e334ca831562798.tar.gz
keyringer-3c06f7b7a2a8fa6577df7b224e334ca831562798.tar.bz2
Use 'encrypt' on edit action and new env variable KEYRINGER_ADD_EXTENSION
-rw-r--r--ChangeLog7
-rwxr-xr-xlib/keyringer/actions/edit3
-rwxr-xr-xlib/keyringer/actions/encrypt4
3 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 738a1f1..efc8dc8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
-2014-04-10 - Silvio Rhatto <rhatto@riseup.net>
+2014-04-11 - Silvio Rhatto <rhatto@riseup.net>
+
+ Edit: use encrypt action
+
+ Encrypt: support for KEYRINGER_ADD_EXTENSION environment variable
+ which controls if file extension should be appended to secret name
Genpair: generate ssh and ssl keys with 4096 bits size
diff --git a/lib/keyringer/actions/edit b/lib/keyringer/actions/edit
index ff220a1..2267f37 100755
--- a/lib/keyringer/actions/edit
+++ b/lib/keyringer/actions/edit
@@ -43,7 +43,8 @@ read key
$APP "$TMPWORK"
# Encrypt again
-$GPG --yes -o "$KEYDIR/$FILE" --use-agent --armor -e -s $(keyringer_recipients "$RECIPIENTS_FILE") "$TMPWORK"
+export KEYRINGER_ADD_EXTENSION=false
+keyringer_exec encrypt "$BASEDIR" "$FILE" "$TMPWORK"
# Check exit status
errcrypt="$?"
diff --git a/lib/keyringer/actions/encrypt b/lib/keyringer/actions/encrypt
index e9bf453..7415267 100755
--- a/lib/keyringer/actions/encrypt
+++ b/lib/keyringer/actions/encrypt
@@ -57,9 +57,11 @@ if [ ! -z "$3" ]; then
#
# Useful when opening files and the application needs the
# extension to guess the file type.
- if ! echo $BASEPATH | grep -q -e "\.$EXTENSION$"; then
+ if [ "$KEYRINGER_ADD_EXTENSION" != "false" ] && ! echo $BASEPATH | grep -q -e "\.$EXTENSION$"; then
echo "Appending '$EXTENSION' into secret name..."
FILE="$BASEPATH.$EXTENSION"
+ else
+ FILE="$BASEPATH"
fi
else
FILE="$BASEPATH"