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

p11-kit: add trust paths #86011

Merged
merged 1 commit into from Apr 25, 2020
Merged

Conversation

worldofpeace
Copy link
Contributor

@worldofpeace worldofpeace commented Apr 25, 2020

Fixes #82422

Motivation for this change

I haven't actually tested this fixed flatpak, but it's highly likely.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@jtojnar
Copy link
Contributor

jtojnar commented Apr 25, 2020

I would worry about what this causes outside of NixOS. But perhaps /etc is read-only everywhere so if the path does not exist, it would be the same as before.

@worldofpeace
Copy link
Contributor Author

I would worry about what this causes outside of NixOS. But perhaps /etc is read-only everywhere so if the path does not exist, it would be the same as before.

I see that the flag is trust-paths, so perhaps it recurses them.
So we could add a path to support non-nixos.

@jtojnar
Copy link
Contributor

jtojnar commented Apr 25, 2020

Arch seems to use:
p11_trust_paths=/etc/ca-certificates/trust-source:/usr/share/ca-certificates/trust-source

@worldofpeace
Copy link
Contributor Author

It appears that Fedora does something entirely different https://fedoraproject.org/wiki/Features/SharedSystemCertificates:SubTasks

Dtrust_paths=/etc/pki/ca-trust/source:/usr/share/pki/ca-trust-source

@jtojnar
Copy link
Contributor

jtojnar commented Apr 25, 2020

Looking at p11-glue/p11-kit@86e6063#diff-12a43abb03c895e114c577296c24a7c5, p11-glue/p11-kit@0e75a5b and https://github.com/p11-glue/p11-kit/blob/e2170b295992cb7fdf115227a78028ac3780619f/trust/module.c#L407, it seems to me that the trust paths are only used as fallback when --paths flag is not used and when they are empty no token is created. For that reason adding a path should not cause any regressions.

We can leave the other distros for some other time since they had been always broken.

@worldofpeace worldofpeace merged commit d3f8f69 into NixOS:staging Apr 25, 2020
@worldofpeace worldofpeace deleted the p11-kit-trust-paths branch April 25, 2020 18:13
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

2 participants