]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Use 'encrypt' on edit action and new env variable KEYRINGER_ADD_EXTENSION
authorrhatto@riseup.net <Silvio Rhatto>
Fri, 11 Apr 2014 18:45:04 +0000 (15:45 -0300)
committerrhatto@riseup.net <Silvio Rhatto>
Fri, 11 Apr 2014 18:45:04 +0000 (15:45 -0300)
ChangeLog
lib/keyringer/actions/edit
lib/keyringer/actions/encrypt

index 738a1f1b83d66e8321417b86b920547b0a08112a..efc8dc800a7dfcf4e5f0e3be30e43ee8b5fec32b 100644 (file)
--- 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
 
index ff220a194f233e033d63a0bd74ccee2a3bd4a3ac..2267f37e7f25aac70d0ba770a2e8b18fed1129ca 100755 (executable)
@@ -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="$?"
index e9bf4534c7ccb3a0ade182d5fad7fe54bc9c26d8..7415267dc7f3a27ea3741faf2cd499bec07fccec 100755 (executable)
@@ -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"