| FACTOTUM(4) | Device Drivers Manual | FACTOTUM(4) |
factotum, feedkey - authentication agent
auth/factotum [ -d ] [ -s srvname ] [ -m mtpt ] ... attribute? ...
auth/feedkey
Factotum is a user-level file system that acts as the authentication agent for a user. It does so by managing a set of keys. A key is a collection of information used to authenticate a particular action. Stored as a list of attribute=value pairs, a key typically contains a user, an authentication domain, a protocol, and some secret data.
Factotum serves srv (3) directory #sfactotum, which it binds to /mnt/factotum. It serves the following files:
In any authentication, the caller typically acts as a client and the callee as a server. The server determines the authentication domain, sometimes after a negotiation with the client. Authentication always requires the client to prove its identity to the server. Under some protocols, including the one normally used by Inferno, the authentication is mutual. Proof is accomplished using secret information kept by factotum in conjunction with a cryptographic protocol.
Factotum can act in the role of client for any process possessing the same user id as it. Factotum can act in the role of server for any process.
Factotum's structure is independent of any particular authentication protocol. Factotum currently supports the following protocols:
The options are:
Feedkey is a wm (1) user interface for entering new keys. It puts its window in the wm (1) toolbar, and waits, reading requests from needkey. For each request, it pops open a window containing suitable prompts and waits for user input. See the sections on key confirmation and key prompting below.
A key tuple is a space-delimited list of attribute=value pairs. Values containing spaces must be quoted following the conventions of sh (1). An attribute whose name begins with an exclamation point (!) is `secret' and does not appear when reading the ctl file. See the `Protocols' section below. Here are some examples:
proto=p9sk1 dom=avayalabs.com user=presotto !password=lucent
proto=pass user=tb !password=does.it.matter
The required attributes depend on the authentication protocol. The `Protocols' section below describes the attributes specific to each supported protocol.
All keys can have additional attributes that act either as comments or as selectors to distinguish them in the factotum (2) and other library calls.
The factotum owner can use any key stored by factotum. Any key may have one or more owner attributes listing the users who can use the key as though they were the owner. For example, the TLS and SSH host keys on a server often have an attribute owner=* to allow any user (and in particular, to run the TLS or SSH server-side protocol.
Any key may have a role attribute for restricting how it can be used. If this attribute is missing, the key can be used in any role. The possible values are:
If a key has a disabled attribute (with any value), the key is not used during any protocols.
Key templates are used by routines that interface to factotum, such as those in factotum (2), to specify which key and protocol to use for an authentication. Like a key tuple, a key template is also a list of attribute=value pairs. It must specify at least the protocol and enough other attributes to uniquely identify a key, or set of keys, to use. The keys chosen are those that match all the attributes specified in the template. The possible attribute/value formats are:
Key templates are also used by factotum to request a key either via an RPC error or via the needkey interface. The possible attribute/value formats are:
A number of messages can be written to the control file. The messages are:
The needkey file provides a connection from factotum to a key server, normally the program auth/fgui. Whenever factotum needs a new key, it first checks to see if needkey is opened. If it isn't, it returns a error to its client. If the file is opened a request can be read from it with the following format:
needkey tag=tagno <key template>
It is up to the reader to then query the user for any missing fields, write the key tuple into the ctl file, and then reply by writing into the needkey file the string:
tag=tagno
Needkey is exclusive open and can only be opened by a process with the same user id as factotum.
Authentication is performed by
The RPC protocol is normally embodied by one of the routines in factotum (2). We describe it here should anyone want to extend that module.
An RPC consists of writing a request message to rpc followed by reading a reply message back. RPC's are strictly ordered; requests and replies of different RPC's cannot be interleaved. Messages consist of a verb, a single space, and data. The data format depends on the verb. The request verbs are:
Factotum can support many authentication protocols, each implemented by a separate module in the directory /dis/auth/proto. Currently only a few are implemented in Inferno:
Infauth is the Inferno public-key authentication protocol described by auth (6). It requires a key with proto=infauth, and a !authinfo attribute providing Inferno authentication data as an S-expression (see sexprs (6)). The S-expression has five string elements: the signer's public key, the certificate for the user's public key, the user's secret key, and the values for parameters alpha and p, selected by the signer when the key was generated. The keys and certificates are represented as strings of the form produced by keyring-certtostr (2); the parameter values are represented as binary in the form produced by IPint.iptobytes (see keyring-ipint (2)). Normally infauth checks that the other party's key was signed by the signer in the !authinfo data, but if the key has the attribute anysigner with non-zero integer value, infauth will accept keys signed by any signer. The actual signer can be determined by inspecting the data returned by the authinfo request; the option is intended for use by services that support calls from many domains, each with its own signer.
P9sk1 is the shared-secret protocol used to authenticate to various Plan 9 services. It requires a key with proto=p9sk1, a dom attribute identifying the authentication domain, a user name valid in that domain, and either a !password or !hex attribute specifying the password or hexadecimal secret to be used. P9sk1 normally is invoked by Plan 9's general authentication protocol, p9any, which is supported by Inferno's factotum.
Pass requires a key with proto=pass in addition to user and !password attributes.
/appl/cmd/auth/factotum