Commit graph

2634 commits

Author SHA1 Message Date
bunnie
e566ab4e9a greatly improve short sample handling, reduce talk latency 2022-03-08 19:03:40 +08:00
bunnie
9116cb02b1 back-propagate pause->abort changes.
in many of the test routines what we really wanted was an
abort, not a pause.
2022-03-08 19:03:02 +08:00
bunnie
4440e61d02 fix short sample problems, add pause/abort API
pause API waits till the buffer drains to stop playback
abort causes playback to stop immediately, causing pending
frames to go empty.
2022-03-08 19:02:02 +08:00
bunnie
19f09b9ed3 suppress warning messages if no apps are selected 2022-03-08 17:39:57 +08:00
bunnie
c763ede830 tts integration working 2022-03-08 04:41:45 +08:00
bunnie
1d6fbbe5bb add the basic text to speech infrastructure.
also creates a method for isolating incompatibly licensed repos
2022-03-08 03:08:12 +08:00
bunnie
3325a96fd4 Merge branch 'main' into tts 2022-03-08 00:24:38 +08:00
bunnie
f6e9c850da revert inadvertent change to buildpush.ps1 by the merge 2022-03-08 00:23:40 +08:00
bunnie
eb7d35e484 Merge branch 'ffi' into main
this add some routines and test stubs that are helpful for debugging
C FFI integrations. In particular it provides some harnessing that adapts
a minimal selection of libc functions by copypasta of various bsd/mit
licensed libc implementations. It also provides a cheesy malloc using
a Rust Vec...only suitable for simple, single-threaded work, but enough
to unlock a reasonable range of middleware.
2022-03-08 00:20:50 +08:00
bunnie
6d697691db add doc string for ffi-test 2022-03-08 00:19:27 +08:00
bunnie
d1a471b51c clean up the ffi-test library for integration to main
checked all licenses, added some comments, etc.
2022-03-08 00:17:16 +08:00
bunnie
f80d3f089d stash 2022-03-08 00:01:48 +08:00
bunnie
e40aa61d42 Merge branch 'main' of github.com:betrusted-io/xous-core into main 2022-03-07 23:36:09 +08:00
bunnie
6fa3b5d358 bump lock file 2022-03-07 23:35:52 +08:00
bunnie
752b374fcb add metadata for sharing xous-names 2022-03-07 23:35:40 +08:00
bunnie
0a11350771
leave a bread crumb for image creation debugging
because I can never remember how to flip that debug environment variable on windows
2022-03-07 15:04:39 +08:00
bunnie
3878208a8b found the problem...mem* functions are provided in Rust
the libc implementation was overriding key Rust symbols by
re-implementing mem* calls. "oops".
2022-03-07 14:54:18 +08:00
bunnie
199ce642b3 ok this is the version that works, let's start from here. 2022-03-07 14:02:19 +08:00
bunnie
b464c8e661 shoot, this was missing from earlier commits. lost some state. 2022-03-07 14:00:19 +08:00
bunnie
985fcdf9da a feature slipped in that i didn't mean to commit 2022-03-07 13:31:16 +08:00
bunnie
ec48f85071 Merge branch 'main' of github.com:betrusted-io/xous-core into main 2022-03-07 13:28:33 +08:00
bunnie
dd511432b4 fix dangling reference in AES ctr mode soft implementation 2022-03-07 13:28:10 +08:00
bunnie
54e491840d stash to work on an aes api bug 2022-03-07 13:17:58 +08:00
bunnie
817dacb9f9
sync up with changes on main 2022-03-07 00:55:13 +08:00
bunnie
d6e137c9f9
update to latest standards in server templating. 2022-03-07 00:53:35 +08:00
bunnie
4cfd835c0c allow for explicit version pinning of crates in package specifiers for an image
This works around the issue of a dependendent crate e.g. pulling in a version
of sha2 that is an incompatible API with the one provided by the hardware
accelerator. Cargo needs to know for which sha2 crate to build, and
the current "sha2" specifier is too ambiguous.

