-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Delete release key from /etc/apt/trusted.gpg
Use /etc/apt/trusted.gpg.d/securedrop-keyring.gpg, provided by the securedrop-keyring package.
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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# | ||
|