From 53252628de2f74a982f1292301e627419e7f5da5 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 4 Aug 2025 11:07:55 +0200 Subject: gpg: Do not compress 7z files by default. * common/iobuf.c (is_file_compressed): Increase size of magic array. Add magic for 7z. --- common/iobuf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/iobuf.c b/common/iobuf.c index 7aaf3a878..833b90295 100644 --- a/common/iobuf.c +++ b/common/iobuf.c @@ -3057,7 +3057,7 @@ is_file_compressed (iobuf_t inp) { byte len; byte extchk; - byte magic[5]; + byte magic[6]; } magic[] = { { 3, 0, { 0x42, 0x5a, 0x68, 0x00 } }, /* bzip2 */ @@ -3065,7 +3065,8 @@ is_file_compressed (iobuf_t inp) { 4, 0, { 0x50, 0x4b, 0x03, 0x04 } }, /* (pk)zip */ { 5, 0, { '%', 'P', 'D', 'F', '-'} }, /* PDF */ { 4, 1, { 0xff, 0xd8, 0xff, 0xe0 } }, /* Maybe JFIF */ - { 5, 2, { 0x89, 'P','N','G', 0x0d} } /* Likely PNG */ + { 5, 2, { 0x89, 'P','N','G', 0x0d} }, /* Likely PNG */ + { 6, 0, { '7', 'z', 0xbc, 0xaf, 0x27, 0x1c} } /* 7z */ }; if (!inp) -- cgit v1.2.3