summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2016-03-04 10:23:24 +0100
committerJulian Andres Klode <jak@debian.org>2016-03-04 23:26:11 +0100
commitf7bd44bae0d7cb7f9838490b5eece075da83899e (patch)
treedf7cb156b24859d27b7d9522ff76b7c5b94c6d07 /cmdline
parentab4d5741b5836bb01a38d71d329df4ff4bddc85b (diff)
apt-key del should correctly handle keyids prefixed with 0x
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-key.in4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in
index 80eee6265..cfd4be35d 100644
--- a/cmdline/apt-key.in
+++ b/cmdline/apt-key.in
@@ -191,6 +191,10 @@ remove_key_from_keyring() {
for KEY in "$@"; do
local FINGERPRINTS="${GPGHOMEDIR}/keyringfile.keylst"
get_fingerprints_of_keyring "$KEYRINGFILE" > "$FINGERPRINTS"
+
+ # strip leading 0x, if present:
+ KEY="$(printf %s "$KEY" | sed s/^0x//)"
+
# check if the key is in this keyring
if ! grep -iq "^[0-9A-F]*${KEY}$" "$FINGERPRINTS"; then
continue