From da306ae6cfa9170170775eeecf45db7ba527ba23 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 23 Nov 2024 18:11:44 +0100 Subject: apt-key: Only cat supported keyrings into the merged one --- cmdline/apt-key.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in index 99a31bdd1..763fc7baf 100644 --- a/cmdline/apt-key.in +++ b/cmdline/apt-key.in @@ -470,7 +470,9 @@ dearmor_filename() { fi } catfile() { - cat "$(dearmor_filename "$1")" >> "$2" + if accessible_file_exists "$1" && is_supported_keyring "$1"; then + cat "$(dearmor_filename "$1")" >> "$2" + fi } merge_all_trusted_keyrings_into_pubring() { -- cgit v1.2.3-70-g09d2 From e285d9f75546bda442ace3cba7c6c357623937e3 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 23 Nov 2024 18:32:21 +0100 Subject: apt-key: Temporarily accept 'pub' as an extension for binary gpg keys --- cmdline/apt-key.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in index 763fc7baf..dd1c52ab0 100644 --- a/cmdline/apt-key.in +++ b/cmdline/apt-key.in @@ -312,7 +312,7 @@ is_supported_keyring() { return 0 fi local FILEEXT="${1##*.}" - if [ "$FILEEXT" = 'gpg' ]; then + if [ "$FILEEXT" = 'gpg' -o "$FILEEXT" = 'pub' ]; then # 0x98, 0x99 and 0xC6 via octal as hex isn't supported by dashs printf if printf '\231' | cmp -s -n 1 - "$1"; then true -- cgit v1.2.3-70-g09d2