X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/803491dc568d2994745c3c4359f68053f7261658..9a63c3f480bcbc3232067237671b854d43a97236:/cmdline/apt-key.in diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in index 80eee6265..3ed2a70ce 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="${KEY#0x}" + # check if the key is in this keyring if ! grep -iq "^[0-9A-F]*${KEY}$" "$FINGERPRINTS"; then continue