Expand description
Keys and the encryption that protects every stored body.
Structs§
- Key
- A 256-bit key. Its bytes live only in a page of their own that is locked in memory, so they never reach swap, and that core dumps leave out; they are zeroed when the key is dropped. A key cannot be copied, and Debug shows only its id.
- Open
Error - A sealed body or wrapped key did not open. It carries no detail, so a caller cannot tell which part was wrong.
Enums§
- Context
- What a sealed or wrapped value belongs to. It is bound into the encryption, so a value moved to another tenant, uuid or version does not open.
- KeyError
- Why a key could not be made.
- Wrap
Limit - Whether a key that has already wrapped
wrapskeys may wrap another.
Functions§
- catalog_
key - The key of the catalog that
parentprotects: the master key’s for server.sqlite, a tenant key’s for that tenant’s catalog. It is HKDF-SHA256 of the parent with no salt and the infovcon-server/v1 catalog, made in a locked page of its own and never stored. - disable_
core_ dumps - Stops this process from writing core dumps: the core size limit is set
to zero and the process is marked not dumpable, which also stops other
processes of the same user from reading its memory. Neither is enough on
its own: the limit is not enforced when core dumps are piped to a
program, and a host with
suid_dumpableset to 2 still dumps processes that are not dumpable. Each key’s page is left out of core dumps as well. - lock_
all_ memory - Locks every page of this process in memory, now and as it grows, so nothing it holds can reach swap: not AWS-LC’s expanded keys, which live in its own allocations for the length of one call, and not plaintext bodies. It fails if the lock limit is too low; the operator then raises it (for example LimitMEMLOCK=infinity under systemd).
- open
- Decrypts a blob made by
sealwith the same key and context. Any change to the blob, the context or the key is an error, never partial plaintext. - rewrap
- Moves a wrapped key from
oldtonew, keeping its context: the rotation step. The plain key exists only in its own locked page in between, and what it protects is never re-encrypted. - seal
- Encrypts
plaintextunderdata_key, bound toctx, with a random nonce. The blob is the format byte, the nonce, the ciphertext and the tag. - unwrap
- Unwraps a key made by
wrapwith the same wrapping key and context. It is opened straight into the new key’s own locked page, so the plain key is never anywhere else; on any error that page is dropped, and so zeroed. - wrap
- Wraps
keyunderwrapping, bound toctx: a blob likeseal’s, whose plaintext is the key. - wrap_
limit - The wrap-count limit for one wrapping key. Each wrap uses a random nonce, and NIST SP 800-38D 8.3 allows at most 2^32 such encryptions under one key, so a key that has made 2^32 wraps makes no more. The warning starts at half that.