]> Nutra Git (v2) - gamesguru/git-remote-gcrypt.git/commitdiff
Use gpg --secret-keyring /dev/null where possible
authorroot <root@localhost>
Thu, 14 Feb 2013 00:00:00 +0000 (00:00 +0000)
committerroot <root@localhost>
Thu, 14 Feb 2013 00:00:00 +0000 (00:00 +0000)
git-remote-gcrypt

index 80bd9d5c849d6e05bebfcbe7244d29fc371fc4d1..8d07338a9ed511832b027dc66a6b1c01418c174f 100755 (executable)
@@ -158,8 +158,7 @@ CLEAN_FINAL()
 ENCRYPT()
 {
        # Security protocol:
-       # Symmetric encryption using the long MASTERKEY. We use AES
-       # and OpenPGP's modification detection code (mdc).
+       # Symmetric encryption using the long MASTERKEY.
        (printf "%s" "$MASTERKEY" | \
                gpg --batch --force-mdc --compress-algo none \
                        --passphrase-fd 0 --output - -c /dev/fd/3) 3<&0
@@ -178,13 +177,15 @@ CLEARSIGN()
 
 CHECKSIGN()
 {
-       gpg -q --no-default-keyring --keyring "$CONF_KEYRING" -d
+       gpg -q --batch --no-default-keyring \
+               --secret-keyring /dev/null --keyring "$CONF_KEYRING" -d
 }
 
 DECRYPT()
 {
        (printf "%s" "$MASTERKEY" | \
-               gpg -q --batch --no-default-keyring --keyring /dev/null \
+               gpg -q --batch --no-default-keyring --secret-keyring /dev/null \
+                       --keyring /dev/null \
                        --passphrase-fd 0 --output - -d /dev/fd/3) 3<&0
 }
 
@@ -227,9 +228,9 @@ make_new_repo()
        KEYSIGN=$(printf "%s\n" "$MASTERKEY" | gpg --output - --clearsign)
        TMPMASTERKEY_ENC="$LOCALDIR/masterenc.$$"
        trap 'rm -f "$TMPMASTERKEY_ENC"' EXIT
-       printf "%s" "$KEYSIGN" | gpg --no-default-keyring \
-               --keyring "$CONF_KEYRING" --compress-algo none -e $RECIPIENTS \
-               > "$TMPMASTERKEY_ENC"
+       printf "%s" "$KEYSIGN" | gpg --batch --no-default-keyring \
+               --secret-keyring /dev/null --keyring "$CONF_KEYRING" \
+               --compress-algo none -e $RECIPIENTS > "$TMPMASTERKEY_ENC"
        PUT "$URL" masterkey < "$TMPMASTERKEY_ENC"
        rm -f "$TMPMASTERKEY_ENC"
        trap EXIT