Commit graph

647 commits

Author SHA1 Message Date
nworbnhoj
7c64863ef8 Rename "Matrix chat" to "Matrix cli" 2023-07-29 06:54:11 +10:00
bunnie
51278451a0 update version pins to pull in cramium target 2023-07-19 21:07:56 +08:00
bunnie
9932d971c4 clean up the warnings that are deemed safe to clean up
one warning remains, will address this in a future PR.
2023-07-16 17:55:28 +08:00
bunnie
cae402fad0 fix case where an idle font selection menu can crash the system while in TOTP mode
when the font menu is raised while in TOTP mode, the "pump"
thread continues to prompt for redraws, which can eventually lead to
an overflow of the server queue on the main thread that leads to
deadlock and eventually a crash.

This patch does two things:

- splits the allow_host variable and the allow_totp_rendering variable
so that the two flags have distinct meanings

- use the allow_totp_rendering variable to control when the
totp thread is allowed to pump the main thread to animate the
timer bar.

Previously the allow_host variable was introduced to control access
to sensitive data, and it incidentally was also used to control
TOTP rendering because when host readout is activated this can
freeze the UI for extended periods of time.

By splitting the flag we can now control both independently of
each other. Rendering still stops when host readout is enabled,
but it also stops when any other blocking dialog boxes are popped up,
hopefully preventing future crashes if a user is distracted in
the middle of a UX flow that can block the main loop.
2023-07-06 16:36:10 +08:00
bunnie
2f54ae39d4 Merge branch 'fonts' into main 2023-07-05 13:47:26 +08:00
bunnie
dfffa48715 move default system font to gam/src/lib.rs SYSTEM_STYLE
default system font can be statically changed by modifying
the SYSTEM_STYLE constant.

This of course will lead to a request for a dynamically
configurable preference for font size. However, early
on it was decided this is a bad idea. Here's why.

We don't provide for dynamic system-wide font selection
because this adds a lot of complexity to what would otherwise
be static code: this is a deliberate choice to improve code
density and performance. If the system font were dynamically
adjustable, then every character rendered we would potentially
have to query the PDDB for the current system font setting.

The impact of this could be mitigated by caching values but
then what happens when you actually change the font? now
you need a registry to fire messages off to all dependent
crates with cached values to flush their caches and redraw
(or you punt and force a reboot if you change font sizes,
but still, you're creating a dependency on a lot of plumbing
for even the simplest crates).

Plus, with a static font selection, the compiler can take constants
like the font height and compose them with other fitting
parameters into optimized load/stores of borders and spacings
for the static case; if you make it dynamic, all those multiplies,
adds and divides now get pulled into the main rendering loop
and are recomputed all the time. For example, if you have a static
const list of items that need to be rendered, even if the code to
compute the height of the list is written as a for loop, the compiler
will know the list is constant, and the font height is constant,
and it can condense that all into a single number at compile time,
eliminating all the code for the for loop.

If you leave the option open to change that, that entire piece
of code has to be generated and executed even though in practice
nobody changes the parameter.
2023-07-05 13:39:11 +08:00
bunnie
4ac979f0ab update pins, again 2023-07-04 11:20:12 +08:00
bunnie
c9f8f2681b update version pins 2023-07-04 11:09:13 +08:00
bunnie
952ba18fba commit vesrion pin bumps 2023-06-16 01:30:18 +08:00
Jean-Pierre De Jesus DIAZ
2af737b57e
xous-rs: move LANG variable to locales
This change is made with the intention of making the xous-rs crate a bit
more freestanding without depending on the xtask build system.

Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2023-06-15 18:23:12 +02:00
bunnie
08aac2c285 limit loading screen to password transitions
it interferes with the ctap2 tests
2023-06-07 01:41:14 +08:00
bunnie
5f5d926462 comment out the filter performance profiling
it's fast enough now that probably the performance profiling
accounts for a non-trivial portion of the runtime
2023-06-06 20:13:45 +08:00
bunnie
93d07e3cb8 cleanup debug crumbs 2023-06-06 20:07:47 +08:00
bunnie
63299c7ca6 bump release notes and comments 2023-06-06 19:52:45 +08:00
bunnie
6bb5569c9f add a screen to indicate when databases are reloading
since the operation can take quite a while
2023-06-06 19:31:26 +08:00
bunnie
567d9db2cd optimize the ui cache routines
rely more on the cache retaining consistency with the disk
versus always reloading from the disk to speed up performance.

might be useful to make a routine that can also check coherency
periodically, because with the new format the cache could
co-exist along side the database for a very long time without
any checking.
2023-06-06 19:17:24 +08:00
bunnie
4c180810a5 fixup sorting so that it only goes by lowercase values 2023-06-06 16:54:08 +08:00
bunnie
bd5b482cb0 rework list filtering to use an unsorted vec instead of btreemap
also eliminates references, copying and locking of items in the
sorted btreemap.

turns out that ... sorting is much cheaper than copying or maintaining
references, because copies to heap items require allocs which are
under the hoood several sorts to find the place to stick the alloc
memory, and shared references require locks.
2023-06-06 15:33:55 +08:00
bunnie
fa436c0845 fix bugs so that the implementation is working
as suspected, the shared lock is killer on performance.
2023-06-05 22:50:59 +08:00
bunnie
9bb3ac0db7 first stab at refactoring filter to be faster 2023-06-05 04:57:26 +08:00
bunnie
fbe3cb2a3d bump package numbers to absorb PR #388 2023-05-28 15:58:11 +08:00
bunnie
5a2df4432c technical debt: cleanup UTRA package
- make the "base" field no longer public. It is accessible, but only
through an `unsafe` method, because, it is unsafe.
- add accessors to offest/mask fields. Because, it's not at all
unsafe to access these, and it can be useful for bit-ops that are
not part of the generic set of UTRA.
- add Arc to AtomicCSR, and require `std` for AtomicCSR types.
This should not break anything, I checked inside @foundation-devices
keyOS and they don't seem to be using AtomicCSR anywhere.

The Arc makes it a bit safer to clone the AtomicCSR base pointer
and share it between threads, but it will have an impact on performance.
The USB stack (which requires AtomicCSR) was regression testing and the
impact seems minimal.

Recall that the main purpose of AtomicCSR is to provide a CSR accessor
that does not require a mutable reference to the base object. This
can make certain Rust idioms a bit cleaner. We wrap the base accessor
in Arc+Atomic to try and improve the safety of throwing the borrow
checker under the bus, but it's still not perfect because hardware
mutable state can have side-effects within hardware itself that cannot
be modeled or checked by Rust's borrow checker.
2023-05-23 18:11:24 +08:00
bunnie
08602773b9 tweak the test case generator for vault 2023-05-23 02:13:33 +08:00
bunnie
99f9278568 cleanup bitrot in testing routines 2023-05-23 00:14:35 +08:00
bunnie
6e16ef163f WIP #325
This hopefully resolves #325 but I'm unable to test it because
the U2F demo site I use for testing seems to have been disabled.
2023-05-22 18:36:22 +08:00
bunnie
2aa51736f5 fix #353 and possibly also #333
this adds a configurable autotype delay, and also adds a
left-handed mode option to the `vault` ui.

