Files
mcias/vendor/github.com/go-webauthn/webauthn/webauthn/util.go
Kyle Isom 115f23a3ea Add Nix flake for mciasctl and mciasgrpcctl
Vendor dependencies and expose control program binaries via
nix build. Uses nixpkgs-unstable for Go 1.26 support.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 21:01:21 -07:00

41 lines
808 B
Go

package webauthn
import "bytes"
func isByteArrayInSlice(needle []byte, haystack ...[]byte) (valid bool) {
for _, hay := range haystack {
if bytes.Equal(needle, hay) {
return true
}
}
return false
}
func isCredentialsAllowedMatchingOwned(allowedCredentialIDs [][]byte, credentials []Credential) (valid bool) {
var credential Credential
allowed:
for _, allowedCredentialID := range allowedCredentialIDs {
for _, credential = range credentials {
if bytes.Equal(credential.ID, allowedCredentialID) {
continue allowed
}
}
return false
}
return true
}
func isCredentialIDInCredentials(credentialID []byte, credentials []Credential) (valid bool) {
for _, credential := range credentials {
if bytes.Equal(credential.ID, credentialID) {
return true
}
}
return false
}