Skip to content

Support U2F on Linux#951

Merged
mapkon merged 2 commits intoVersent:masterfrom
smlx:linux-hidraw
Feb 28, 2023
Merged

Support U2F on Linux#951
mapkon merged 2 commits intoVersent:masterfrom
smlx:linux-hidraw

Conversation

@smlx
Copy link
Copy Markdown
Contributor

@smlx smlx commented Feb 9, 2023

This PR enables U2F support on Linux amd64. It builds on the work done in, and supersedes, #592.

There are no code changes, just build configuration updates:

  • Pass -tags=hidraw to go build on Linux amd64, which enables U2F as per the documentation in the underlying U2F library.
  • Install the libudev-dev package and use CGO_ENABLED=1 on Linux, because U2F support uses libudev.
  • Update the Github workflows to build the package correctly on Linux (untested).
  • Update the build documentation in the README.

Closes: #419
Closes: #592

Note that this changes the release builder from macos to ubuntu. I have no way of testing the resulting macos binary to see if it still works, so would appreciate if someone else could confirm this.

@smlx smlx force-pushed the linux-hidraw branch 3 times, most recently from 35a77e8 to f063977 Compare February 9, 2023 02:28
@rarruda
Copy link
Copy Markdown

rarruda commented Feb 28, 2023

@mapkon @wolfeidau any chances this PR could get reviewed/merged?

It is an important addition to us that run on Linux. Also, this PR seems pretty clean: only has changes to get U2F working on linux, and nothing more.

Comment thread .github/workflows/go.yml
uses: actions/checkout@v2

- name: Install dependency required for linux builds
run: sudo apt-get update && sudo apt-get install -y libudev-dev
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need libudev-dev?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because U2F support uses libudev.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK! The branch is a bit out of date with master. Mind rebasing?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #951 (comment) 🙂

uses: actions/checkout@v2

- name: Install dependency required for linux builds
run: sudo apt-get update && sudo apt-get install -y libudev-dev
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto here

@mapkon
Copy link
Copy Markdown
Contributor

mapkon commented Feb 28, 2023

I think we should move all the build configuration files to run on ubuntu-latest. MacOS builders have a 10x multiplier: https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#minute-multipliers

@rarruda
Copy link
Copy Markdown

rarruda commented Feb 28, 2023

Makes sense, but I'd say that's outside the scope of this PR. 🙂

@mapkon
Copy link
Copy Markdown
Contributor

mapkon commented Feb 28, 2023

Makes sense, but I'd say that's outside the scope of this PR. 🙂

I don't think it will merge! I will try to get it merged ASAP!

@rarruda
Copy link
Copy Markdown

rarruda commented Feb 28, 2023

I didn't create the PR, so I don't think I can rebase in this PR. But I could create another PR (from another frok) being a rebase of this one. Would that work?

Or would you prefer to try "rebase and merge" from github or doing it directly yourself?

Just let me know how I can best help!

@smlx
Copy link
Copy Markdown
Contributor Author

smlx commented Feb 28, 2023

I can rebase it 🙂

smlx added 2 commits February 28, 2023 16:51
We need the hidraw tag and to enable CGO for linux builds.
This is a requirement of the go-u2fhost dependency.
See https://github.com/marshallbrekka/go-u2fhost#linux for details.

Building with hidraw support also requires libudev headers.
i.e. sudo apt install libudev-dev

This change also updates the github workflows to build on ubuntu-latest
for CGO support on Linux.
@rarruda
Copy link
Copy Markdown

rarruda commented Feb 28, 2023

Thanks @smlx !

@mapkon mapkon merged commit f4d0a16 into Versent:master Feb 28, 2023
mapkon added a commit that referenced this pull request Feb 28, 2023
 - This functionality was broken in #951
 - Since we are using OSX toolchain, we need macos-X to build

Co-authored-by: Mark Wolfe <mark@wolfe.id.au>
@mapkon
Copy link
Copy Markdown
Contributor

mapkon commented Feb 28, 2023

@smlx @rarruda

Please note that using ubuntu platforms to build the release breaks OS builds. I am reverting that for now. @wolfeidau and I will take another peek to fix that properly, for now, we reverting back to macos-latest to lessen the blast radius.

@smlx smlx deleted the linux-hidraw branch March 1, 2023 00:25
@smlx
Copy link
Copy Markdown
Contributor Author

smlx commented Mar 1, 2023

@mapkon Ah I was afraid of that, I'll send another PR to fix it up.

@mapkon
Copy link
Copy Markdown
Contributor

mapkon commented Mar 1, 2023

Not a worry! Let me know when the PR is ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support hardware yubikey for okta provider with MFA

3 participants