Use gpg --secret-keyring /dev/null where possible

This commit is contained in:
root 2013-02-14 00:00:00 +00:00
parent 1227529ff5
commit c689a38782

View file

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