#11 Enable GPG-based source file verification
Merged 4 years ago by tstellar. Opened 4 years ago by tstellar.
rpms/ tstellar/lld gpg-verify  into  master

file modified
+1
@@ -20,3 +20,4 @@ 

  /lld-9.0.0rc2.src.tar.xz

  /lld-9.0.0rc3.src.tar.xz

  /lld-9.0.0.src.tar.xz

+ /lld-9.0.0.src.tar.xz.sig

file added
+52
@@ -0,0 +1,52 @@ 

+ -----BEGIN PGP PUBLIC KEY BLOCK-----

+ 

+ mQINBFS+1SABEACnmkESkY7eZq0GhDjbkWpKmURGk9+ycsfAhA44NqUvf4tk1GPM

+ 5SkJ/fYedYZJaDVhIp98fHgucD0O+vjOzghtgwtITusYjiPHPFBd/MN+MQqSEAP+

+ LUa/kjHLjgyXxKhFUIDGVaDWL5tKOA7/AQKl1TyJ8lz89NHQoUHFsF/hu10+qhJe

+ V65d32MXFehIUSvegh8DrPuExrliSiORO4HOhuc6151dWA4YBWVg4rX5kfKrGMMT

+ pTWnSSZtgoRhkKW2Ey8cmZUqPuUJIfWyeNVu1e4SFtAivLvu/Ymz2WBJcNA1ZlTr

+ RCOR5SIRgZ453pQnI/Bzna2nnJ/TV1gGJIGRahj/ini0cs2x1CILfS/YJQ3rWGGo

+ OxwG0BVmPk0cmLVtyTq8gUPwxcPUd6WcBKhot3TDMlrffZACnQwQjlVjk5S1dEEz

+ atUfpEuNitU9WOM4jr/gjv36ZNCOWm95YwLhsuci/NddBN8HXhyvs+zYTVZEXa2W

+ l/FqOdQsQqZBcJjjWckGKhESdd7934+cesGD3O8KaeSGxww7slJrS0+6QJ8oBoAB

+ P/WCn/y2AiY2syEKp3wYIGJyAbsm542zMZ4nc7pYfSu49mcyhQQICmqN5QvOyYUx

+ OSqwbAOUNtlOyeRLZNIKoXtTqWDEu5aEiDROTw6Rkq+dIcxPNgOLdeQ3HwARAQAB

+ tCFIYW5zIFdlbm5ib3JnIDxoYW5zQGNocm9taXVtLm9yZz6JAlUEEwECAD8CGwMG

+ CwkIBwMCBhUIAgkKCwQWA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s555E6MZILE2ZiolcRn+bYOMPZtWlbx98t8uqMf49gY4FGQBZAwPglMrx7mr

+ m7HTIiXahThQGOJg6izJDAD5RwSEGlAcL28T8KAuM6CLLkhlBfQwiKsUBNnh9r8w

+ V3lB+pV0GhL+3i077gTYfZBRwLzjFdhm9xUKEaZ6rN1BX9lzix4eSNK5nln0jUq1

+ 67H2IH//2sf8dw==

+ =ADVe

+ -----END PGP PUBLIC KEY BLOCK-----

file modified
+11 -2
@@ -1,5 +1,5 @@ 

  #%%global rc_ver 3

- %global baserelease 3

+ %global baserelease 4

  %global lld_srcdir lld-%{version}%{?rc_ver:rc%{rc_ver}}.src

  %global maj_ver 9

  
@@ -14,9 +14,11 @@ 

  

  License:	NCSA

  URL:		http://llvm.org

- Source0:	http://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/%{lld_srcdir}.tar.xz

+ Source0:	https://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/%{lld_srcdir}.tar.xz

  Source1:	run-lit-tests

  Source2:	lit.lld-test.cfg.py

+ Source3:	https://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/%{lld_srcdir}.tar.xz.sig

+ Source4:	https://releases.llvm.org/9.0.0/hans-gpg-key.asc

  

  Patch0:		0001-CMake-Check-for-gtest-headers-even-if-lit.py-is-not-.patch

  
@@ -34,6 +36,9 @@ 

  BuildRequires:	python3-lit

  BuildRequires:	llvm-googletest = %{version}

  

+ # For gpg source verification

+ BuildRequires:	gnupg2

+ 

  Requires(post): %{_sbindir}/alternatives

  Requires(preun): %{_sbindir}/alternatives

  
@@ -66,6 +71,7 @@ 

  LLVM regression tests.

  

  %prep

+ %{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE3}' --data='%{SOURCE0}'

  %autosetup -n %{name}-%{version}%{?rc_ver:rc%{rc_ver}}.src -p1

  

  %build
@@ -174,6 +180,9 @@ 

  %{_datadir}/lld/lit.lld-test.cfg.py

  

  %changelog

+ * Thu Dec 05 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-4

+ - Enable GPG-based source file verification

+ 

  * Thu Dec 05 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-3

  - Add lld-test package

  

file modified
+1
@@ -1,1 +1,2 @@ 

  SHA512 (lld-9.0.0.src.tar.xz) = bc4812232840ef5edbd8edf1d1a329e85a4bfd3a7859fe322e11dd053435e722c6f1140a718fd2b3524ee9783a357178d2ba30d12519847bd3acc294698007f3

+ SHA512 (lld-9.0.0.src.tar.xz.sig) = f16a510d7ba2d86b4abdc3cc073f37ef96f66eae3306cb9b66e38ed5d18bc767300d8b6a7332e22a3efbd3b381a20f84fcc3398b7041cd55481938fd79fffc7b

no initial comment

If you download both the key and the .sig from the same (potentially compromised) website, then you're not actually adding security, right?
Because of the source mecanism in fedora, it's a bit better, because you're actually downloading the key only once, and then leave it to the fedora cache system to handle it, but still, I'd have a better confidence if that (small) file were stored in git, so that anyone could verify that it's Hans' key.

I tried to follow the official guidelines: https://docs.fedoraproject.org/en-US/packaging-guidelines/#_source_file_verification . I'm not sure how much we can deviate from that, but are you saying both the key and .sig file should be in git?

I failed to notice that the key is actually in the git (I thought it was in the fedora cache system). As the key is in the git, anyone can verify it and compare it to other sources, that's okay. The problem is more on the llvm side, as if the llvm server is compromised, both the .asc and the .sig can be compromised at the same time. The .asc looks correct, at least it's the same as in https://pgp.key-server.io/pks/lookup?search=hans%40chromium.org&fingerprint=on&op=vindex, LGTM then.

Maybe we should refer to the https source?

rebased onto 0968bb5

4 years ago

Maybe we should refer to the https source?

The documentation says to do this too. I've fixed it now.

Pull-Request has been merged by tstellar

4 years ago