Commit graph

10340 commits

Author SHA1 Message Date
bunnie
004599543a add the evicted record and remove a debug line i forgot to trim 2023-01-29 04:26:08 +08:00
bunnie
e500588360 fix bugs in key invalidation/eviction logic
1. track evictions as separate from cleanliness. not clean means
the data is dirty and needs writing back. eviction simply means
the data needs be re-retrieved from disk.

2. actually fill the data when we do a sync -- previously
we only copied the old data into the new page but then forgot
to allocate the data and assign it to the cache (oops)

3. sync the small pools after doing a remove inside the update()
command to make sure we've met invariants for future calls
to cache fills

so many corner cases, i'm going around in circles....
2023-01-29 04:21:31 +08:00
bunnie
99a88ff25a only invalidate the key entry if it is within the current range of interest
previously, we were invalidating at the first instance of
encountering the key; instead we should only invalidate once
we've processed it in our range of interest.
2023-01-29 04:19:24 +08:00
bunnie
70c41ef244 increase threshold for GC on PDDB
for some reason it's being called a bit earlier than i expected.
2023-01-29 04:17:57 +08:00
bunnie
df2dda32be add api call to increase PDDB debug level at runtime 2023-01-29 04:17:42 +08:00
bunnie
d77552899b add some code to help find OOM keys 2023-01-29 04:16:56 +08:00
bunnie
27131f6e9a add another test case to deltest
simulates a very typical pattern of remove an element
then populate it
2023-01-29 04:15:34 +08:00
bunnie
145e0469bc fix another edge case in key deletion
invalidated keys that were not dirty were not being removed
also added routine to fill keys that are evicted from the cache
during the update routine
2023-01-28 19:08:01 +08:00
bunnie
7cb98699aa add some consistency check and repair facility to PDDB 2023-01-27 15:26:46 +08:00
bunnie
a3086357bd make backup timestamps windows-compatible 2023-01-27 14:19:41 +08:00
Gianguido Sorà
73a4f7898f
apps/hello: bring back order 2023-01-26 19:34:58 +01:00
Gianguido Sorà
916c22896a
apps/transientdisk: app to demonstrate userspace usb mass storage api
Exposes a 1.44mb usb drive, that survives until you either shutdown
the device, or change app.
2023-01-26 19:31:40 +01:00
Gianguido Sorà
2ff7d0a1fb
usb-device-xous: ignore block-device related messages in hosted mode 2023-01-26 19:29:53 +01:00
Gianguido Sorà
12a7271732
usb-device-xous: implement way to reset current block device app 2023-01-26 19:29:20 +01:00
Gianguido Sorà
9e5cc25a50
usb-device-xous: remove in-crate block device demo implementation
Now in apps/transientdisk
2023-01-26 19:28:43 +01:00
bunnie
25cc571228 chore: remove warning, and old notes 2023-01-27 02:23:53 +08:00
bunnie
9ea5182103 cleanup minor UX issue (disappearing title when no items present) 2023-01-27 02:23:34 +08:00
bunnie
20a2388b5d update commit ref of opensk code 2023-01-27 01:47:48 +08:00
bunnie
9c5efebf38 add bulk deletion of keys from a single dictionary 2023-01-27 01:43:24 +08:00
bunnie
99995f963d use bulk delete to speed up the reset process
this is necessary to pass the test after creating
dozens of credentials; it takes too long to process the
deletion if it's done one at a time
2023-01-27 01:42:50 +08:00
Gianguido Sorà
76bfa0b37a
usb-block-device: fix compilation warnings 2023-01-26 18:27:53 +01:00
bunnie
50458e837b improve debug output in storage layer 2023-01-26 23:34:08 +08:00
bunnie
dee4bac956 add some more time allowance for resets to process from boot 2023-01-26 23:33:38 +08:00
bunnie
c3ab5ca126 fix bug where old key data was not being zeroized on delete
on valid pages were being updated in a dictionary entry as
it is updated; actually, entries that are invalid should also
be zeroized, otheriwse they "Stick around" as valid entries.
2023-01-26 23:32:22 +08:00
bunnie
6b93cfd567 add fscb sync and pruning to the delete test bench 2023-01-26 23:31:43 +08:00
bunnie
a8a220ff99 bump release notes 2023-01-26 23:31:25 +08:00
bunnie
f6a8d678cc fix bug in small pool re-packing after delete
the new offset address was being used for copying data, instead
of the old offset, which was causing key data to refer to
an incorrect entry after deletion
2023-01-26 22:05:03 +08:00
bunnie
31d958d41e improve debug output on PDDB 2023-01-26 18:01:28 +08:00
bunnie
c21f1069bc make reset timing a bit looser
currently 10 seconds from boot before cred reset can be issued;
automated testing can't always keep up with that. expand to
20 seconds. This is not "standards compliant" but the idea that
you unplug the device and it stays on is also not "standards compliant".
2023-01-26 17:59:52 +08:00
bunnie
705427b2c4 Merge branch 'fido21' into main 2023-01-26 04:43:27 +08:00
bunnie
f1f486e9fb fix PIN permissions; add support for autotest reset 2023-01-26 04:42:40 +08:00
bunnie
29b92b7ba4 bump lockfile 2023-01-26 02:42:45 +08:00
bunnie
9e86b6d3fd add timeout variant for USB Rx -- note: not tested!
turns out we didn't need this variant for things to work
with the new OpenSK stack.
2023-01-26 02:42:17 +08:00
bunnie
10a64da826 allow vendor commands; get vaultbackup-rs working 2023-01-26 02:38:03 +08:00
bunnie
78866199ea fix zero-length key readback error in bulk reads
zero-length keys return a data section of None, instead
of Some(<empty vec>), as the latter representation deserializes
to a null pointer panic.
2023-01-25 23:17:30 +08:00
bunnie
fd4e402d98 refine the heuristic for detecting keys 2023-01-25 22:41:03 +08:00
bunnie
e9ae3fe72b fix key deletion in fido2 2023-01-25 22:36:15 +08:00
bunnie
8974a86f24 add migration from old to new version
confirmed this works for U2F and FIDO2 keys

