File: fix-signature-verification.patch

package info (click to toggle)
apt-mirror2 14-1~bpo13%2B1
  • links: PTS, VCS
  • area: main
  • in suites: trixie-backports
  • size: 2,372 kB
  • sloc: python: 4,924; sh: 23; makefile: 14
file content (33 lines) | stat: -rw-r--r-- 1,320 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From 5c0a1ef8199ddf0983abeaf1cfeef8ff4a5b9c0b Mon Sep 17 00:00:00 2001
From: Yuri Konotopov <ykonotopov@gnome.org>
Date: Thu, 31 Jul 2025 20:32:09 +0000
Subject: [PATCH] repository: fix signature verification using binary .gpg
 files
Forwarded: https://gitlab.com/apt-mirror2/apt-mirror2/-/merge_requests/215
Applied-Upstream: https://gitlab.com/apt-mirror2/apt-mirror2/-/commit/5c0a1ef8199ddf0983abeaf1cfeef8ff4a5b9c0b

---
 apt_mirror/repository.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/apt_mirror/repository.py b/apt_mirror/repository.py
index b9d117f..4702dca 100644
--- a/apt_mirror/repository.py
+++ b/apt_mirror/repository.py
@@ -741,9 +741,12 @@ class BaseRepository(ABC):
                     with open(file, "rb") as fp:
                         header = fp.read(1)
 
+                        if len(header) != 1:
+                            continue
+
                         # OpenPGP public key packets
                         # https://salsa.debian.org/apt-team/apt/-/blob/63919b628a9bf386136f708f06c1a8a7d4f09fca/apt-pkg/contrib/gpgv.cc#L352
-                        if header not in (0x98, 0x99, 0xC6):
+                        if header[0] not in (0x98, 0x99, 0xC6):
                             continue
 
                         keyring.write(header)
-- 
GitLab