summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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