Commit graph

157 commits

Author SHA1 Message Date
bunnie
ec55f6de6d reduce the wait time on boot to PDDB mount
improves user experience, doesn't seem to impact startup
2022-08-05 04:56:37 +08:00
bunnie
b5f45ec9ec improve the wording of the menu option to setup passwords 2022-07-19 23:59:50 +08:00
bunnie
0a4702d6c3 clean up dialog messages to conform to the latest lexicon 2022-07-19 16:30:00 +08:00
bunnie
7ad418be7c fix bug where RestoreDna backup op fails to be set. 2022-07-19 05:26:48 +08:00
bunnie
d68e3c229d add "gutter" server for status thread so it doesn't block during autoupdates
this properly solves the issue of the keypress machine sending
notifications to a status thread that's not running: it creates
a dummy server that can drain the queue until the status thread
is ready to run properly.
2022-07-19 04:39:00 +08:00
bunnie
421542d9da add auto-rekey flow to boot 2022-07-19 03:17:21 +08:00
bunnie
83eb05273f sync the PDDB before doing a backup 2022-07-18 03:09:07 +08:00
bunnie
3550cec14a fix double-lock on rootkeys object 2022-07-17 03:12:49 +08:00
bunnie
37154f3350 add edge case handling for restore to new device
Just remembered that the PDDB is *locked* to a given device.
To restore to a new device, you have to unlock all the Bases,
and re-encrypt them to the new device's DNA.

This commit adds the facilities to detect this condition, but
the actual code to do this is quite involved...let's handle that
after we've got a "simple" restore to the same device going.

Why do we lock to a device's DNA? the idea is to prevent
attacks where people are taking static blocks of crypto data
and just swapping it between devices to see if they can
get something to decrypt. It also makes it harder for
an adversary to replace the physical device -- e.g., an
evil maid prepared a replacement with implants in advance, and they
image your PDDB onto the replaced device, hoping that you don't
notice. Because the PDDB is device-locked, the "evil maid"
would have to forge the devices DNA to match yours:
possible, but would require kernel mods that patch over the
reported ID; that would trigger the line across the top of the
screen; or, somehow editing the FPGA itself to force
its device ID to report the same as yours. This last attack
vector would be successful, but afaik there is no known way
to modify an FPGA's DNA code. I'm sure there is some proprietary
secret know that Xilinx uses to set it, and if you were
a large government you may be able to coerce Xilinx into giving
you those codes plus some tool that could set the fuses
plus some unfused devices (the fuses are burn-once) but....
2022-07-16 02:31:18 +08:00
bunnie
e1d946a18d other items for keyboard layout backup/restore 2022-07-16 00:39:34 +08:00
bunnie
abade9e1af minor fixes in the autoupdate flow
- do not try to create root keys if we just did an SoC update.
that's just too many things going on, we should definitely force
a clean reboot first.

- add a clean reboot step after a no-key soc update

