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

libfido2: add macOS support #80909

Merged
merged 1 commit into from Feb 24, 2020
Merged

libfido2: add macOS support #80909

merged 1 commit into from Feb 24, 2020

Conversation

artemist
Copy link
Member

Motivation for this change

Currently, libfido2 does not support building on macOS. This means that OpenSSH 8.2 will be unable to support ecdsa-sk keys on macOS when running as an SSH client.

Things done
  • pass IOKit to libfido2
  • Add a patch so that cmake uses lld flags when linking
  • Upgrade from 1.3.0 to 1.3.1 (based off libfido2: 1.3.0 -> 1.3.1 #80781)
  • Specify CMAKE_INSTALL_LIBDIR so that the demo binaries link
    correctly on macOS and libfido2.pc specifies correct arguments

I tested that FIDO keys were detected on both nixOS and macOS 10.13 (the newest mac I own).
I also built openssh 8.2p1 using the changes from #80196 with libfido2 and was able to generate an ecdsa-sk keypair on both nixOS and macOS.

Note that I do not have permission to build with ofborg on macOS, so someone else will have to do that for me.

  • 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.

* pass IOKit to libfido2
* Add a patch so that cmake uses lld flags when linking
* Upgrade from 1.3.0 to 1.3.1 (based off NixOS#80781)
* Specify CMAKE_INSTALL_LIBDIR so that the demo binaries link
  correctly on macOS and libfido2.pc specifies correct arguments
@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Feb 23, 2020
@prusnak
Copy link
Member

prusnak commented Feb 23, 2020

@GrahamcOfBorg build libfido2

@prusnak
Copy link
Member

prusnak commented Feb 23, 2020

The fix looks great! Will you upstream the patch to https://github.com/Yubico/libfido2 please?

@prusnak prusnak mentioned this pull request Feb 23, 2020
10 tasks
@artemist
Copy link
Member Author

I'll want to find something more robust by testing supported compile flags before I upstream it. I'm currently just using "on a mac and using Clang" as a proxy for lld, which is not entirely accurate (except in the bounds of nixOS).

@prusnak
Copy link
Member

prusnak commented Feb 25, 2020

FTR the issue was just fixed in the upstream where it was reported by mmahut: Yubico/libfido2#127

@artemist
Copy link
Member Author

Oh, thanks! I don't think it's worth it to make a new PR to switch to their official patch, but we can remove the patch when the next one releases.

@prusnak
Copy link
Member

prusnak commented Feb 25, 2020

Agreed

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

3 participants