more testing is needed for #333, I think.
2023-05-22 17:22:17 +08:00
bunnie
6ec99fa7da add multi-line text editing support to TextEntry, and insertion points
TextEntry boxes can now specify "growable" as an option; if this
is set true, then, the fields within are considered to be multi-line
fields that can grow to fill the screen (even pushing lower ui
elements off the screen...); however a text line is limited to
256 characters so generally the overflow issue is hopefully rare-ish.

Left/right arrow keys conjure up an insertion point to allow for
deleting and inserting text in the middle of a field.

The main quirk is that if you enter text that causes a field to grow in
size, the overall dialog box can't grow any larger, so the text simply
overflows into the UI element above the current line, without limit.

Need to check for interactions with other elements that should
not be affected but it passes some simple test cases in `vault`.
2023-05-17 23:27:07 +08:00
bunnie
d6a87666ab add bip39 password entry prompt 2023-05-17 04:12:25 +08:00
bunnie
f93d9de3f1 add BIP-39 entry for passwords in vault
If the "notes" field starts with the characters
"bip39" (case insensitive), then, the password field is
interpreted as a hexadecimal encoding of BIP39 entropy.

To create a BIP-39 entry, leave the password field blank,
and then start the Notes field with the characters 'bip39',
and this will trigger a dialog box that will only allow
valid bip39 entry and check the checksum etc.

To view the BIP-39, after opening up the entry for "edit",
close it, and it will pop up a second dialog box that interprets
the hex data as BIP-39 words.

You could also in theory enter the hex digits yourself into
the password field, if you're masochist.
2023-05-17 03:53:55 +08:00
bunnie
697d44de3d bump version pins to absorb changes to svd2utra etc. 2023-05-03 23:11:12 +08:00
bunnie
7513f237e4 cleanup rev/revision manifest error 2023-05-03 22:53:54 +08:00
Jean-Pierre De Jesus DIAZ
3e2eb63663
imports: remove com_rs-ref
The crate just re-exports the com_rs crate. This patch changes usages of
com_rs-ref to use com_rs directly.

Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2023-05-02 14:33:17 +02:00
bunnie
8a574f937f bump for xous-rs version pin update 2023-04-27 22:18:30 +08:00
bunnie
1392fdcf33 bump pins for updated log API 2023-04-16 02:27:37 +08:00
bunnie
cb3c81d0fb fix #357: regenerate password if password field is blank in vault 2023-04-12 23:19:11 +08:00
bunnie
849c136b90 bump versions because API crate changed 2023-04-12 23:02:30 +08:00
bunnie
8357ab31a5 bump all pins because utralib got updated 2023-04-09 00:48:35 +08:00
bunnie
9c94d6b4c0 bump versions because xous-rs API changed for gdb-stub 2023-04-08 23:49:24 +08:00
bunnie
e469eba167 bump version for utralib patch 2023-04-04 02:13:02 +08:00
bunnie
cd0269036d WIP: #334
I don't have a way to test this, but maybe you can give it a try
and see if it fixes as described in the issue.
2023-03-24 23:08:50 +08:00
bunnie
704aaf98af bump versions for kernel interface changes 2023-03-22 02:48:55 +08:00
bunnie
303f595d6f bump versions to cleanup renode.rs sync issue 2023-03-14 16:34:53 +08:00
bunnie
82e3aa322f bump toml files in prep for publish 2023-03-08 03:54:37 +08:00
bunnie
b329023091 workaround trng trait inconsistency
0.5.1 rand_core needed for the dalek crates
0.6.3 traits everywhere else
what a mess

turns out i can just use fill_via_next() to do the same thing
without having to step on cross-generation traits. whew.

(also not in tree but doing a quick manual test that fill_via_next()
is not totally broken)
2023-02-27 02:09:07 +08:00
bunnie
4fa4becc58 fix #310 + revert other "fixes"
Turns out the testbench failures are due to the testbench
being out of date. OpenSK is correct, the tests are wrong.

See discussions here:

https://github.com/google/OpenSK/issues/586
https://github.com/google/OpenSK/issues/584
https://github.com/google/OpenSK/issues/582

We'll await updates to the test tool and fold those into CI,
and leave the current failures standing.
2023-02-07 23:03:29 +08:00
Gianguido Sorà
dca88da039
transientdisk: move flash drive implementation in a separate file
Also encapsulate the entire MemoryMessage handling.
2023-01-31 22:55:04 +01:00
Gianguido Sorà
14679efb0b
transientdisk: clean up us fence macros
Just use "mass-storage", and add a log message to inform the user they
compiled a kernel image without `--feature mass-storage`.
2023-01-31 22:37:46 +01:00
bunnie
9256e7cc09 bump versions to absorb xous-names fix 2023-01-31 15:07:32 +08:00
bunnie
84368c3f3a bump versions for publication 2023-01-31 02:18:12 +08:00
bunnie
a85c0f336c add missing feature dependency to transientdisk 2023-01-31 02:06:56 +08:00
bunnie
c48f88ab93
Merge pull request #302 from gsora/feat/apps-block-device
feat: user-space USB block devices
2023-01-31 01:34:08 +08:00
bunnie
2191503f0c fix #304
this adds a "kicker" thread that gets updated with a target time
to kick the UX by the FIDO2 USB handler. When the target time is
met, an "update" command is issued to the UX.

This hopefully creates an efficient mechanism for triggering a
UX redraw that also has an acceptable delay.
2023-01-30 23:14:16 +08:00
bunnie
797bb0adc6 fix https://github.com/google/OpenSK/issues/584
I suspect this fix is actually the correct solution to the problem,
but refer to the issue above for tracking.
2023-01-30 18:34:43 +08:00
bunnie
b4ce65cb8e possible fix for https://github.com/google/OpenSK/issues/586
This may not be the correct fix, but it causes the test bench to pass.
This will be revisted once I hear back from the OpenSK maintainers.

