Skip to content

Commit

Permalink
Delete release key from /etc/apt/trusted.gpg
Browse files Browse the repository at this point in the history
Use /etc/apt/trusted.gpg.d/securedrop-keyring.gpg, provided by the securedrop-keyring package.
  • Loading branch information
emkll committed Jun 3, 2020
1 parent 021bd56 commit a4f12d4
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions securedrop-keyring/debian/preinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

set -e

# Solution adapted from DKG's work on `deb.torproject.org-keyring` and
# the securedrop core keyring package.
# In SecureDrop Workstation versions before 0.3.0, the salt provisioning
# logic uses pkgrepo.managed, which writes the key to `/etc/apt/trusted.gpg`.
# It's cleaner to use the trusted.gpg.d subdirectory, since we can
# update that trivially in future versions of the keyring package.
#
# Therefore let's clean up prior versions of the key installed
# to the general apt keyring, to ensure we only have one signing key
# installed for authenticating securedrop-related packages.

if [ -e /etc/apt/trusted.gpg ] && which gpg >/dev/null; then
(
h="$(mktemp -d)"
trap "rm -rf '$h'" EXIT

if gpg --homedir="$h" \
--batch --no-tty --no-default-keyring --keyring /etc/apt/trusted.gpg \
--list-key 0x22245C81E3BAEB4138B36061310F561200F4AD77 > /dev/null 2>&1 ; then
gpg --homedir="$h" \
--batch --no-tty --no-default-keyring --keyring /etc/apt/trusted.gpg \
--no-auto-check-trustdb \
--delete-key 0x22245C81E3BAEB4138B36061310F561200F4AD77 || true
fi
)
fi

#DEBHELPER#

0 comments on commit a4f12d4

Please sign in to comment.