Documentation
¶
Overview ¶
Package factors makes Linux's authentication factors usable by github.com/go-authn/mfa.
r, err := mfa.Verify(ctx, mfa.Policy{Count: 2},
somethingYouKnow, // yours to supply
factors.SecurityKey("example.test", credID, pubKey), // this
)
There is one factor here, and that is the honest count ¶
Linux has no standard biometric service the way macOS has LocalAuthentication and Windows has Hello. fprintd exists, over D-Bus, on some desktops, for some readers; PAM sits at a different layer and answers a different question. Neither is "the platform's authenticator" in the sense the other two packages mean, and shipping one here would put a factor in front of people that works on one machine in ten.
So this offers possession, and says so. A caller who needs two KINDS supplies the other themselves — which is more honest than a package guessing, and no worse off than Windows, where nothing reports which modality answered anyway.
A fingerprint factor over fprintd is the obvious thing to add. It wants its own bibliography and a machine to be proven on, not a hurried afternoon.
What is here, and what is elsewhere ¶
Almost nothing. Asking a security key is the same everywhere CTAP is, so it lives once, in github.com/go-authn/keyfactor. What Linux knows — where a key is, and what its absence means — is what stays here.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SecurityKey ¶
SecurityKey is a registered credential on an attached key, as a factor: the key must be present and a human must touch it.
credentialID and publicKey are what a registration returned: the credential's id, and the P-256 key from its attestation (fido.AuthData.PublicKey). Passing no id asks the key for a discoverable credential, which it has only if one was registered with the "rk" option.
⛔ The public key is required. Without it nothing could check the assertion's signature, and any device that speaks CTAPHID -- a programmable USB board -- would pass as the key (go-authn/keyfactor v0.3.0, after a security audit). A factor built without one refuses when asked.
func VerifiedSecurityKey ¶
func VerifiedSecurityKey(rpID string, credentialID []byte, publicKey *ecdsa.PublicKey, pin string) mfa.Factor
VerifiedSecurityKey is the same, with the key asked to establish who is holding it.
The kind does not change: see github.com/go-authn/keyfactor. A wrong PIN costs the key a retry and a key that runs out locks, so how many are left is asked for before one is spent.
Types ¶
This section is empty.