I strongly supect the issue is actually a bug in how permissions are cleared
after a user presence test, and not that the checks themselves are
incorrect.
2023-01-30 18:33:33 +08:00
bunnie
e64351569f update ctap timeouts in the main loop
This is necessary because there are some timed permissions that
must expire over time that are not asynchronous like the
user presence tests.
2023-01-30 18:32:26 +08:00
bunnie
b1362c0ca4 chore: add a comment 2023-01-30 18:31:53 +08:00
bunnie
c237ff7b46 fix https://github.com/google/OpenSK/issues/582
See the above issue for more details
2023-01-30 18:31:12 +08:00
bunnie
d77552899b add some code to help find OOM keys 2023-01-29 04:16:56 +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
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
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
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
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
f1f486e9fb fix PIN permissions; add support for autotest reset 2023-01-26 04:42:40 +08:00
bunnie
10a64da826 allow vendor commands; get vaultbackup-rs working 2023-01-26 02:38:03 +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
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
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
a62251e563
Merge pull request #301 from betrusted-io/tmarble/issue-300
mtxcli: chat room updates asynchronously
2023-01-20 15:16:53 +08:00
Tom Marble
168b1a7f5c
mtxcli: chat room updates asynchronously
Added more predefined scalar messages
Checks WiFi status
Spawns separate thread for client_sync (reading the network)
Most all log messages are now INFO (to be shown by default)

Closes #300

Signed-off-by: Tom Marble <tmarble@info9.net>
2023-01-19 21:59:50 -06:00
bunnie
20270609b9 fix cached state to match disk state in UX for edit/delete in passwords 2023-01-20 05:06:16 +08:00
bunnie
d811ef0d2e fix deletion UX in vault 2023-01-20 02:00:35 +08:00
Tom Marble
277d014f39 Updates for #287
Allows a variable to be set to the EMPTY string
- by not setting a value `/set myvar`

During initialization now verifies that PDDB is mounted.

Added warnings for PDDB not mounted and WiFi not connected.
- the WiFi check is not yet implemented

Signed-off-by: Tom Marble <tmarble@info9.net>
2023-01-17 12:23:02 -06:00
Tom Marble
e9f21396aa Completes fix for #287
Adds migrations framework
Delays mtxcli initialization until first user input, because we know:
- PDDB is mounted
- Timer is stable
- User actually using mtxcli
Adds send_async_msg scalar_async_msg
- basis for automatically updating chatroom

Signed-off-by: Tom Marble <tmarble@info9.net>
2023-01-17 12:23:02 -06:00
Tom Marble
c213dfb745 WIP: Fix mtxcli excessive memory usage #287
Adds migrations framework
- Migration for v0.9.11-0120: update the filter

Filter
- narrow filter to only the fields and events for the current room

Introduces "read only" variables (e.g. __version).

Signed-off-by: Tom Marble <tmarble@info9.net>
2023-01-17 12:23:02 -06:00
Tom Marble
a042deb462 WIP #287: Adds /heap command to mtxcli
Signed-off-by: Tom Marble <tmarble@info9.net>
2023-01-17 12:23:02 -06:00
bunnie
232a4b6c6c bump xous version 2023-01-18 00:02:46 +08:00
bunnie
41d4837551 bump versions to absorb WDT change 2023-01-06 17:48:12 +08:00
bunnie
bb5d7b3adf bump versions to absorb hosted mode fix 2023-01-05 14:07:24 +08:00
bunnie
ec5435bd58 add basis cache clear on basis change callback as well 2023-01-04 04:15:44 +08:00
bunnie
57254ce47c clear local caches when basis state changes 2023-01-04 04:13:14 +08:00
bunnie
c3ecaa00eb refactor: remove allocs from vault inner loop
`vault` is changed so that instead of clearing the list of
data each time the screen is updated, it tries to compare it
against the existing data and modifies the record if it needs to,
or leaves it untouched.

Furthermore, at least in the password path, temporary strings
are pre-allocated and re-used, instead of freed and re-allocated
every time through the main loop.

The combination of these optimzations reduces the time to re-parse
a couple hundred records from about 1000ms to 200ms, reducing the
overall time to retrieve the database from 1.8s to 1.0s. It also
makes the loop much more stable over time; previously, as the heap
fragmented, performance would slowly degrade. Now that most
records are static and re-used, the performance seems to stay
constant.

