Commit graph

162 commits

Author SHA1 Message Date
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
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
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
bunnie
a19e11e5d3 fix an instance of "root keys" -> "setup passwords" in the vault app 2022-07-23 00:33:07 +08:00
bunnie
593928bd75 remove testing menu from vault for release 2022-07-19 17:58:12 +08: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