however, the PIN is reset.
2023-01-25 15:34:54 +08:00
bunnie
b7d5eca720 fix missing corner case in cache refill 2023-01-25 13:50:06 +08:00
bunnie
c083a9ca85 chore: fix typos 2023-01-25 00:55:32 +08:00
bunnie
5ce6e1b766 initial integration of fido2.1 now passing some basic tests 2023-01-25 00:55:12 +08:00
Gianguido Sorà
7eef972065 usb-device-xous: implement primitive for apps-based block devices 2023-01-24 17:30:35 +01:00
bunnie
2fb776b2a6 first cut at porting in FIDO2.1 features from OpenSK
Code now builds, but, it doesn't fully work. Also,
the vault backup vendor routines have yet to be wedged in.

On the other hand, this edit is much more targeted than
the first one, so hopefully future port-ins of OpenSK
will be much smoother. In particular, OpenSK has a nice
`env` abstraction that has enough power now for us to
stick most of the Xous-specific stuff in there. There's
still a few patches needed to the main code loop, mainly
to accommodate our ability to display more information
than flash an LED.

The storage layer is also migrated to a totally new
dictionary, because the latest version also completely
redoes the storage with some sort of key/value system,
which maps nicely into the PDDB.
2023-01-24 03:56:30 +08:00
bunnie
5b00daba0d bump release notes 2023-01-20 18:25:21 +08:00
bunnie
1786089187 bump release notes 2023-01-20 18:24:26 +08:00
bunnie
70d5490bbb Merge branch 'main' of github.com:betrusted-io/xous-core into main 2023-01-20 18:13:59 +08:00
bunnie
f542943df1 fix search criteria to match case-insensitive listing 2023-01-20 18:13:39 +08:00
bunnie
71a1dddf15 fix some more edge cases in PDDB key deletion 2023-01-20 18:07:24 +08:00
bunnie
ea913a6fb4 fix initialization order so that CI can run 2023-01-20 18:07:09 +08:00
bunnie
b7380db79d add test case for pddb delete keys 2023-01-20 18:05:36 +08:00