Skip to content

libfido2: add macOS support#80909

Merged
mmahut merged 1 commit intoNixOS:masterfrom
artemist:libfido2
Feb 24, 2020
Merged

libfido2: add macOS support#80909
mmahut merged 1 commit intoNixOS:masterfrom
artemist:libfido2

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 prusnak mentioned this pull request Feb 23, 2020
10 tasks
@ofborg ofborg bot added the 8.has: package (new) This PR adds a new package label Feb 23, 2020
@ofborg ofborg bot requested a review from dtzWill February 23, 2020 20:10
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Feb 23, 2020
@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

Labels

6.topic: darwin Running or building packages on Darwin 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants