1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! Holding the master password in one process, so that others need not ask.
//!
//! An agent is a process that was given the password once and answers for it
//! over a local socket, until it locks: after a stretch of idleness, at a hard
//! limit from the moment it was given the password, or when told to. Two kinds
//! of process do it, each in a [`Seat`] of its own: `sefy agent`, and the
//! desktop app while a vault is unlocked in it.
//!
//! # What crosses the socket
//!
//! Keys, one version of one file at a time. Never the password: it reaches an
//! agent from a terminal or from the app's Unlock screen. Never the database:
//! whoever asks opens the file itself. A client sends nothing but a salt, the
//! first sixteen bytes of a file it already has, so there is nothing to learn
//! by posing as an agent; and the wrong key fails the file's authentication
//! tag, so there is nothing to gain by it either. The file authenticates the
//! agent.
//!
//! # What it does not protect from
//!
//! Anything running as the same user can connect, and can read this process's
//! memory unless the system stops it. The socket keeps other users out; it
//! cannot tell one of your programs from another.
pub use Client;
pub use ;
pub use ;
pub use SOCKET_ENV;
/// Where on the socket an agent listens.
///
/// Two, so that one kind cannot hide the other: the app unlocked next to a
/// running `sefy agent` would otherwise find the name taken, go unheard, and
/// stay unlocked through a `sefy lock` that reported success.