- plugin.remove deletes the stored module of a plug-in that isn't
installed while its settings and cache are still moved aside, so a
module that can't be deleted leaves them in place for the next try.
- plugin.remove of an invalid id no longer raises the grants generation.
- The size check before a signed grants write uses the generation the
file is written at, so a file that fits the 1 MiB limit is kept.
- The system key store connection is dropped when the key store can't
be reached through it or fails, and the next call connects again; a
missing entry keeps the connection.
plugin.remove now fails and leaves the plug-in installed while the key
store can't be reached, also when grants.json is missing or doesn't name
the plug-in, since an earlier signed copy put back could otherwise grant
it again. A grants file that is too large or doesn't hold a list no
longer stops a removal once the generation is raised. Removing an id
that isn't installed deletes the module stored for it that didn't load
and reports it removed.
The system key store is reached through keyring-core and the platform
store crates keyring 4.2 uses; a failed connection is tried again on
the next call. The key is read from the key store each time grants.json
is checked or signed, so a key removed or replaced there is not used.
The key and the generations are kept as hexadecimal text. On Windows
the lock for making the first key is in %LOCALAPPDATA%.
The wrong-key and copied-file cases of the edited-file test are at the
generation kept for their folder, so only the MAC rejects them.
The key store's generation for a plug-in folder now only goes up. When
writing or removing a signed grants.json fails after the raise, the
generation stays raised: the file left in place grants nothing and its
plug-ins ask for approval again. Before, the earlier generation was put
back, so a later raise could reach a generation a copy of the file was
already signed at, and that copy granted again.
- Keeping a lower generation than the kept one is an error.
- A signed file larger than 1 MiB is found before the raise, so the
file in place keeps its grants when nothing can be written.
- A kept generation within two of the largest 64-bit value is not
raised, so a signed write never fails after the raise for lack of a
next generation.
* svg: cut over CSS transform, CSS string quoting, and symbol unit basis to craft-svg (#789)
* build: repin craft-svg to merged craft-libs main (d20a8248)
A revoke raised the kept generation past the one the grants file
carried. The file can be edited, so a file carrying the largest
generation made every revoke fail, and one just below it left the kept
generation at the limit, so later grants could not be kept. The
generation is now read from the key store only.
A raise went to the generation after the kept one, which is the
generation a signed write whose keep failed had used, so a copy of that
write put back after a revoke granted again. A raise now goes two past
the kept generation, and each signed write raises first and is written
at the generation after the raised one. Every signed write is at a
generation no file was signed at before. When the file can't be
written, the earlier generation is put back. When the generation can't
be raised without passing the largest 64-bit value, the change is
refused with a log record.
Revoking a grant while grants.json was missing, or while a file that
grants nothing (no valid MAC, too large, or not a list) was in its place
and had no entry for the plug-in, left the folder's generation as it
was. The last signed copy, still at the kept generation, then granted
the plug-in again once it was put back.
Such a revoke now raises the generation whenever the key store holds a
key. Every raise also goes past the generation the file in place
carries, so a signed write whose generation was not kept does not start
to grant when the generation catches up with it.
The key store now keeps a generation for each plug-in folder next to
the grants key, and grants.json carries its generation inside the MAC.
Every signed write puts the file at the next generation and then keeps
it; removing the file, or taking an entry out of a file VectorCraft
didn't sign, raises the generation first. A file at any other
generation grants nothing, so a signed copy put back after a grant was
revoked no longer brings the grant back, and a write whose generation
the key store couldn't keep leaves the file granting nothing. A key
store that holds a key and no generation counts as generation 0.
grants.json now holds {"version": 1, "grants": [...], "mac": "..."}, where
mac is an HMAC-SHA-256 of the grants and of the plug-in folder, made with a
random 32-byte key kept in the system key store: the Keychain on macOS,
Credential Manager on Windows, the Secret Service on Linux and the BSDs. The
MAC is compared in constant time. A file without a valid MAC for its folder
(an edited or added grant, a removed or changed MAC, a file copied from
another folder) grants nothing, and its plug-ins ask for approval again.
This changes the default for existing files: a grants.json written by an
earlier version is a plain list without a MAC, so its plug-ins ask once
more, and the next approval replaces it with a signed file.
When the key store can't be reached, an approval lasts for the session
only, nothing claims to persist, and the existing file is left as it is.
The first key is made under a per-user lock and read back, so processes
that approve their first plug-in at the same time keep one key. The web
build keeps no grants file.
New native-only dependencies of vectorcraft-engine: hmac, sha2, getrandom
and keyring (all MIT OR Apache-2.0).
The system font scan built each face from its name, fvar, OS/2, head and
post tables only, so a family that was found but not loaded never had
Thai in its traits. The font menus' Thai filter left such families out,
and Show Similar Fonts grouped them with the other scripts until they
were loaded.
- A face sets Thai when its OS/2 table allows it (no OS/2 table, the
Thai Unicode range, bit 24, or the Thai code page, bit 16) and its
character map has Thai, loaded or scanned.
- The scan reads the cmap table of such a face only, up to 16 MiB.
The search for a document's missing fonts reads no cmap table, so
its byte limit covers the same tables as before.
When the same segment appears more than once among the second segments,
its roots were found once per copy, and each copy's places were checked
against every second segment. The sorted places now drop exact repeats
before they are checked. Places that differ, however close, are all kept,
so the circles found do not change.
A live edit changes the document without an undo step, so the tool was
not told about it. Circles found while a preview moved the second
segment stayed cached under the same segment key, and a click after the
preview was canceled drew the cached circle instead of one touching the
segment where it is again. A first segment picked during a preview kept
its old shape the same way.
The cache key now holds the shapes of the first segment and of the
segments a circle may touch, so moving along an unchanged segment still
reuses the search. The first segment is forgotten when its shape no
longer matches the document, and a press on the second segment follows
the segments as they are at the release; a pressed segment that is gone
leaves nothing to touch.
docs/target-app-parity.md gets a line for the file.write report on a
File object's length, hidden and readonly and for the test that lists
every name the script host adds, with the tests that cover them. The
test's comment on vc no longer names another app.