diff -Nru sks-1.1.6+git20210302.c3ba6d5a/debian/changelog sks-1.1.6+git20210302.c3ba6d5a/debian/changelog --- sks-1.1.6+git20210302.c3ba6d5a/debian/changelog 2021-03-22 09:50:41.000000000 +0000 +++ sks-1.1.6+git20210302.c3ba6d5a/debian/changelog 2022-01-24 11:33:30.000000000 +0000 @@ -1,3 +1,11 @@ +sks (1.1.6+git20210302.c3ba6d5a-4) unstable; urgency=medium + + * include tail-recursive-key-parsing.patch from + https://github.com/SKS-Keyserver/sks-keyserver/pull/79 + * include Do-not-error-on-warning-6-labels-omitted.patch (closes: 1002657) + + -- Christoph Martin Mon, 24 Jan 2022 12:33:30 +0100 + sks (1.1.6+git20210302.c3ba6d5a-3) unstable; urgency=medium * don't abort in cleandb call in sks_build.sh (closes: 975711) diff -Nru sks-1.1.6+git20210302.c3ba6d5a/debian/patches/0001-Do-not-error-on-warning-6-labels-omitted.patch sks-1.1.6+git20210302.c3ba6d5a/debian/patches/0001-Do-not-error-on-warning-6-labels-omitted.patch --- sks-1.1.6+git20210302.c3ba6d5a/debian/patches/0001-Do-not-error-on-warning-6-labels-omitted.patch 1970-01-01 00:00:00.000000000 +0000 +++ sks-1.1.6+git20210302.c3ba6d5a/debian/patches/0001-Do-not-error-on-warning-6-labels-omitted.patch 2022-01-24 11:33:30.000000000 +0000 @@ -0,0 +1,25 @@ +From fd51784c6ecd09a06812fa50a6c8add72bb63ce3 Mon Sep 17 00:00:00 2001 +From: Stephane Glondu +Date: Sat, 22 Jan 2022 09:24:17 +0100 +Subject: [PATCH] Do not error on warning 6 [labels-omitted] + +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 491190e..45514b7 100644 +--- a/Makefile ++++ b/Makefile +@@ -49,7 +49,7 @@ SKSVS=$(shell grep 'version_suffix = "+"' common.ml) + ifeq ($(strip $(SKSVS)),) + WARNERR= + else +-WARNERR=-warn-error A ++WARNERR=-warn-error A-6 + endif + + CAMLINCLUDE= -package cryptokit,unix,str,bigarray,num -I bdb +-- +2.34.1 + diff -Nru sks-1.1.6+git20210302.c3ba6d5a/debian/patches/series sks-1.1.6+git20210302.c3ba6d5a/debian/patches/series --- sks-1.1.6+git20210302.c3ba6d5a/debian/patches/series 2021-03-22 09:50:41.000000000 +0000 +++ sks-1.1.6+git20210302.c3ba6d5a/debian/patches/series 2022-01-24 11:33:30.000000000 +0000 @@ -3,3 +3,5 @@ 0009-fix-for-hardened-build.patch 0011-non-interactive-use-of-sks_build.sh.patch sks-poison-key.diff +tail-recursive-key-parsing.patch +0001-Do-not-error-on-warning-6-labels-omitted.patch diff -Nru sks-1.1.6+git20210302.c3ba6d5a/debian/patches/tail-recursive-key-parsing.patch sks-1.1.6+git20210302.c3ba6d5a/debian/patches/tail-recursive-key-parsing.patch --- sks-1.1.6+git20210302.c3ba6d5a/debian/patches/tail-recursive-key-parsing.patch 1970-01-01 00:00:00.000000000 +0000 +++ sks-1.1.6+git20210302.c3ba6d5a/debian/patches/tail-recursive-key-parsing.patch 2022-01-24 11:33:30.000000000 +0000 @@ -0,0 +1,168 @@ +--- a/keyMerge.ml ++++ b/keyMerge.ml +@@ -87,24 +87,40 @@ let packets_equal p1 p2 = p1 = p2 + (*******************************************************************) + (** Code for flattening out the above structure back to the original key *) + +-let rec flatten_sigpair_list list = match list with +- [] -> [] +- | (pack,sigs)::tl -> pack :: (sigs @ flatten_sigpair_list tl) ++let rec flatten_sigpair_list list = ++ match list with ++ | [] -> [] ++ | (pack,sigs)::tl -> pack :: (List.rev_append sigs (flatten_sigpair_list tl)) (* order of sigs doesn't matter *) ++ ++(* stack proportional to [List.length l] which is constant in our case *) ++let rec list_concat l = ++ match l with ++ | [] -> [] ++ | h::tl -> List.rev_append (List.rev h) (list_concat tl) + + let flatten key = +- key.key :: List.concat [ key.selfsigs; ++ key.key :: list_concat [ key.selfsigs; + flatten_sigpair_list key.uids; + flatten_sigpair_list key.subkeys ] + + + (************************************************************) + ++let nr_packets l = List.fold_left ~f:(fun acc (_,l) -> acc + List.length l) ~init:0 l ++ + let print_pkey key = +- printf "%d selfsigs, %d uids, %d subkeys\n" ++ let uid = ++ match List.filter ~f:(fun (p,_) -> p.packet_type = User_ID_Packet) key.uids with ++ | [] -> "" ++ | (h,_)::_ -> h.packet_body ++ in ++ printf "%S : %d selfsigs, %d uids (%d packets), %d subkeys (%d packets)\n" ++ uid + (List.length key.selfsigs) + (List.length key.uids) ++ (nr_packets key.uids) + (List.length key.subkeys) +- ++ (nr_packets key.subkeys) + + (*******************************************************************) + +@@ -114,13 +130,6 @@ let get_version packet = + | Signature_Packet -> int_of_char packet.packet_body.[0] + | _ -> raise Not_found + +-let key_to_stream key = +- let ptype_list = List.map ~f:(fun pack -> (pack.packet_type,pack)) key in +- Stream.of_list ptype_list +- +- +- +- + (*******************************************************************) + (*** Key Parsing ***************************************************) + (*******************************************************************) +@@ -128,28 +137,24 @@ let key_to_stream key = + let parse_list parser strm = + let rec loop parser strm accum = + match parser strm with +- | Some elt -> loop parser strm (elt :: accum) +- | None -> List.rev accum ++ | Some (elt, strm) -> loop parser strm (elt :: accum) ++ | None -> List.rev accum, strm + in + loop parser strm [] + + let parse_sig strm = +- match Stream.peek strm with +- | Some (Signature_Packet, p) -> +- Stream.junk strm; +- Some p ++ match strm with ++ | { packet_type = Signature_Packet; _ } as p :: strm -> Some (p,strm) + | _ -> None + + let parse_uid strm = +- match Stream.peek strm with +- | Some (User_ID_Packet, p) -> +- Stream.junk strm; +- let sigs = parse_list parse_sig strm in +- Some (p, sigs) +- | Some ((User_Attribute_Packet, p)) -> +- Stream.junk strm; +- let sigs = parse_list parse_sig strm in +- Some (p, sigs) ++ match strm with ++ | { packet_type = User_ID_Packet; _ } as p :: strm -> ++ let sigs, strm = parse_list parse_sig strm in ++ Some ((p, sigs), strm) ++ | { packet_type = User_Attribute_Packet; _ } as p :: strm -> ++ let sigs, strm = parse_list parse_sig strm in ++ Some ((p, sigs), strm) + | _ -> + (* + (p,sigs)::(match s with parser +@@ -160,31 +165,31 @@ let parse_uid strm = + None + + let parse_subkey strm = +- match Stream.peek strm with +- | Some (Public_Subkey_Packet, p) -> +- Stream.junk strm; +- let sigs = parse_list parse_sig strm in +- Some (p, sigs) ++ match strm with ++ | { packet_type = Public_Subkey_Packet; _ } as p :: strm -> ++ let sigs, strm = parse_list parse_sig strm in ++ Some ((p, sigs), strm) + | _ -> None + +-let parse_keystr strm = +- match Stream.peek strm with +- | Some (Public_Key_Packet, key) -> +- Stream.junk strm; ++let key_to_pkey strm = ++ match strm with ++ | { packet_type = Public_Key_Packet; _ } as key :: strm -> + begin match get_version key with + | 4 -> +- let selfsigs = parse_list parse_sig strm in +- let uids = parse_list parse_uid strm in +- let subkeys = parse_list parse_subkey strm in ++ let selfsigs, strm = parse_list parse_sig strm in ++ let uids, strm = parse_list parse_uid strm in ++ let subkeys, strm = parse_list parse_subkey strm in ++ if strm <> [] then raise Unparseable_packet_sequence; + { key; selfsigs; uids; subkeys; } + | 2 | 3 -> +- let revocations = parse_list parse_sig strm in +- let uids = parse_list parse_uid strm in ++ let revocations, strm = parse_list parse_sig strm in ++ let uids, strm = parse_list parse_uid strm in ++ if strm <> [] then raise Unparseable_packet_sequence; + { key; selfsigs = revocations; uids; subkeys = []; } + | _ -> + failwith "Unexpected key packet version number" + end +- | _ -> raise Stream.Failure ++ | _ -> raise Unparseable_packet_sequence + + (*******************************************************************) + (*** Key Merging Code *********************************************) +@@ -231,17 +236,6 @@ let merge_pkeys key1 key2 = + (*******************************************************************) + (*******************************************************************) + +-let key_to_pkey key = +- try +- let keystream = key_to_stream key in +- let pkey = parse_keystr keystream in +- Stream.empty keystream; +- pkey +- with +- Stream.Failure | Stream.Error _ -> +- raise Unparseable_packet_sequence +- +- + let merge key1 key2 = + try + let pkey1 = key_to_pkey key1