]> git.saurik.com Git - apt.git/commitdiff
apt-key del should correctly handle keyids prefixed with 0x
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Fri, 4 Mar 2016 09:23:24 +0000 (10:23 +0100)
committerJulian Andres Klode <jak@debian.org>
Fri, 4 Mar 2016 22:26:11 +0000 (23:26 +0100)
cmdline/apt-key.in

index 80eee6265bf194ba15faa4532a90383b0e0db5d0..cfd4be35d3e6062860e6fbcd150877d00c7bce0f 100644 (file)
@@ -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