The vault app is the beginning of a multi-purpose authentication vault.
It will feature:
1. FIDO2 authentication
2. TOTP authenticators
3. Password storage to PDDB with auto-typing via keyboard HID
This is the first step on a very very long journey.
alright. the composite device problem is solved. The bigger issue I'm
mulling is if I should try to port the Google OpenSK FIDO2 stack into
Xous, or if I should just do a limited U2F implementation.
Poking around at the OpenSK stuff...porting looks possible, but, it's
going to be vendoring in all of the source from the OpenSK project. So
it'll be tough to apply patches if they happen; on the other hand, the
OpenSK implementation is FIDO2 certified, and the stable branch hasn't
moved since Nov 2021.
The main downsides of the OpenSK implementation are:
- it uses nightly. I think it can be stripped out, though; I haven't
seen a "good reason" for it yet, it's mostly because Tock uses
nightly. There's only one alarming use of it and it's in the crypto
crates but those will be stripped out because....
- the crypto libraries are in fact not suitable for use. I dug into
them and they definitely need to be gutted and replaced with the
community-blessed crypto libraries and APIs. which is one big reason
why once this goes into Xous land it doesn't go back easily into
OpenSK land -- they actually have slightly different crypto
APIs. more modern ones, to be fair, but, they haven't been reviewed.
- the implementation has "too many features"...for example, I don't
think we'll ever realistically do authenticator attestation as it
requires signing NDAs and provisioning secret keys that we can't
share with users. But that code is there, and we'll either have to
gut or bodge it.
The plusses are:
- it's FIDO2 certified. So, at least the protocol stack is probably
complete and fully implemented, which means for features we don't
use today I can just leave hooks or dummy values there for a fast
migration path.
- Looks like they aren't changing things too fast in the dev
branch...so this probably is not like riding a greased pig
- Looks like a couple of paid professionals wrote the code...better
than what we have going on here
- I think I see a path to carve out their "persistent store" and glom
it into the PDDB; a path to adapt their crypto traits into
Xous-native traits; and a path to connect their CTAP protocol engine
to the Xous HID server. So it seems feasible. But they baked in some
bad API assumptions deeply enough that they are one-way streets I
think to get these ports done.
I'm going to sleep on this, but I'm leaning toward trying to pull in
the OpenSK code because even tho it is a bit painful it probably gets
a bigger feature scope and so far it looks like I wouldn't be changing
any protocol-level stuff for the port, I would just be monkeying
around with the internal storage, crypto, and USB implementations, so
ideally the end result is we get a certified FIDO2 protocol engine for
the effort.
I think the main concern I have going in this direction is I don't see
a way to do this and simultaneously be able to absorb upstream patches
into this vendored code, because their API assumptions are too
different. Any bug fixes or patches would have to be manually applied
and merged. But maybe that's not such a big deal...?
Issue #159 may be caused by queueing a connection to respond to when
the timer expires, but if the timer expires twice then it tries to
respond to a null connection id.
And if it goes to suspend in the same millisecond as it services the
condvar, then it'll reissue the interrupt when it comes back from
suspend.
Issue #159 may be caused by queueing a connection to respond to when
the timer expires, but if the timer expires twice then it tries to
respond to a null connection id.
And if it goes to suspend in the same millisecond as it services the
condvar, then it'll reissue the interrupt when it comes back from
suspend.
remaps keys based on the assumed keymap based on the user's
preference for the keyboard layout on the device.
So far, only dvorak and QWERTY are supported.
use `usb kbdtest` to output a mapping assuming US-101 maps
it will then derive an appropriate keymap based on that mapping
doesn't support non-ascii characters (yet)
Also includes the USB test commands in shellchat.
This is different from the usb-test crate, in that it's fully
integrated into Xous. usb-test is just for quick-testing the USB
driver, in the absence of most of the rest of Xous.
we have to add a patch to usb-device because the SpinalHDL UDC
needs a little extra handholding on EP0 to switch IN and OUT modes
(vs e.g. STM32 where EP0 has IN and OUT descriptors).
a small bug was found in the device core that is now fixed. the
device core was not computing the target for the SETUP transaction
correctly if the HEAD of the OUT descriptor was set in advance of
the SETUP transaction. we now see much more consistent SETUP
transactions, and even the first IN response.
the next challenge is figuring out why the second IN response doesn't
seem to be issued.
we're now two packets into the setup.
i think i see one fundamental mismatch between how the driver
behaves and how the hardware runs. it has to do with where the
ep0 data gets deposited for a SETUP or OUT transaction --
the HEAD of the list can't be allocated the transaction is
completely ready to go.
will bang on this more tomorrow, but this is progress at least.
interrupts seem to behave much more like i think they should.
i think the interrupt unit on the spinalHDL block is not made to
have the whole set enabled/disabled frequently, it just wants
to have the bits banged to clear the interrupts. enabling and
disabling interrupts as a whole causes some erratic operations.
NB: the reference linux driver only enables them once and never
turns them off.
also, realized just now that OUT is from the direction of the host.
so OUT on the device is incoming data. oops.
things are moving in the right direction, i'm seeing the next
IN packet being issued by the USB driver on the precursor
side, but it's not being sent by the hardware. yet.