<p>Jonathan Neuschäfer <strong>uploaded patch set #3</strong> to this change.</p><p><a href="https://review.coreboot.org/21592">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">buildgcc: Implement simple tarball hash verification<br><br>This patch implements a relatively simple hash-based verification scheme<br>for downloaded files (tarballs):<br><br>After buildgcc downloads a file or notices that it has already been<br>downloaded, it hashes the file, and compares the hash against the known<br>hash stored in util/crossgcc/sum/$filename.cksum. Two errors can occur:<br><br>1. The hash file is missing. In this case, crossgcc asks the user to<br>   verify the authenticity of the downloaded file. It also calculates<br>   its hash and stores it in util/crossgcc/sum/$filename.cksum.calc.<br>   If the file is authentic, the user may rename the calculated hash<br>   file to $filename.cksum, so that it can be found the next time<br>   buildgcc is started.<br><br>2. The known hash and the calculated hash differ. This is the case that<br>   this patch seeks to protect against, because it may imply that the<br>   downloaded file was unexpectedly changed, either in transit<br>   (Man-in-the-Middle attack) or on the file server that it was<br>   downloaded from. If buildgcc detects such a hash mismatch, it asks<br>   the user to delete the downloaded file and retry, because it can also<br>   be caused by a benign network error. If, however, the error persists,<br>   buildgcc can't continue without risking that the user runs malicious<br>   code, and it stops.<br><br>Note: The hash algorithm may be changed in the future, but for now I<br>left it at SHA-1, to avoid bloating this patch.<br><br>TODO: Maybe improve the error messages<br><br>Change-Id: I0d5d67b34684d02011a845d00f6f5b6769f43b4f<br>Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net><br>---<br>M util/crossgcc/buildgcc<br>1 file changed, 92 insertions(+), 20 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/92/21592/3</pre><p>To view, visit <a href="https://review.coreboot.org/21592">change 21592</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/21592"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>
<div style="display:none"> Gerrit-Change-Id: I0d5d67b34684d02011a845d00f6f5b6769f43b4f </div>
<div style="display:none"> Gerrit-Change-Number: 21592 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Jonathan Neuschäfer <j.neuschaefer@gmx.net> </div>
<div style="display:none"> Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki@gmail.com> </div>