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

guix: Use DOS newlines for SHA256SUMS files #29147

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

luke-jr
Copy link
Member

@luke-jr luke-jr commented Dec 28, 2023

OpenPGP specifies that plain text should use CR LF for newlines. By doing so, it becomes possible to include the hashes directly in the .asc file.

(Currently untested, looking for Concept ACKs)

@DrahtBot
Copy link
Contributor

DrahtBot commented Dec 28, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

@maflcko
Copy link
Member

maflcko commented Dec 28, 2023

By doing so, it becomes possible to include the hashes directly in the .asc file.

Not sure. Wasn't the goal the exact opposite, so that it is easier to cat the hashes once and as many signatures as one wants?

@luke-jr
Copy link
Member Author

luke-jr commented Dec 28, 2023

Not sure. Wasn't the goal the exact opposite, so that it is easier to cat the hashes once and as many signatures as one wants?

You can still do that with the content in the file. Furthermore, this change does not require us to produce an attached SHA256SUMS.asc, it only enables us to do so if desired.

OpenPGP specifies that plain text should use CR LF for newlines.
By doing so, it becomes possible to include the hashes directly in the .asc file.
@DrahtBot
Copy link
Contributor

Guix builds (on x86_64)

File commit 4b1196a
(master)
commit 8074d67
(master and this pull)
SHA256SUMS.part 7aefd803a584a152... 65de4aa6613795c1...
*-aarch64-linux-gnu-debug.tar.gz 735f38fb37b239f8... 5568484d1825aebd...
*-aarch64-linux-gnu.tar.gz 83a257c74e184b96... d726c6e4dc963817...
*-arm-linux-gnueabihf-debug.tar.gz 513acf435b18fab2... a9f14cb4313f37a5...
*-arm-linux-gnueabihf.tar.gz 581f911fcca5ae02... 97174e1b0060a91d...
*-arm64-apple-darwin-unsigned.tar.gz 7a3f2b4e01f27896... 8f8881e6bb4dfd25...
*-arm64-apple-darwin-unsigned.zip dff45b014236e990... 5315430b83034a34...
*-arm64-apple-darwin.tar.gz 0d9696b7bd76b36f... d617ad3b95170ca3...
*-powerpc64-linux-gnu-debug.tar.gz dfe6cfdcd6ad3c6f... 126ef87c72027d6d...
*-powerpc64-linux-gnu.tar.gz 54c013201daad1ff... 51e46d071b8eb911...
*-powerpc64le-linux-gnu-debug.tar.gz 8e944b002273b678... ffad1474a9120169...
*-powerpc64le-linux-gnu.tar.gz 1ba8199984d7c43a... 8b3d038ab1cd8f9c...
*-riscv64-linux-gnu-debug.tar.gz e9abe48aeb7acc68... ae88367256db4103...
*-riscv64-linux-gnu.tar.gz f4d1484dec65b967... 7306a9d578851999...
*-x86_64-apple-darwin-unsigned.tar.gz 915650aa35e6e322... d99fa8722014a1e0...
*-x86_64-apple-darwin-unsigned.zip 6a6139cb415de743... c5dd030eb163eb81...
*-x86_64-apple-darwin.tar.gz c479d099d1df9a85... bc5bb6ea1c2e3506...
*-x86_64-linux-gnu-debug.tar.gz 9e27161179f18a4a... a373a579e8358461...
*-x86_64-linux-gnu.tar.gz f69632ca3dc98896... 343710fa41163578...
*.tar.gz c04997c9f9e51d80... 937a7d44a4f8119f...
guix_build.log 3bafc3c44e9b416c... f69a602f08da224f...
guix_build.log.diff 5d9a6d1b90b59904...

@luke-jr
Copy link
Member Author

luke-jr commented Dec 29, 2023

It seems @DrahtBot stops short of making the full SHA256SUMS file?

@maflcko
Copy link
Member

maflcko commented Dec 29, 2023

it only enables us to do so if desired.

It would be good to list at least one benefit, otherwise the benefits of this change are unclear.

@luke-jr
Copy link
Member Author

luke-jr commented Dec 29, 2023

It would be good to list at least one benefit, otherwise the benefits of this change are unclear.

Having a single file to download for the signatures is simpler for end users.

@luke-jr luke-jr marked this pull request as ready for review February 29, 2024 17:36
@luke-jr
Copy link
Member Author

luke-jr commented Mar 27, 2024

It seems this isn't enough - OpenPGP explicitly identifies the data as either binary or text: https://datatracker.ietf.org/doc/html/rfc4880#section-5.2.1

So I guess the only way to support a combined file would be to use --clearsign, detach it manually, then reattach them all together. And then they would only be valid attached. :(

@luke-jr
Copy link
Member Author

luke-jr commented Mar 30, 2024

Apparently stripping the final newline would fix this, but a new issue arose: if the signature is detached, it will only verify a pre-canonicalized (DOS-encoded and final newline stripped) file. Some sha256sum -c tools seem to not like this (they treat the \r as part of the filename and can't find it). GPG has a --textmode option that seems to suggest it addresses this, but I can't seem to get it to work.

So IF we're okay with the combined file ONLY being clearsign format (which can then be UNIX newlines again), I can fix this PR. Or someone could spend more time to figure out why --textmode doesn't work as expected.

The UX for downloading two verification files sucks IMO. I think we should just go for the clearsign option, even if it's exclusive.

Thoughts?

@luke-jr luke-jr reopened this Mar 30, 2024
@luke-jr luke-jr marked this pull request as draft March 30, 2024 02:16
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

4 participants