Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmd/keymasterd/2fa_webauthn.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ func (state *RuntimeState) webauthnAuthFinish(w http.ResponseWriter, r *http.Req
// func (p *ParsedCredentialAssertionData) Verify(storedChallenge string, relyingPartyID string, rpOrigins, rpTopOrigins []string, rpTopOriginsVerify TopOriginVerificationMode, appID string, verifyUser bool, credentialBytes []byte) error {
// Handle steps 4 through 16
rpTopOrigins := rpOrigins // FIXME: we actually have to compute this
validError := parsedResponse.Verify(session.Challenge, rpID, rpOrigins, rpTopOrigins, protocol.TopOriginAutoVerificationMode, appID, shouldVerifyUser, loginCredential.PublicKey)
verifyUserPresence := true
validError := parsedResponse.Verify(session.Challenge, rpID, rpOrigins, rpTopOrigins, protocol.TopOriginAutoVerificationMode, appID, shouldVerifyUser, verifyUserPresence, loginCredential.PublicKey)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did the external webauthn package make an incompatible API change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes it did. I do have to actually test on a keymaster with a real hostname if the behaviour of this new param: verifyUserPresence is what I expect. We are using a "less traveled" path as we need to use some of the internal apis for backwards compatility with u2f registered tokens. We may start thnking on when we will drop that and go to only webauthn flows.

I will not land until I have actually tested this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just tested works with new path (localhost)l

if validError != nil {
logger.Printf("failed to verify webauthn parsedResponse")
state.writeFailureResponse(w, r, http.StatusUnauthorized, "Credential Not Found")
Expand Down
4 changes: 2 additions & 2 deletions cmd/keymasterd/2fa_webauthn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestWebAuthnRegistrationBegin(t *testing.T) {
if err != nil {
t.Fatal(err)
}
state.HostIdentity = "testHost"
state.HostIdentity = "testHost.example.com"
// end of copy
logger = state.logger

Expand Down Expand Up @@ -131,7 +131,7 @@ func TestWebAuthnLoginBegin(t *testing.T) {
if err != nil {
t.Fatal(err)
}
state.HostIdentity = "testHost"
state.HostIdentity = "testHost.example.com"
// end of copy
logger = state.logger

Expand Down
114 changes: 59 additions & 55 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,105 +1,109 @@
module github.com/Cloud-Foundations/keymaster

go 1.24.0
go 1.25.0

replace github.com/bearsh/hid v1.3.0 => github.com/bearsh/hid v1.5.0

require (
github.com/Cloud-Foundations/Dominator v0.7.0
github.com/Cloud-Foundations/Dominator v0.12.0
github.com/Cloud-Foundations/golib v0.5.0
github.com/Cloud-Foundations/npipe v0.0.0-20191222161149-761e85df1f92
github.com/Cloud-Foundations/tricorder v0.0.0-20191102180116-cf6bbf6d0168
github.com/Cloud-Foundations/webauth-sshcert v0.0.0-20251110023320-a3f8b0317108
github.com/alecthomas/kong v1.12.1
github.com/aws/aws-sdk-go v1.55.7
github.com/aws/aws-sdk-go-v2 v1.36.3
github.com/aws/aws-sdk-go-v2/config v1.29.14
github.com/aws/aws-sdk-go-v2/service/kms v1.38.3
github.com/aws/aws-sdk-go-v2/service/organizations v1.38.3
github.com/aws/aws-sdk-go-v2/service/sts v1.33.19
github.com/Cloud-Foundations/tricorder v0.1.0
github.com/Cloud-Foundations/webauth-sshcert v0.0.0-20260319235720-e0113e083a8a
github.com/alecthomas/kong v1.15.0
github.com/aws/aws-sdk-go v1.55.8
github.com/aws/aws-sdk-go-v2 v1.41.5
github.com/aws/aws-sdk-go-v2/config v1.32.13
github.com/aws/aws-sdk-go-v2/service/kms v1.50.4
github.com/aws/aws-sdk-go-v2/service/organizations v1.51.0
github.com/aws/aws-sdk-go-v2/service/sts v1.41.10
github.com/bearsh/hid v1.6.0
github.com/cloudflare/cfssl v1.6.5
github.com/duo-labs/webauthn v0.0.0-20221205164246-ebaf9b74c6ec
github.com/flynn/u2f v0.0.0-20180613185708-15554eb68e5d
github.com/foomo/htpasswd v0.0.0-20200116085101-e3a90e78da9c
github.com/go-jose/go-jose/v4 v4.1.0
github.com/go-piv/piv-go/v2 v2.3.0
github.com/go-webauthn/webauthn v0.13.0
github.com/go-jose/go-jose/v4 v4.1.4
github.com/go-piv/piv-go/v2 v2.5.0
github.com/go-webauthn/webauthn v0.16.1
github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef
github.com/lib/pq v1.10.9
github.com/lib/pq v1.12.1
github.com/marshallbrekka/go-u2fhost v0.0.0-20210111072507-3ccdec8c8105
github.com/mattn/go-sqlite3 v1.14.28
github.com/mattn/go-sqlite3 v1.14.38
github.com/nirasan/go-oauth-pkce-code-verifier v0.0.0-20220510032225-4f9f17eaec4c
github.com/pquerna/otp v1.5.0
github.com/prometheus/client_golang v1.22.0
github.com/prometheus/client_golang v1.23.2
github.com/tstranex/u2f v1.0.0
github.com/vjeantet/ldapserver v1.0.1
golang.org/x/crypto v0.45.0
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6
golang.org/x/net v0.47.0
golang.org/x/oauth2 v0.30.0
golang.org/x/term v0.37.0
golang.org/x/crypto v0.49.0
golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90
golang.org/x/net v0.52.0
golang.org/x/oauth2 v0.36.0
golang.org/x/term v0.41.0
gopkg.in/ldap.v2 v2.5.1
gopkg.in/yaml.v2 v2.4.0
mvdan.cc/sh/v3 v3.11.0
mvdan.cc/sh/v3 v3.13.0
)

require (
dario.cat/mergo v1.0.2 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/ProtonMail/go-crypto v1.2.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.3 // indirect
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.35.4 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.1 // indirect
github.com/cloudflare/circl v1.6.1 // indirect
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
github.com/ProtonMail/go-crypto v1.4.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.7 // indirect
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.41.5 // indirect
github.com/aws/aws-sdk-go-v2/service/signin v1.0.9 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.18 // indirect
github.com/cloudflare/circl v1.6.3 // indirect
github.com/cyphar/filepath-securejoin v0.6.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.6.2 // indirect
github.com/go-git/go-git/v5 v5.16.0 // indirect
github.com/go-webauthn/x v0.1.21 // indirect
github.com/golang-jwt/jwt/v5 v5.2.2 // indirect
github.com/go-git/go-billy/v5 v5.8.0 // indirect
github.com/go-git/go-git/v5 v5.17.2 // indirect
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
github.com/go-webauthn/x v0.2.2 // indirect
github.com/golang-jwt/jwt/v5 v5.3.1 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/google/go-tpm v0.9.5 // indirect
github.com/google/go-tpm v0.9.8 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/kevinburke/ssh_config v1.6.0 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pjbgf/sha1cd v0.3.2 // indirect
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
github.com/skeema/knownhosts v1.3.1 // indirect
github.com/pjbgf/sha1cd v0.5.0 // indirect
github.com/sergi/go-diff v1.4.0 // indirect
github.com/skeema/knownhosts v1.3.2 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
golang.org/x/text v0.31.0 // indirect
go.yaml.in/yaml/v2 v2.4.4 // indirect
golang.org/x/text v0.35.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)

require (
github.com/GehirnInc/crypt v0.0.0-20230320061759-8cc1b52080c5 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.67 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.15 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.25.3 // indirect
github.com/aws/smithy-go v1.22.3 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.19.13 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.6 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.21 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.30.14 // indirect
github.com/aws/smithy-go v1.24.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/boombuler/barcode v1.0.2 // indirect
github.com/boombuler/barcode v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/flynn/hid v0.0.0-20190502022136-f1b9b6cc019a // indirect
github.com/fxamacker/cbor/v2 v2.8.0 // indirect
github.com/fxamacker/cbor/v2 v2.9.1 // indirect
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
github.com/google/certificate-transparency-go v1.3.1 // indirect
github.com/google/certificate-transparency-go v1.3.3 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24 // indirect
github.com/lor00x/goldap v0.0.0-20180618054307-a546dffdd1a3 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.64.0 // indirect
github.com/prometheus/procfs v0.16.1 // indirect
github.com/prometheus/common v0.67.5 // indirect
github.com/prometheus/procfs v0.20.1 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/sys v0.38.0 // indirect
golang.org/x/time v0.11.0
google.golang.org/protobuf v1.36.6 // indirect
golang.org/x/sys v0.42.0 // indirect
golang.org/x/time v0.15.0
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
)
Loading
Loading