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

s2n-tls: disable unsupported feature (post-quantum cryptography) on mips64 #161163

Merged
merged 2 commits into from Apr 11, 2022
Merged

s2n-tls: disable unsupported feature (post-quantum cryptography) on mips64 #161163

merged 2 commits into from Apr 11, 2022

Conversation

ghost
Copy link

@ghost ghost commented Feb 21, 2022

S2N_NO_PQ is not supported on mips64. This patch disables it on that platform. This is needed because s2n-tls is used by aws, which is used by nix, which is used by nixpkgs. This patch is needed in order to complete the bootstrap.

Motivation for this change
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • mips64el-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@ghost
Copy link
Author

ghost commented Feb 23, 2022

Latest push rebases and adds a commit message, no other changes.

This was referenced Feb 26, 2022
@ghost
Copy link
Author

ghost commented Mar 18, 2022

Rebased. #161158 has been merged, so this is usable now.

@github-actions github-actions bot removed the 6.topic: stdenv Standard environment label Mar 18, 2022
S2N_NO_PQ is not supported on mips64. This patch disables it on that
platform. This is needed because s2n-tls is used by aws, which is used
by nix, which is used by nixpkgs. This patch is needed in order to
complete the bootstrap.
@ghost
Copy link
Author

ghost commented Mar 31, 2022

Ping...

@ghost
Copy link
Author

ghost commented Apr 1, 2022

@SuperSandro2000, would you mind taking a look at this?

This package is needed in order for nixpkgs to be used to build nix itself -- I think of this as the "second half" of the bootstrapping process.

This commit disables an extremely-experimental feature (post-quantum cryptographic algorithms) when building on a platform that nixpkgs does not yet support; the risk of causing regressions is tiny or zero.

Like most cryptographic codes, the implementation of this feature uses lots of architecture-specific code to make things go faster (or to make them go slower, but execute in constant time). It would not surprise me if they hadn't gotten around to writing mips64 versions of these routines.

This flag is recommended by the s2n-tls codebase itself, which says "S2N_NO_PQ Disables all Post Quantum Crypto code. You likely want this for older compilers or uncommon platforms."

I tried S2N_NO_PQ_ASM but that did not work. Even with S2N_NO_PQ_ASM the build complains:

/build/source/pq-crypto/sike_r3/sikep434r3.h:53:6: error: #error -- "Unsupported ARCHITECTURE"
   53 |     #error -- "Unsupported ARCHITECTURE"

I suspect that maintainers are not jumping at the chance to merge this PR because they aren't experts on post-quantum cryptography. I'm not either. But I don't think it's necessary to be one in order to merge this -- the source code specifically recommends -DS2N_NO_PQ=ON as a way to get around build problems on "uncommon platforms" like mips64.

If time-travelers from the future use their quantum computer to break all of nixpkgs' cryptography, you can blame me.

@ghost ghost changed the title s2n-tls: disable post-quantum cryptography on mips64 (unsupported) s2n-tls: disable unsupported feature (post-quantum cryptography) on mips64 Apr 1, 2022
@ghost ghost mentioned this pull request Apr 6, 2022
6 tasks
@SuperSandro2000 SuperSandro2000 merged commit 3377270 into NixOS:master Apr 11, 2022
@ghost ghost deleted the mips64-disable-s2n-pqcrypto branch April 11, 2022 18:20
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.

1 participant