The framwork is also put in place to re-use TOTP/U2F records,
but the code still uses the legacy method of clearing the
entire stored list and rebuilding it. However, it wasn't deemed
a priority to fix this because generally I haven't seen use cases
where users have hundreds of tokens or TOTP's; so long as the
number is about 20 or so, the performance difference should
be imperceptible with or without optimization.
2023-01-04 03:03:19 +08:00
bunnie
10b921e4e8 cleanup another format, add some more analytics 2023-01-03 23:36:46 +08:00
bunnie
59f06ff16f retrofit repl to use table cosine lookups, so it links with lto="fat" 2023-01-02 17:50:06 +08:00
bunnie
36398810dd bump version numbers to absorb new syscalls 2022-12-30 15:24:36 +08:00
bunnie
8d42feb051 increase heap for mtxcli; add memory usage reporting 2022-12-28 19:48:40 +08:00
bunnie
5370ce396d bump all revs due to SoC artifact update 2022-12-12 16:07:20 +08:00
bunnie
53c9af1033 bump readme's 2022-12-02 23:00:38 +08:00
bunnie
c8ec87b2d6 apply persistent field to other authentication methods 2022-11-30 15:11:56 +08:00
bunnie
d7a3f8962d update vault's password edit to use the new persistent field 2022-11-30 15:00:20 +08:00
bunnie
e8671650e3 add more test cases 2022-11-30 12:13:27 +08:00
bunnie
bf19a60369 add docs for CSV flow 2022-11-30 12:13:15 +08:00
bunnie
e63aaf8832 change wording of error on skipped entry 2022-11-30 12:12:43 +08:00
bunnie
a312432135 fix up some formatting & one missed string in the refactor 2022-11-30 11:31:57 +08:00
bunnie
9699cb761a avoid use of format!() to improve performance (#260) 2022-11-30 00:56:08 +08:00
bunnie
79c773e245 add basic CSV to password support 2022-11-29 23:53:27 +08:00
bunnie
c696f4eff0
Merge pull request #279 from gsora/feat/hotp-vaultbackup
fix: support HOTP codes in `vaultbackup`
2022-11-25 18:12:20 -08:00
bunnie
1d1b3a35b7 commit version bump 2022-11-26 10:00:44 +08:00
bunnie
aa9977cc58 bump all the things because we changed utralib again 2022-11-17 22:13:40 +08:00
bunnie
dabbfd6c35 bump all the things to absorb the SoC change 2022-11-17 19:39:18 +08:00
Gianguido Sorà
279ecbc748 fix: support HOTP codes in vaultbackup
While `vault` supports HOTP codes, `vaultbackup` didn't.

This commit brings it to feature parity.
2022-11-16 15:56:18 +01:00
bunnie
474a02c2cb refactor all vault db retrieval to use new API
This refactors the remaining vault accessor routines to use
the new more efficient key pre-fetching routine. This also
fixes up an error in test case generation and hopefully resolves
an issue with concurrency errors using the older version of
the access routine.
2022-11-09 15:06:51 +08:00
bunnie
e7e110ce76 cleanup and enhance test cases 2022-11-09 14:25:05 +08:00
bunnie
a7162fd03c bump xous-names dependents 2022-11-07 22:19:38 +08:00
bunnie
880675c238 remove UX delays between dialog boxes 2022-11-06 18:44:56 +08:00
bunnie
30583bdf07 bump versions with xous change 2022-11-06 03:48:12 +08:00
bunnie
1ca0ef7b1f clean up warning 2022-11-05 16:30:29 +08:00
bunnie
601f3476f4 initial delay on NTP poller
no point in clogging up the boot sequence with requests that
will almost certainly fail.
2022-11-05 16:19:15 +08:00
Tom Marble
05252663a4 Updates mtxcli README
Signed-off-by: Tom Marble <tmarble@info9.net>
2022-10-29 17:39:42 -05:00
Tom Marble
604a3765b8 Adds images of mtxcli
Images of mtxcli
- in the hosted environment
- on the Precusor
- in French

Signed-off-by: Tom Marble <tmarble@info9.net>
2022-10-29 17:39:42 -05:00
bunnie
ba28dd8795 bump to absorb utralib straggler configs 2022-10-28 15:11:17 +08:00
bunnie
e60f7cc855 Merge branch 'i18n/adds-french-localization' into main 2022-10-28 15:00:27 +08:00
bunnie
dfb10ed7f2 bump crate numbers to publish lang-fr change into xous-rs 2022-10-28 14:01:09 +08:00
Tom Marble
006a69105c
Completes the i18n_helper.py tool
Added 'fr' translation
Added *.json to .gitattributes

Signed-off-by: Tom Marble <tmarble@info9.net>
2022-10-27 16:07:05 -05:00
bunnie
c82a79dab9 add performance monitoring in for bulk reads 2022-10-27 16:45:04 +08:00
bunnie
475e464efe bump versions due to svd2utra change 2022-10-27 03:04:22 +08:00
bunnie
e7a78aaf9e
Merge pull request #258 from betrusted-io/pddb-bulk-bufserializer
Pddb bulk bufserializer
2022-10-27 02:59:44 +08:00
bunnie
bef734553e clarify some comments and clean up debug messages 2022-10-27 02:53:38 +08:00
Tom Marble
e55c7495b1
Updates the mtxcli app (#254)
* Updates the mtxcli app

mtxcli:
- Simple chat now functional!
- All strings use translations
- Updates the README
- updates mtxcli to handle PDDB existence check

Adds *.pyc to .gitignore

Signed-off-by: Tom Marble <tmarble@info9.net>
2022-10-26 12:16:09 -05:00
bunnie
3d1885e165 add test code
results are slightly better on the first run (3700ms instead of 4900ms)
but there seems to be really excessive allocations using the heap
allocated serializer by rkyv. We really need to use the bufserializer
I think for this to work.
2022-10-27 01:10:17 +08:00
bunnie
0ee9ec1d80 bump version numbers for crate publication 2022-10-25 22:38:58 +08:00
bunnie
30ea893c74
Merge branch 'main' into xous-rs-os-selection 2022-10-25 17:28:33 +08:00
bunnie
d331d405ee bump version numbers for publication 2022-10-25 17:23:40 +08:00
bunnie
67fc21fbdd harmonize hosted mode selection, but retain an explicit hosted flag
In general, hosted mode is assumed "by default" if the target
is not Xous. This allows packages to be built cleanly on command
lines that don't know to pass a --feature flag to specify a target.

However, an explicit "hosted" flag is still retained so that we
can confirm the build system intent. This saves us from the failure
mode that we thought we were building for target A, but accidentally
ommitted the flag, and instead we've been silently building for
"hosted" mode without any warning. The main consumer of the "hosted"
flag is now just the build.rs script inside of the utralib.
2022-10-25 17:21:02 +08:00
bunnie
65e9e2399d more detail on where time is being spent in the vault 2022-10-24 02:36:07 +08:00
bunnie
1256f6f713 add vault-perf to profile performance issues in vault 2022-10-24 00:37:18 +08:00
bunnie
805a7d528c flip back to using remote references 2022-10-20 16:30:06 +08:00
Tom Marble
8d810dcc51
Adds mtxcli commands using the PDDB (#246)
* Adds mtxcli commands using the PDDB

/get key -- shows value of key (from the PDDB)
/set key value -- sets value of key (in the PDDB)
/unset key -- removes key (from the PDDB)
/status -- shows status of the connection

Updates .gitignore for PDDB in hosted mode
2022-10-19 12:50:00 -05:00
Tom Marble
90bcd989f7
Reverts quit operation 2022-10-18 13:31:31 -05:00
Tom Marble
cf02c3c3b6
Adds GAM DefaultApp opcode
NOTE: action on DefaultApp is not yet implemented: this
should allow the GAM to choose which application is safe
as a default (for other applications to "quit" by switching to it).
Proposed default application is "shellchat".

Updates mtxcli commands
- removes audio command
- adds help and quit commands
2022-10-18 11:54:27 -05:00
bunnie
8e05925cfa somehow the transition to local paths got missed in the merge 2022-10-18 00:39:01 +08:00
bunnie
0584ad2f2c switch to local paths to see if this helps the build 2022-10-18 00:26:56 +08:00
bunnie
4d1da235a9 bump revs that depend on susres to absorb changes 2022-10-17 05:11:09 +08:00
bunnie
4b368d71db bump versions of crates 2022-10-15 01:31:54 +08:00
bunnie
63a87ca1bc bump all the versions 2022-10-14 16:54:43 +08:00
bunnie
ff30131f43 absorb more fixes into the kernel 2022-10-13 04:08:56 +08:00
bunnie
3503965f98 bump versions to absorb xous-rs changes 2022-10-13 03:41:16 +08:00
Tom Marble
e9ba2e1b9a
Updates mtxcli README
Rebase on main
2022-10-12 13:54:32 -05:00
Tom Marble
21908e9d01 Adds app mtxcli
Initial version of mtxcli is simply a copy of repl with the
requisite manifest changes to make the app unique.

Signed-off-by: Tom Marble <tmarble@info9.net>
2022-10-12 13:51:44 -05:00
bunnie
be239f9812
Merge pull request #238 from Foundation-Devices/from-into
Implement From instead of Into.
2022-10-12 11:49:19 -07:00
Jean-Pierre De Jesus DIAZ
5971507410
apps/vault: Implement Display instead of Into
Avoid allocations in some cases, for example, when formatting
to an I/O buffer. Or when formatting an string.

Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2022-10-12 15:39:01 +02:00
Jean-Pierre De Jesus DIAZ
01bc25c55d
apps/vault: Implement From instead of Into
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2022-10-12 15:38:37 +02:00
bunnie
f8a2ea51bb remove rkyv warnings from xous-api-names 2022-10-10 03:16:40 +08:00
bunnie
02b80425f5 bump xous-rs to absorb change in language specification 2022-10-10 03:07:44 +08:00
bunnie
3bca9de2a0 bump version numbers for xous-kernel patch
this fixes tests in CI
2022-10-05 23:51:35 +08:00
bunnie
969f93b001 cross-repo update versions from xous-rs bump 2022-10-05 18:32:44 +08:00
bunnie
9dcc0a3386 absorb ticktimer api bump, propagated from susres bump 2022-10-03 04:40:06 +08:00
bunnie
d2b2383d1a bump susres version 2022-10-03 04:36:32 +08:00
bunnie
b184bfbe6a move ticktimer to remote api 2022-10-03 03:37:38 +08:00
bunnie
89ca75c4bf move over to remote susres api 2022-10-03 02:24:44 +08:00
bunnie
6123e8ff9b xous-names conversion to crates.io 2022-10-03 01:18:20 +08:00
bunnie
de514ac66f rename packages in prep for upload to crates.io 2022-10-03 00:24:45 +08:00
bunnie
4e40ae6c5d move from target selectors to feature selectors for back-ends
This will allow for e.g. xous on riscv32-imac but not a precursor
target, for example: by using feature selectors we get to have
a bigger range of targets that we support, such as for implementations
that haven't been upstreamed or have official target-triples.

The downsides are:

- patch override libraries don't absorb feature flags. so, for
example, the AES crate that is used to patch other crates won't
be aware of the target features without modifying the referencing
crates.

- features are normally meant to be additive, but target features
are mutually exclusive. The mutex is enforced by a check in
utralib that throws a panic on build if two targets are accidentally
selected at the same time.
2022-10-02 02:56:44 +08:00
bunnie
52728bce1f more xous-ipc bumps 2022-09-27 01:15:00 +08:00
bunnie
f188e0f866 re-bump xous-ipc to 0.9.9 2022-09-26 16:50:38 +08:00
bunnie
507ab42836 downgrade xous-ipc to 0.9.7 until i have permissions to push a new version 2022-09-26 16:11:26 +08:00
bunnie
3579dfdd17 update xous-ipc and xous versions 2022-09-26 16:07:35 +08:00
bunnie
114d60bc53 migrate logserver API to external package 2022-09-26 14:06:46 +08:00
bunnie
72859d18dd fix UX update issue on FIDO adding records.
maybe need to also chase this down in the password add new area too?

need to check.
2022-09-23 00:37:15 +08:00
bunnie
278570d8d3 progress on issue #223
This adds the abort flow to the U2F approvals. Needs more testing.
2022-09-23 00:27:14 +08:00
bunnie
13402b99b9 fix #224
was a logic bug where the database name was not updated while
doing some refactoring previously
2022-09-22 22:05:57 +08:00
bunnie
8fe4c50373 improve error reproting on #206 2022-09-20 23:24:42 +08:00
bunnie
ba45fc2685 fix validator issue on hotp count 2022-09-20 23:13:18 +08:00
bunnie
9225cbaba3 resolve issue #206 by adding check for existing basis 2022-09-20 23:06:22 +08:00
bunnie
22a440f75f Add HOTP initial count feature; try to fix HOTP panic
- HOTP now prompts for an initial count
- Found a code path where improperly formatted HOTP field can
lead to a 0-value being passed to a totp generator
- Added guardrails around the TOTP generator so it can't divide by 0:
it issues a warning instead.
2022-09-19 23:44:45 +08:00
bunnie
47ce1e3149 add version history for TOTP records 2022-09-18 21:53:35 +08:00
bunnie
d1cda8f669 add hotp support
hotp is merged as a "minor" feature off of totp. In other words,
the default mode is totp, but one can specify a totp record
to be an hotp record and it will behave as an hotp record.

We re-use the "step_seconds" field to specify the count parameter.
There is no separate initial count / count field -- the two are
tracked in a single u64 that is stored in the "step_seconds" field
of what would be a totp record.

This also revs the TOTP record to v2. This *should* not break
anything:

- v1 records deserialize as totp records into v2 (which is correct,
as there are no hotp in v1)
- when a v1 record is saved to disk, it is stored in v2 format
- v1 records that are not edited stay as v1
2022-09-17 00:39:47 +08:00
bunnie
fad3aa6ec0 fix fido readback from test vectors made in hosted mode 2022-09-17 00:39:19 +08:00
bunnie
b22e3a1b43 fix dependabot security issue in base64 dependency 2022-09-11 21:48:20 +08:00
bunnie
3899f25837 add a usability note 2022-09-09 15:35:16 +08:00
bunnie
7902676918 note dependency for protobuf-compiler for the upload tool to work 2022-09-09 15:33:10 +08:00
Nickolai Zeldovich
6e1e2acd28 minor cleanup 2022-08-31 15:33:27 -04:00
Nickolai Zeldovich
b604b746e9 format conversion for importing Google Authenticator TOTP 2022-08-31 14:38:06 -04:00
bunnie
9a4933b648 Merge branch 'main' into rustls-exp2 2022-08-16 15:13:56 +08:00
bunnie
1ff85cab41 add note about host readout to the README.md 2022-08-14 00:21:53 +08:00
bunnie
a9e9592094 improve error messaging when host readout is not enabled 2022-08-14 00:20:46 +08:00
bunnie
eb2fda3c6c
Merge pull request #213 from gsora/feat/vault-bitwarden-import
feat(vault): support Bitwarden export formatting for Vault
2022-08-14 00:01:07 +08:00
bunnie
e7576ebb42 reduce debug level on vault 2022-08-13 23:55:40 +08:00
bunnie
8570449b04 make vendor backup locked out by default; hook to UX enable dialog box
also halts updates of the TOTP timer bar while this is happening
to avoid overflowing the server queue with unanswered redraw
requests
2022-08-13 23:54:36 +08:00
Gianguido Sorà
5acb0af82b feat(vault): support Bitwarden export formatting for Vault
Allows folks with Bitwarden data to (mostly) import it in Vault, both
passwords and TOTPs.
2022-08-13 17:40:25 +02:00
Gianguido Sorà
1defdff915 chore(vault): add serde_repr for vaultbackup-rs 2022-08-13 17:40:02 +02:00
Gianguido Sorà
9a219d8aba chore(vault): add default for PasswordEntries 2022-08-13 17:39:37 +02:00
bunnie
56172e37a9 shift vendor command space to 0x70 range
this avoids conflicts with OpenSK and open-ssh's handling
of their vendor commands.
2022-08-13 22:25:07 +08:00
Gianguido Sorà
dca1ec86de fix(vault): don't panic when reading backup::PayloadType off an empty
vec
2022-08-13 16:01:51 +02:00
bunnie
9e0b63c871 make the "hash" arguments match the display UX values
that way any entries that would show up "exactly" as the same
description would flag as conflicts on re-upload
2022-08-13 21:46:06 +08:00
bunnie
7ec39e4be6 strip out the random-guid code 2022-08-13 21:37:56 +08:00
Gianguido Sorà
cd42cf6395 fix(vault): storage for totp and passwords derive pddb key from their
unique content

Instead of generating a unique GUID every time a new record gets
created, hash known unique content for every entry and use that as key.

The StorageContent trait now has a hash() method that returns a Vec
containing the SHA-256 hash of the object's unique content.

Hashing is done by re-using the same calls that ctap uses.

This allows dupes detection when restoring a backup, allowing us to
employ a "never overwrite" policy: Precursor is the main source of truth
for such data.
2022-08-13 13:29:42 +02:00
Gianguido Sorà
cdfae27afc feat(vault): implement basics of dupe detection
Still needs a way to deterministically generate a key for each entry.

Idea: a `hash() -> String` method on StorageContent so that new_record
can call it, store said object with the newly-generated key.

Since this is a deterministic operation, restoring a backup with dupes
would not overwrite what's present in PDDB already.
2022-08-12 18:47:38 +02:00
Gianguido Sorà
473e1cf77b chore(vault): address warnings 2022-08-12 17:37:51 +02:00
Gianguido Sorà
51b04fe14e Merge branch 'main' into feat/vault-usb-totp-loading 2022-08-12 17:16:30 +02:00
Gianguido Sorà
29dfe4eb98 feat(vault): add logging, support Wire format 2022-08-12 16:57:47 +02:00
Gianguido Sorà
115781b979 feat(vault): implement VendorSession for backup/restore calls that span
multiple CTAPHID sessions
2022-08-12 16:57:05 +02:00
Gianguido Sorà
a594342d03 feat(vault): add bulk new record method on storage abstraction
Instead of syncing for each new record, new_records() only syncs:
- when it's writing an entry that has index multiple of 10
- when it's the last packet in sequence
2022-08-12 16:55:59 +02:00
Gianguido Sorà
2e50699c82 feat(vault): add Wire type for >7601 bytes of CTAPHID payload 2022-08-12 16:55:12 +02:00
Gianguido Sorà
5758b1d4c0 feat(vault): handle usb restore for >7601 bytes of payload 2022-08-12 16:54:26 +02:00
bunnie
2e0f1df894 intermediate commit through experiments 2022-08-12 15:56:05 +08:00
bunnie
6fff73ace8 fix missing path to try_send_message 2022-08-11 03:11:47 +08:00
bunnie
cfa65a3a72 add some notes about integration with #205 2022-08-11 02:48:56 +08:00
bunnie
b39ec5d044 don't crash if the pumper thread can't send a redraw poll 2022-08-11 02:48:38 +08:00
bunnie
e824334747 add a thin UX layer to manage switching host readout mode
needs a bit more integration with the final TOTP/password
scripts logic
2022-08-11 02:32:38 +08:00
bunnie
d1bd99a7f2 demonstrate switching of core between configurations using shell commands 2022-08-10 18:58:55 +08:00
bunnie
d128a91892 don't completely break the CTAP2.0 compliance suite
The response to get OpenSSH to work is non-compliant
(because it's trying to read a 2.1 command set out of a 2.0
device). This will lead to breakage in the 2.0 test bench,
but, it will allow the device to work with OpenSSH.

meh. specs, schmecs.
2022-08-03 23:46:52 +08:00
bunnie
3ab4031706 reveal credProtect extension 2022-08-03 14:45:18 +08:00
Gianguido Sorà
98302dc89c feat(vault): add readme for vaultbackup-rs 2022-08-02 16:12:10 +02:00
Gianguido Sorà
199d5ddeb5 Merge branch 'main' into feat/vault-usb-totp-loading 2022-08-02 15:53:11 +02:00
bunnie
6b53688249 fix #195
let's see if we can raise the limit on credentials now that
the performance issues have been partially addressed.
2022-08-02 01:45:39 +08:00
bunnie
e32ea1e32f change read buffer api from read_to_end() to read_exact()
read_to_end() "guesses" the total amount of data to read by doing
roughly 5 calls per couple hundred bytes: it starts by guessing
it's 32 bytes long, then another 32, then 64, then 128, and then
a final call to make sure there's nothing more.

The read() call is somewhat expensive in that it involves initializing
and sending page-sized memory chunks, and every time it also
descends the entire basis hierarchy, recomputing the overlay.

Probably, this can be improved with some sort of server-side caching
of read results -- if a file is read, it seems very likely that
the next few bytes will be read and a smarter caching implementation
could smooth over some of the expense.

However, a much easier fix for now is to just change the read
call to read exactly the length of the file being presented. Since
we already have the key handle, we can get the attributes and then
do a single read of the exact amount.

Doing this improves the speed of the UX substantially, about 40%
faster for the same operation (at least).
2022-08-02 01:38:46 +08:00
Gianguido Sorà
6fe53e6be9 chore(vault): rustfmt on storage.rs 2022-07-29 15:22:53 +02:00
Gianguido Sorà
af9c71273b improvement(vault): get rid of monomorphization on most storage::Manager
methods

Less kernel bloat!
2022-07-29 15:18:49 +02:00
Gianguido Sorà
21d77cc92a Merge branch 'main' into feat/vault-usb-totp-loading 2022-07-29 13:17:12 +02:00
bunnie
318f95d347 fix problem with over-zealous validator fields
actually, we just need to check for : on the basis names, not
everything else!
2022-07-28 04:46:07 +08:00
bunnie
494ec7c2b3 improve the basis name validator - ':' is an illegal character in a basis name. 2022-07-26 00:05:45 +08:00
Gianguido Sorà
de4c164c7b Merge branch 'main' into feat/vault-usb-totp-loading 2022-07-25 11:44:01 +02:00
Gianguido Sorà
b21ef727bc chore(vault): clean up
Remove unused funcs, types and replace them with the storage crate
analogous.
2022-07-25 11:31:44 +02:00
bunnie
a19e11e5d3 fix an instance of "root keys" -> "setup passwords" in the vault app 2022-07-23 00:33:07 +08:00
Gianguido Sorà
31cb7c9ae1 chore(vault): support backup/restore of passwords 2022-07-19 16:47:28 +02:00
Gianguido Sorà
8c0564bc22 feat(vault): handle passwords, support new CLI objects
Mostly needed to not duplicate backup/restore routines/commands, hence
wrapping an enum around it.
2022-07-19 16:45:58 +02:00
Gianguido Sorà
dfd11ba5df feat(vault): better cli experience, provide backup/restore of passwords
as well
2022-07-19 16:45:39 +02:00
bunnie
593928bd75 remove testing menu from vault for release 2022-07-19 17:58:12 +08:00
Gianguido Sorà
23f9717fee chore(vault): use storage more and more 2022-07-18 17:32:54 +02:00
Gianguido Sorà
75b30f723e chore(vault): use new generic storage in vendor commands 2022-07-18 17:32:09 +02:00
Gianguido Sorà
5f7fb22317 chore(vault): provide default for TotpAlgorithm
The default is "None", which will fail any conversion or usage
2022-07-18 17:31:32 +02:00
Gianguido Sorà
222a912603 chore(vault): don't generalize delete on storage, pass ContentKind as
ref
2022-07-18 17:31:08 +02:00
Gianguido Sorà
6cdf2fa880 feat(vault): finish generic implementation of storage methods 2022-07-15 10:54:44 +02:00
Gianguido Sorà
3edb98431b chore(vault): make the error explicit 2022-07-14 19:21:02 +02:00
Gianguido Sorà
ba2c573ef4 chore(vault): try generalizing Manager operation 2022-07-14 18:39:13 +02:00
Gianguido Sorà
e3710c3c81 chore(vault): rename totpbackup to vaultbackup 2022-07-14 16:49:04 +02:00
Gianguido Sorà
71979f81d7 feat(vault): implemet totp backup on device-side 2022-07-12 17:30:26 +02:00
Gianguido Sorà
bdeb68a158 feat(vault): add password-related methods to storage abstraction 2022-07-12 17:30:11 +02:00
Gianguido Sorà
371164b82f chore(vault): implement std::errror::Error on CborConversionError 2022-07-12 17:29:50 +02:00
Gianguido Sorà
186e83bf9e feat(vault): implement totp backup from device to computer 2022-07-12 17:29:31 +02:00
Gianguido Sorà
7cd279259a chore(vault): make it depend off libraries/backup 2022-07-11 18:15:41 +02:00
Gianguido Sorà
9722bbc573 chore(vault): use backup structs, storage abstraction in vendor command handling 2022-07-11 18:15:14 +02:00
Gianguido Sorà
8b4eca753e chore(vault): export TotpAlgorithm struct 2022-07-11 18:14:39 +02:00
Gianguido Sorà
42f0589010 chore(totp): abstract backup/restore models 2022-07-11 18:14:25 +02:00
Gianguido Sorà
d40763b80f feat(vault): begin implementing a storage layer for totp, password 2022-07-11 18:13:27 +02:00
Gianguido Sorà
99ba5fa075 chore: move backup/restore models into libraries subdir 2022-07-11 15:07:34 +02:00
Gianguido Sorà
23a46268b4 match against percursor usb pid/vid 2022-07-08 18:11:10 +02:00
Gianguido Sorà
e222ae4bf3 disable default features for hidapi, since ctaphid already takes care of that 2022-07-08 17:40:03 +02:00
Gianguido Sorà
c619287824 first raw commit 2022-07-08 15:36:25 +02:00
bunnie
761cffc35e strip some debug spew 2022-07-05 03:00:31 +08:00
bunnie
ae717f78af add code to make the ball app full-screen redraw affirmative on context switch
otherwise, you'll get some stale artifacts because the ball app
relies on the prior state of the screen for clean rendering
2022-07-05 02:35:38 +08:00
bunnie
62372488df fix removing keys from FIDO2
I had put the fallback operation in the wrong arm of the match branch
2022-06-28 19:59:27 +08:00
bunnie
943e45f17e remove suspend/resume awareness from app
In retrospect forcing apps to manage their suspend in resume
crosses too many abstraction barriers.

Instead, the app should specify the mode of the hardware, but
then the driver should be responsible for restoring that state
on resume, not the app.
2022-06-28 01:18:26 +08:00
bunnie
3e70dea0f8 start to lay in suspend/resume automation for vault
it doesn't work yet -- but we need to get a push into CI for
other testing now.
2022-06-27 16:03:11 +08:00
bunnie
99f58db8e9 add note about performance regression 2022-06-27 15:25:58 +08:00
bunnie
6f849af2a2 fix busy-wait in prereqs ntp updater 2022-06-27 15:13:58 +08:00
bunnie
ed4f7b2092 restrict debug access when running vault app
this removes the security message about the debug core
being unlocked
2022-06-27 02:33:23 +08:00
bunnie
0e5fb14894 add a compatibility gate on USB HID interface
If the SoC isn't compatible, don't try starting the U2F server.
2022-06-27 02:00:22 +08:00
bunnie
9cf48fcaa5 add storage limits on FIDO cred count
perfomance regression on the PDDB with the latest fixes make
the device stop passing compliance when the database grows
to about 40-ish keys. For now, we set the cred limit to 32,
until the performance issues are addressed. (note that yubico
has a limit of 25 credentials, so, 32 is not insanely low).
2022-06-27 00:04:46 +08:00
bunnie
79c20eb498 fix in-place edit of keys
The behavior with a secret basis is as follows:

- The key stays in the basis in which it was created.
- So, if you created k1 in .System basis, and k2 in Secret basis,
  if you edit k1 while Secret basis is open, k1 stays in .System
  basis. it does *not* migrate into Secret basis.

I think this is the "least surprising" behavior. There is an
argument that "maybe I want to keep secret notes in an overlay
on a key" but I feel like creating a second shadow copy of a key
with a different set of notes is not the most desired behavior
for this application (NB: it could be desired for others applications,
and that behavior can be programmed with the PDDB API; which is
why the API is a bit explicit at the moment. This flexibility goes
against the goal of "foolproof deniability", unfortunately, but
I think it is too early to know which default to set for the system).
2022-06-26 17:37:57 +08:00
bunnie
42b84ad890 adjust some of the default basis references in OpenSK storage implementation
These adjustments ideally make the system less confusing to use in
the face of secret Bases, but the spec calls for some information that
could be a leakage channel (see below).

- items that are assumed to be consistent regardless of the basis
are now forced into the System basis. This reduces potentially confusing
behavior if the system has han unlocked secret basis and things like
PIN hashes are set which appear to be global.

- There is a "global signature counter" which could leak some information
about how many credentials are in the device. However, the FIDO2 spec
enforces some plausible deniability by requiring that the counter increments
by a random value instead of by 1. In the OpenSK implementation, this increments
by a random integer from 1-8. So, if you store dozens of credentials in secret
bases, it may become less deniable due to this global signature counter.

The global signature counter seems optional, so maybe that is a feature to
be stripped out...
2022-06-26 14:25:54 +08:00
bunnie
a4c6b65b11 Merge branch 'main' of github.com:betrusted-io/xous-core into main 2022-06-26 04:06:40 +08:00
bunnie
9f409fda2d fix basis search order issues
at least, it passes some simple tests. much more testing is needed.
2022-06-26 03:52:27 +08:00
bunnie
e62c9bf3d3 add basis management functions and debug some basis issues
there's some problems with the automatic basis unionization
feature. now debugging...
2022-06-26 02:11:13 +08:00
bunnie
475fadb255 make search strings persist between modes and menus 2022-06-26 02:10:50 +08:00
bunnie
819b84954a add autotype to TOTP. why not? 2022-06-25 23:02:12 +08:00
bunnie
6aadbf3cae fix error message on edit of FIDO2 entry 2022-06-25 23:02:01 +08:00
bunnie
4319ac4f45
now changes when time is set
fix logic
2022-06-25 09:01:02 +08:00
bunnie
68db7e8c7a reduce noise from the prereqs debug loop 2022-06-25 00:23:46 +08:00
bunnie
22702cc03b add a prereqs checkpoint
this checks to make sure that the system is in a usable state
for the vault to run before allowing it to be launched.
in particular, the PDDB must be initialized, and so must the
system time.
2022-06-25 00:22:09 +08:00
bunnie
7deb6fd4a1 add notes about how to clear test entries 2022-06-24 18:58:07 +08:00
bunnie
4771f04451 update progress while making test entries 2022-06-24 18:57:44 +08:00
bunnie
c6aecc08dc fix bug where entries don't redraw scrolling up/down to new page 2022-06-24 18:57:24 +08:00
bunnie
3c82898780 fix some minor bugs
- test entries for passwords at 100 entries. it's...pretty slow
at 300 passwords, about 8 seconds to scan/read-in the database.
once the database is read-in, sorting and viewing is fast. good
news is that heap usage is about 300k for that many entries,
no OOM crashes found. just slow.

- fix an unimplemented()! error

- strip out some debug
2022-06-24 17:23:00 +08:00
bunnie
847e64c46a add totp record add/edit rough draft UX flows 2022-06-24 15:53:57 +08:00
bunnie
024b9d9ce1 make it so that attempts to list empty dictionaries don't fail
this might point at a larger error of empty dictionaries not
being recorded, but this is a work-around for now...?
2022-06-24 15:53:23 +08:00
bunnie
9a5c04cc73 add a time progress bar in TOTP mode 2022-06-24 03:40:21 +08:00
bunnie
7765f3dec3 add other hash support; notch back the hmac dependencies
our engine is a version older in API rev, so notch back the
dependencies so we're all at the same rev
2022-06-24 01:46:09 +08:00
bunnie
5d8b85c0bf totp demo working 2022-06-24 01:18:37 +08:00
bunnie
57845b6fb6 clean up warnings in ctap 2022-06-24 01:18:32 +08:00
bunnie
729a6ad186 add the beginning of the TOTP functions 2022-06-24 00:31:25 +08:00
bunnie
ce461a06fe add routines to populate test entries, and use less synthetic data 2022-06-24 00:30:45 +08:00
bunnie
e998e96323 change visibility of some routines so we can access storage in the UX 2022-06-24 00:30:29 +08:00
bunnie
512f435b2a move the FIDO random secret into the FIDO_DICT
originally we stuck it in the CRED_DICT because it forces its
creation -- but there's no reason to *really* do that. We just
set the dictionary to be created if it's not existent in the later
API calls.

By moving this to FIDO_DICT instead of FIDO_CRED_DICT it makes
key access & sorting much cleaner in the UX, because you don't
have this odd key hanging out, and it also means that you can't
have an attack on the system where you try to name a key with
the name held in FIDO_CRED_DICT to try and read it out.
2022-06-24 00:28:58 +08:00
bunnie
5e08941950 change display order for passwords
sort by description not username
2022-06-23 04:22:11 +08:00
bunnie
ad22618c8d add some debug around deserialization errors 2022-06-23 04:17:37 +08:00
bunnie
8c986035b8 add trailing newline to serializations
the final entry can accrue cruft after it if there is no newline
2022-06-23 04:11:58 +08:00
bunnie
57f9e1a5f9 fix font setting 2022-06-23 03:01:44 +08:00
bunnie
304c865bb3 fix count on password access; make USB HID selected when vault is active 2022-06-23 02:27:05 +08:00
bunnie
09046854db add password edit/delete functions 2022-06-23 01:32:06 +08:00
bunnie
9671ef65f5 add password deserialization framework and UX routines 2022-06-22 21:20:19 +08:00
bunnie
f7f2868802 refactor to put blocking modals into its own thread
UX interaction via blocking modals are put into its own thread
so that the background UX can update while menus and modals are
popped up.

Still some bugs to work out to make this fully implemented,
but this is the major work fleshed out.
2022-06-22 04:52:40 +08:00
bunnie
ad92cbe1cb add customized menu contexts per sub-app 2022-06-21 02:41:03 +08:00
bunnie
8d4cdb3284 fix indexing bugs 2022-06-21 01:14:37 +08:00
bunnie
82e9c57ed4 add dirty rectangle flags to improve drawing performance 2022-06-20 22:20:28 +08:00
bunnie
b310967cf2 strip out excess redraws 2022-06-20 03:09:24 +08:00
bunnie
5a72076768 add dynamic search as text is typed 2022-06-19 19:04:25 +08:00
bunnie
72e6be8679 add some initial selectable list framework 2022-06-19 17:33:26 +08:00
bunnie
b945a085b0 more prototyping of the list browser UI 2022-06-19 03:17:12 +08:00
bunnie
b7453b627e add API tokens to prediction API
The prediction API now takes an API token. This is a 128-bit
number that gets passed to the prediction engine, and it's meant
to be unique for every context that requires a predictor.

It's up to the prediction engine to do anything with the token.
For the "null" engines (such as the icontray for `vault` and
`tts`) the token is just ignored. But for example, in `shellchat`,
the API token is used to store a history record in a HashMap on
a per-token basis. This means that every app that uses the
`shellchat` history function gets their own history that can only
be read out by that app.

The actual token itself is mostly passed through the API. The
token storage is in the Context layer (each Context has a record
for a token, that starts as `None`), and is passed down to
the predictor every time the context swaps, and the predictor
receives the token and passes it back if the token was `Some`,
or allocates a new random token if it was `None`.

Note that everything is a Context, including, for example, menus and
modal dialog boxes, but not all contexts have predictors. Only
Contexts that ask for a predictor have them. This mechanism
works smoothly in this model (as opposed to other hacks and work-arounds
previously tried getting to this solution).
2022-06-19 01:01:25 +08:00