This is done by specifying it as "sha2:0.9.8", but, this now breaks
the image creation because the actual artifact built is still a filename
of `sha2`, not `sha2:0.9.8`. This patch both adds the fully specified
version to the sha2 crate and also strips out the trailing version
number without breaking e.g. Windows builds which have a ':' built
into every path (so you can't just do a stupid split(':') to strip
off the version number).
2022-03-06 22:24:58 +08:00
bunnie
5c155587b6 Merge branch 'main' of github.com:betrusted-io/xous-core into main 2022-03-03 01:04:43 +08:00
bunnie
9d1aa10a50 add join command to libstd-test 2022-03-02 21:20:20 +08:00
Sean Cross
7e63f89433 linux-server: update versatile system
Signed-off-by: Sean Cross <sean@xobs.io>
2022-03-02 21:15:30 +08:00
Sean Cross
84c0896823 linux-server: update versatile system
Signed-off-by: Sean Cross <sean@xobs.io>
2022-03-02 21:08:22 +08:00
Sean Cross
f342f6f9c8 wf200: add binary file
Signed-off-by: Sean Cross <sean@xobs.io>
2022-03-02 21:02:01 +08:00
Sean Cross
a927349d6b Merge branch 'main' of github.com:betrusted-io/xous-core 2022-03-02 20:51:45 +08:00
Sean Cross
e507c474d6 wf200: add binary file
Signed-off-by: Sean Cross <sean@xobs.io>
2022-03-02 20:51:35 +08:00
bunnie
526bc959af add some facilities for testing net in libstd 2022-03-02 20:43:01 +08:00
bunnie
e7efb14bdf add a bypass for Renode to skip the signature check
- bypass causes warnings to be emitted in compilation
- stark visual change on boot screen ("jail bars" instead of gray on bottom half)
- root keys are locked out permanently from readout
- devboot canary set
2022-03-02 19:51:16 +08:00
bunnie
6bd4eeb9c5 Merge branch 'main' into bunnie-dev 2022-03-02 19:05:10 +08:00
bunnie
06e391e541 fix key commitment check to be constant time
thanks again to Michael Rosenberg for catching this bug and
teaching about about how to use the Subtle/.ct_eq() traits to
implement constant time equality checks.
2022-03-02 19:00:52 +08:00
bunnie
396b9e134a add app generalization to xtask renode commands 2022-03-02 00:00:33 +08:00
bunnie
dd017fb291 retire file-based versioning to symlink methodology 2022-02-28 16:06:48 +08:00
bunnie
4192c2105f pull in 0.9.7 soc precursors 2022-02-28 14:18:04 +08:00
bunnie
1fa0956bdc Update release notes 2022-02-28 14:16:56 +08:00
bunnie
2b3178be82 add a powershell script for bleeding edge CI
Because i don't know how to do variables in powershell :-/
2022-02-28 14:07:42 +08:00
bunnie
65499eb0fc bump version code in the pddbdbg.py script as well 2022-02-28 04:16:06 +08:00
bunnie
dcbe9f122a bump the PDDB version field to demarcate the breaking change 2022-02-28 04:07:45 +08:00
bunnie
39f9e656cf suppress a debug message
key commit seems to work on real hardware. will promote for
release status with a bit more testing
2022-02-28 03:57:16 +08:00
bunnie
0b454cb7a8 evict salamanders from AES-GCM-SIV in the PDDB
So you'd like to think that an authenticating cipher would like,
authenticate stuff on decryption. And AES-GCM-SIV was billed as sort
of AES with the pointy edges taken off.

Well, there's always one more bug, actually this time a salamander:
https://eprint.iacr.org/2020/1456.pdf Apparently one can forge
authentication if the attacker can control keys and ciphertext. In the
case of the PDDB I think the attack is largely theoretical, because
you'd have to forge through both the AES-GCM-SIV and the rather
insufficient nonce/murmur hash check on the PTE that locates the page
to be decrypted.

But it's never good to have cryptographic properties depend upon
something that's known to be insufficient, so let's assume the attacker
can simply forge keys and stick some data on the device.

This wouldn't be a problem for confidentiality but it could lead to
the ability to plant evidence, but more importantly could lead to code
paths that were thought to be protected against fuzzing being fuzzed
as you could conceivably create a Basis root record that "checked out"
and then the larger body of the PDDB code would try to chomp on other
pages that are forged, leading to a bigger attack surface. Plus who
knows what else might exist beyond salamanders...

This patch does a "key commitment" on the Basis root page, so that it
is now cryptographically hard to create a salamander.  Basically
instead of using the system root key directly in AES-GCM-SIV, the key
goes through a KDF that expands it with yet another nonce plus a bit
of header data. The KDF is SHA512/256 and it expands it twice,
changing one bit in the header data (as prescribed by the paper cited
above), to create a version of the key that is written to disk (the
commitment), and a version of the key that is used to
decrypt/authenticate the AES-GCM-SIV data. Only if both the commitment
and the authentication check out, do we accept a Basis root page as
valid.

I had some concerns about the slightly different structure of the
Basis Root page being detectable, but I have been assured that the key
commitment form and the MAC in AES-GCM-SIV satisfy a property known as
IND$-CPA ("indistinguishable from uniform randomness by a
chosen-plaintext attacker") by Rogaway[1], and, more strongly, "Secure
nonce misuse-resistant authenticated encryption (mrAE)" by Gueron and
Lindell (see appendix for def)[2]. Still, just out of total paranoia
and nothing else, I organize the basis root page such that the MAC is
in the identical location as the other non-committed pages...just in
case there is some mathematical property of the MAC that could be
leveraged to leak info about the existence of the basis root record.
The commitment nonce and sha512/256 result I understand better and
feel pretty comfortable that they are going to be strongly random and
indistinguishable from AES ciphertext.

Thanks to Michael Rosenberg for taking the time to explain all this to
me and to guide me through the process of making the fixes. It is a
major PDDB API-breaking change and I'm glad it's able to be rolled out
before most users have received a device.

[1] https://web.cs.ucdavis.edu/~rogaway/papers/ad.pdf
[2] https://eprint.iacr.org/2015/102
2022-02-28 03:13:26 +08:00
bunnie
2c668fde3d Merge branch 'main' into bunnie-dev 2022-02-27 18:21:50 +08:00
bunnie
8a17b45dc1 fix skeleton template 2022-02-27 18:21:11 +08:00
bunnie
d0ecd54435 remove stray espeak artifacts from this dev branch 2022-02-27 18:20:43 +08:00
bunnie
b012cfa2fc update SoC precursors to latest Litex
prep for future activities e.g. vexriscv perf optimization and
Luna USB integrations
2022-02-25 02:45:36 +08:00