- try to switch USB debug mode on if a backup was created
2022-07-14 19:26:09 +08:00
bunnie
239cdef1ef add enhanced debug to time 2022-07-14 03:50:13 +08:00
bunnie
d0c0fdd9ab fix forward-version autoupdate flow and change boot ordering
in order to trigger an update in early boot, all the security
sensitive servers have to have their connection tables occupied
(I guess the fancy term is the "capabilities" need to be allocated.
whatevs. #notanacademic).

This fixes the flow so those capabilities are occupied before
we get to the update check. Also fixes options to ignore updates.
2022-07-14 02:00:24 +08:00
bunnie
5847cb04cf improve resume error handling in the time block 2022-07-13 15:16:15 +08:00
bunnie
b4b6fc2a49 unbreak hosted mode 2022-07-13 05:01:36 +08:00
bunnie
85ced42465 add automatic checks for backup/restore on boot 2022-07-13 04:44:44 +08:00
bunnie
941d72f3c5 add a magic word check to the wf200 routine
avoids running an update if nothing is staged at all.
2022-07-12 03:31:54 +08:00
bunnie
ed2f029874 add SoC autoupdate flow options -- still needs testing 2022-07-11 18:36:00 +08:00
bunnie
f756c4ee66 note stats on quitting the updater thread 2022-07-11 16:27:13 +08:00
bunnie
3e8065ee56 quit the ec updater thread once we're done checking for updates
unless we're debugging, there is no more need for its resources
to be allocated.
2022-07-11 16:23:36 +08:00
bunnie
24c10dcfb2 bump the rate of update feedback slightly
slightly more aesthetic experience without too much performance
penalty.
2022-07-11 15:09:47 +08:00
bunnie
a90b5f2554 clean up autoupdate flow & clean up net link reset flow
We are now at a point where the EC update can be applied and the
net stack recovers gracefully, so no reboot is required in the
case of an EC update.
2022-07-11 15:07:53 +08:00
bunnie
d639b3db55 fix debug output 2022-07-11 04:13:04 +08:00
bunnie
70003b641f migrate ecup to the status thread
also rework the boot flow to have auto-update detect for EC updates
2022-07-11 04:05:53 +08:00
bunnie
ead5bd7dac enable gateware updates when no root keys are present 2022-06-30 22:58:54 +08:00
bunnie
77baf89d5c have time server retry on I2C error 2022-06-28 03:25:14 +08:00
bunnie
a0217d9ffd debug logic and whitespace 2022-06-28 01:14:38 +08:00
bunnie
95b4df1923 fix regression on suspend/resume on time server
seems like we're putting too much demand on the I2C bus
on resume at the moment, backing off the requests a bit
helps ease the logjam.
2022-06-28 01:13:25 +08:00
bunnie
be7d8a76a5 catch potential div by 0 on status redraw 2022-06-27 18:45:02 +08:00
bunnie
ac3f6a06fb fix status bar (ran out of precision during the floating pt refactoring) 2022-06-27 04:25:18 +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
b9e1e69adb update a commment so we know not to change a particular constant 2022-06-25 00:21:46 +08:00
bunnie
78ea80f809 remove main() thread-wrapping for non-ditherpunk configs
saves a bit of memory
2022-06-19 21:39:29 +08:00
bunnie
82919637d8 remove TODO (@gsora confirmed everything is OK!) 2022-06-18 00:42:50 +08:00
bunnie
9eec4436ea some comment bookkeeping and whitespace cleanup 2022-06-18 00:17:35 +08:00
bunnie
ed555b8b7a add translations/modify wording 2022-06-18 00:02:40 +08:00
bunnie
6d2531804b
Merge pull request #191 from gsora/gsora/backlight-on-keypress
Automatic backlight on keypress
2022-06-17 23:55:44 +08:00
bunnie
cf89ebe5f5 add wrapper around main functions that need bigger stacks
This allows for `ditherpunk` config to have a much larger
stack size on select processes only.

The cost comes at a 4k fixed overhead for the sacrificial
wrapper thread, so we lose about 20k of runtime RAM, even
when ditherpunk is *not* activated (because we're
always wrapping the threads).

There is no impact on scheduling or CPU utilization, as the
wrapper thread blocks and is never scheduled once the real
main starts. However, it does subtract one thread from the
total available thread pool.
2022-06-16 03:40:19 +08:00
bunnie
8cb632180c fix fractional decimal places on integer conversions 2022-06-14 04:30:58 +08:00
bunnie
7b2fbdc88b evict f64's from the kernel, and eliminate f32 parsing
turns out these routines add quite a bit of bloat to the kernel
for only cosmetic reasons.
2022-06-14 04:14:25 +08:00
Gianguido Sorà
d7eb53664e chore: move automatic backlight in status crate
Let's not use a precious process just for some a backlight effect :-)
2022-06-13 16:33:44 +02:00
Gianguido Sorà
1ebf3316e7 feat: wire keyboard backlight controls to main menu 2022-06-10 17:14:38 +02:00
Gianguido Sorà
0ff4e569c1 Merge branch 'main' into gsora/backlight-on-keypress 2022-06-10 17:12:52 +02:00
bunnie
e32ea4d3f5 fix #174 2022-06-10 21:36:53 +08:00
Gianguido Sorà
4115c9b2cd feat: wire keyboard-backlight to status menu 2022-06-10 14:33:33 +02:00
bunnie
9ee306315e fix warnings that result from the PDDB mutability change 2022-05-31 23:55:12 +08:00
Sean Cross
3ae9d8abf0 apps/services: remove xous::xous_main macro usage
This macro will be removed, since it is no longer necessary. Remove this
macro across the project and replace it with a standard `main()`
function.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-05-31 13:33:30 +08:00
bunnie
62cbc86aeb add automation strings 2022-05-24 23:21:26 +08:00
bunnie
c7f9688b5f have status point to the USB crate for USB checkup 2022-05-17 02:25:44 +08:00
nworbnhoj
0e561802ce enable notification modal text + qrcode
change the notification modal to accept the primary message and an
Option of independent text to display as a qrcode

pub fn show_notification(&self, notification: &str, qrtext:Option<&str>) -> Result<(), xous::Error> {}
2022-04-24 21:29:15 +10:00