Skip to content

Commit

Permalink
Use libfido2 on builds if present (#43224)
Browse files Browse the repository at this point in the history
* Use libfido2 on builds if present

* Use static libfido2 linking on OS compat tests
  • Loading branch information
codingllama authored and rosstimothy committed Jun 20, 2024
1 parent 3f7faee commit d9e79f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/os-compatibility-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- 'docs/**'
- 'web/**'
- 'rfd/**'
- '**/*.md*'
- '**/*.md*'

jobs:
build:
Expand All @@ -38,7 +38,7 @@ jobs:

- name: Run make
run: |
make binaries
make binaries FIDO2=static
- name: Upload binaries
uses: actions/upload-artifact@v3
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ export C_ARCH
# Eagerly enable if we detect the package, we want to test as much as possible.
ifeq ("$(shell pkg-config libfido2 2>/dev/null; echo $$?)", "0")
LIBFIDO2_TEST_TAG := libfido2
ifeq ($(FIDO2),)
$(info libfido2 found, setting FIDO2=dynamic)
FIDO2 ?= dynamic
endif
endif

# Build tsh against libfido2?
Expand Down Expand Up @@ -311,6 +315,9 @@ $(BUILDDIR)/teleport: ensure-webassets bpf-bytecode rdpclient
$(BUILDDIR)/tsh: KUBECTL_VERSION ?= $(shell go run ./build.assets/kubectl-version/main.go)
$(BUILDDIR)/tsh: KUBECTL_SETVERSION ?= -X k8s.io/component-base/version.gitVersion=$(KUBECTL_VERSION)
$(BUILDDIR)/tsh:
@if [[ -z "$(LIBFIDO2_BUILD_TAG)" ]]; then \
echo 'Warning: Building tsh without libfido2. Install libfido2 to have access to MFA.' >&2; \
fi
GOOS=$(OS) GOARCH=$(ARCH) $(CGOFLAG_TSH) go build -tags "$(FIPS_TAG) $(LIBFIDO2_BUILD_TAG) $(TOUCHID_TAG) $(PIV_BUILD_TAG)" -o $(BUILDDIR)/tsh $(BUILDFLAGS) ./tool/tsh

.PHONY: $(BUILDDIR)/tbot
Expand Down

0 comments on commit d9e79f3

Please sign in to comment.