Re:Ccache – a fast C/C++ compiler cache
by iveqy on Thursday November 24, 2022 @06:21AM
(#33730084)
How did you know that the build servers only built trusted code?
[ Parent
| on HN ]
Re:Ccache – a fast C/C++ compiler cache
by williamcotton on Thursday November 24, 2022 @06:44AM
(#33730226)
Public-key cryptography?
Re:Ccache – a fast C/C++ compiler cache
by williamcotton on Thursday November 24, 2022 @07:45AM
(#33730682)
Here, let me explain how it works!
Let’s say you have 15 engineers and they each have their own laptop computer. Each of these engineers generates a pair of cryptographic keys, one public and one private.
Each engineer then gives their public key to the trusted authority that operates the ccache server. Only code that is submitted and signed by a respective private key is built and then distributed to the rest of the engineers.
Re:Ccache – a fast C/C++ compiler cache
by gdhdjdvr on Friday November 25, 2022 @07:28PM
(#33748533)
So what you are talking about is gpg signed git commits and a private ci doing the building...?
Re:Ccache – a fast C/C++ compiler cache
by williamcotton on Saturday November 26, 2022 @07:10AM
(#33752004)
That’s one way to do it!
For a public project you would only want the builds to be propagated out to other developers once the changes had been approved and then merged into a branch that triggers the CI.
Re:Ccache – a fast C/C++ compiler cache
by account42 on Thursday November 24, 2022 @08:45AM
(#33731212)
The threat is not that the cache contains builds of untrusted code but that it contains builds that do not match the code that they are associated with.
As far as I'm aware (ICEs…) compilers aren't hardened against untrusted code, and a sufficiently capable exploit could be used to poison the cache.
Re:Ccache – a fast C/C++ compiler cache
by jonstewart on Thursday November 24, 2022 @11:31AM
(#33733177)
ccache uses cryptographic hashing of file contents, in addition to matching compiler arguments, so you can be sure that the code matches.