From: Daniel Kahn Gillmor Date: Fri, 4 Mar 2016 09:23:24 +0000 (+0100) Subject: apt-key del should correctly handle keyids prefixed with 0x X-Git-Tag: 1.2.5~10 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/f7bd44bae0d7cb7f9838490b5eece075da83899e apt-key del should correctly handle keyids prefixed with 0x --- 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