Skip to content

Commit bd68907

Browse files
committed
Merge pull request #1932 from simonjbeaumont/ca-144941
CA-144941: Don't checksum the gpg binary
2 parents 130cc9d + f32b606 commit bd68907

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

ocaml/gpg/gpg.ml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,6 @@ open D
2323
let filename = ref ""
2424

2525
let gpg_binary_path = "/usr/bin/gpg"
26-
let allowed_gpg_checksum = [
27-
(* 32-bit gpg checksums. *)
28-
"be00ee82bffad791edfba477508d5d84"; (* centos52 version *)
29-
"a267af68c53f5d998b982235bbccb01e"; (* centos53/54 version *)
30-
"da75ecb57ff12b2573f44466d36f395e"; (* centos64 version *)
31-
(* 64-bit gpg checksums. *)
32-
"8c3909232167720c55d50c2e270fe35a"; (* centos54 version *)
33-
"bb6fdc0d7c1d8879b7be8fa830089c2b"; (* centos64 version *)
34-
(* Ancient gpg checksums. *)
35-
"f52886b87126c06d419f408e32268b4e"; (* 64 bit product version *)
36-
"aa27ac0b0ebfd1278bf2386c343053db"; (* debian developer version *)
37-
]
3826

3927
exception InvalidSignature
4028

@@ -89,20 +77,14 @@ let common ty filename signature size f =
8977
"--verify"; signature
9078
]
9179
in
92-
(* Let's check the checksums of gpg and its helper script for oem *)
93-
let gpg_binary_sum = simple_checksum gpg_binary_path in
94-
if not (List.mem gpg_binary_sum allowed_gpg_checksum) then
95-
raise InvalidSignature;
96-
97-
let gpg_path = gpg_binary_path in
9880

9981
finally (* make sure I close all my open fds in the end *)
10082
(fun () ->
10183
(* Capture stderr output for logging *)
10284
match Forkhelpers.with_logfile_fd "gpg"
10385
(fun log_fd ->
10486
let pid = Forkhelpers.safe_close_and_exec None (Some result_in) (Some log_fd) [(status_in_uuid,status_in)]
105-
gpg_path gpg_args in
87+
gpg_binary_path gpg_args in
10688
(* parent *)
10789
List.iter close' [ result_in; status_in ];
10890
finally (* always waitpid eventually *)

0 commit comments

Comments
 (0)