Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manual: document ways of obtaining source hashes #53785

Merged
merged 2 commits into from Jan 17, 2019

Conversation

danbst
Copy link
Contributor

@danbst danbst commented Jan 11, 2019

... and security nuances.

Related: #53754

cc @7c6f434c @grahamc

@samueldr
Copy link
Member

Rendered with state as of 663b8cc

image

</para>
<para>
This works well when you've upgraded existing package version and want to
find out new hash, but is useless if package doesn't have top-level
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not so much a question of top-level attribute, as of being accessible via an attribute path.

</itemizedlist>

<section xml:id="sec-source-hashes-security">
<title>Obtaining hashes securely</title>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe note that the threat model discussed here is MITM close to the developer's network?

Whatever you do, MITM close to the server side (or a succesful server intruder) can even get a «valid» certificate via DV…

@7c6f434c
Copy link
Member

Technically speaking, there is a one more crazy-ish way of obtaining hashes that I sometimes use: fake hashes + Ctrl-c + copy the URL from the progress output + nix-prefetch-…

This way I do get the exact URL for free, but TLS is checked and the file is only downloaded once.

@7c6f434c
Copy link
Member

By the way, does git verify correctness of revision hashes by default? Does fetchgit enable/disable this? Fetching a known-good commit hash with no certificate validation might be or not be safe, and in both cases it could be useful to mention.

A little nuance is that <literal>nix-prefetch-*</literal> tools produce
hash encoded with <literal>base32</literal>, but upstream usually provides
hexadecimal (<literal>base16</literal>) encoding. Fetchers understand both
formats. Nixpkgs doesn't stadartize on any one format.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
formats. Nixpkgs doesn't stadartize on any one format.
formats. Nixpkgs does not standardize on any one format.

@danbst danbst mentioned this pull request Jan 14, 2019
@danbst
Copy link
Contributor Author

danbst commented Jan 17, 2019

@Mic92 applied!

@7c6f434c rephrased the security section. Rendered

screenshot from 2019-01-17 12-31-28

@Mic92 Mic92 merged commit c3364fb into NixOS:master Jan 17, 2019
@Mic92
Copy link
Member

Mic92 commented Jan 17, 2019

Thanks!

@danbst danbst deleted the get-hash-doc branch January 17, 2019 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants