tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

gpgvnoexpkeysig (1992B)


      1 #!/bin/sh
      2 #
      3 # Downloaded from https://gitlab.mister-muffin.de/josch/mmdebstrap/raw/branch/main/gpgvnoexpkeysig
      4 #
      5 # This script is in the public domain
      6 #
      7 # Author: Johannes Schauer Marin Rodrigues <josch@mister-muffin.de>
      8 #
      9 # This is a wrapper around gpgv as invoked by apt. It turns EXPKEYSIG results
     10 # from gpgv into GOODSIG results. This is necessary for apt to access very old
     11 # timestamps from snapshot.debian.org for which the GPG key is already expired:
     12 #
     13 #     Get:1 http://snapshot.debian.org/archive/debian/20150106T000000Z unstable InRelease [242 kB]
     14 #     Err:1 http://snapshot.debian.org/archive/debian/20150106T000000Z unstable InRelease
     15 #       The following signatures were invalid: EXPKEYSIG 8B48AD6246925553 Debian Archive Automatic Signing Key (7.0/wheezy) <ftpmaster@debian.org>
     16 #     Reading package lists...
     17 #     W: GPG error: http://snapshot.debian.org/archive/debian/20150106T000000Z unstable InRelease: The following signatures were invalid: EXPKEYSIG 8B48AD6246925553 Debian Archive Automatic Signing Key (7.0/wheezy) <ftpmaster@debian.org>
     18 #     E: The repository 'http://snapshot.debian.org/archive/debian/20150106T000000Z unstable InRelease' is not signed.
     19 #
     20 # To use this script, call apt with
     21 #
     22 #    -o Apt::Key::gpgvcommand=/usr/libexec/mmdebstrap/gpgvnoexpkeysig
     23 #
     24 # Scripts doing similar things can be found here:
     25 #
     26 #  * debuerreotype as /usr/share/debuerreotype/scripts/.gpgv-ignore-expiration.sh
     27 #  * derivative census: salsa.d.o/deriv-team/census/-/blob/master/bin/fakegpgv
     28 
     29 set -eu
     30 
     31 find_gpgv_status_fd() {
     32 	while [ "$#" -gt 0 ]; do
     33 		if [ "$1" = '--status-fd' ]; then
     34 			echo "$2"
     35 			return 0
     36 		fi
     37 		shift
     38 	done
     39 	# default fd is stdout
     40 	echo 1
     41 }
     42 GPGSTATUSFD="$(find_gpgv_status_fd "$@")"
     43 
     44 case $GPGSTATUSFD in
     45 	''|*[!0-9]*)
     46 		echo "invalid --status-fd argument" >&2
     47 		exit 1
     48 		;;
     49 esac
     50 
     51 # we need eval because we cannot redirect a variable fd
     52 eval 'exec gpgv "$@" '"$GPGSTATUSFD"'>&1 | sed "s/^\[GNUPG:\] EXPKEYSIG /[GNUPG:] GOODSIG /" >&'"$GPGSTATUSFD"