Commit graph

3958 commits

Author SHA1 Message Date
bunnie
a05ab47d10 add some test code to exercise TLS to break the linking 2022-08-13 21:23:35 +08:00
bunnie
a8f2c99b6c Merge branch 'main' into rustls-exp2 2022-08-13 02:01:21 +08:00
bunnie
f70dc246b8 fix hosted mode 2022-08-12 23:26:43 +08:00
bunnie
ef62dbf307 update release notes 2022-08-12 23:22:48 +08:00
bunnie
4ae3308fbe add PIN change to the PDDB 2022-08-12 23:10:18 +08:00
bunnie
7aca2d64b3 lower debug level 2022-08-12 23:09:06 +08:00
bunnie
9122186900 eliminate rendundant boot PIN request; fix bug in boot key generation
- boot PIN is not requested on root password init. it's redundant,
as it is actually set when you format the PDDB
- boot key was mistakenly a copy of the encrypted private key
for ed25519 key signing. "oops". didn't catch that bug until now...
i don't think it has a big impact on existing user base, because
the key is never exposed outside the rootkey server, and the
ed25519 key itself is encrypted with the root password and then
used as the boot key. But still -- that's just not what was intended.
- root password is requested twice to check the validity of the password
2022-08-12 20:18:32 +08:00
bunnie
5e455b60eb add debug to backalyzer to dump encrypted private key 2022-08-12 20:10:19 +08: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
548f4b059d chore: fix whitespace and warning 2022-08-11 03:11:38 +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
23f7a70444 Merge branch 'main' into usb-kbd-refactor 2022-08-10 19:08:14 +08:00
bunnie
486196f987 bump release notes 2022-08-10 19:07:41 +08:00
bunnie
5e1145a471
Merge pull request #207 from nworbnhoj/iter
Implement PNG decode adaptor iterator
2022-08-10 19:01:04 +08:00
bunnie
d1bd99a7f2 demonstrate switching of core between configurations using shell commands 2022-08-10 18:58:55 +08:00
bunnie
2aebf6819a clear out collapsed view in prep to clone hw struct 2022-08-10 14:59:09 +08:00
bunnie
69a7c101a8 split hosted/hw into separate main files
cleans out a bunch of #[cfg] directives that were getting
ridiculous

this version runs clean but needs a lot of work for the next
stage.
2022-08-10 14:54:50 +08:00
nworbnhoj
d96faec4eb add png_decode comments 2022-08-09 06:18:49 +10:00
nworbnhoj
76bb796610 bugfix distortion in png_decode
png filter specification calls for initial prior_line = [0u8]
see: https://www.w3.org/TR/PNG/#9Filters
but [0u8] results in distortion ???????
so use [125u8]
2022-08-08 07:39:49 +10:00
nworbnhoj
155373bfa0 ignore png_decode chunk checksums
The checksum calc is inner-loop so removed for performance gain.

If a hacker can manipulate a byte then then they can manipulate a RGB
byte or a checksum byte - so the checksum doesn't really give any
protection from hacking afaik. I presume the checksum is in there to
detect corruption during storage or transmission - but if a couple of
bytes are corrupted you will not notice the change in the image - and
if a lot of bytes are corrupted then the distortion in the image will be
obvious. This is even more the case in Precursor, where we are shrinking
and dithering the image as a matter of course. So I don't really see the
point of the checkum
2022-08-08 05:47:45 +10:00
nworbnhoj
4ddcabc657 Merge branch 'main' into iter 2022-08-07 05:36:40 +10:00
bunnie
ccb7d4f6b3 convert image loop to use BufReader now that net stack works 2022-08-06 17:46:35 +08:00
bunnie
58a8264080 fix some bugs in printing errored-out sectors
also print the sector data that errors out -- might be a bit
much at the moment but it's very helpful for immmediately
visualizing a loss-of-power event related write corruption
2022-08-06 16:00:15 +08:00
bunnie
77f5eb1dac add a sync command
especially useful in CI where we unceremoniously pull power repeatedly
between tests and this can lead to data corruption.
2022-08-06 15:59:44 +08:00
bunnie
0c50bf983f more error handling on server 2022-08-06 00:38:34 +08:00
bunnie
86d9fd1aad don't die if the stream hangs up on the server 2022-08-06 00:36:04 +08:00
bunnie
205f0a3be3 increase threshold for retiring closes
when not in heavy loopback mode, this occurs more rarely and
probably for more legitimate reasons.
2022-08-06 00:35:18 +08:00
bunnie
d86fd9dfc9 bump minimum toolchain requirement 2022-08-05 16:28:42 +08:00
bunnie
bd8afc6de7 clean up debug spew for merge to main 2022-08-05 15:50:11 +08:00
bunnie
cc03383891 commit the final net test state 2022-08-05 15:17:07 +08:00
bunnie
1aae03742a note loopback interface 2022-08-05 15:16:57 +08:00
bunnie
6f86aee991 give loopback its own rx buffer
instead of sharing the wifi buffer loopback has its own buffer.
this eliminates a race condition that happens whenever an Rx
happens to happen on the wifi interface while there's loopback
traffic in progress.

also, i see a lot of opportunities to optimize the net stack now
that i have tweaked this path; it might be interesting to break
the receive interrupt out directly into the COM crate instead
of passing it through LLIO then NET then COM and having COM
drain the RX buffer immediately into a local "infinite" sized
queue.

The llio->net->com loop exists because the interrupt handler
for all the i/o is shared within one hardware block, but maybe
i can create an additional interrupt responder for the com
interface just to optimize things a bit in a future SOC update.

Alternatively, I could move all the interrupts into COM and not
have them resident in LLIO. This would optimize for COM latency
at the expence of I2C latency, but that's probably OK because
I2C is much less latency sensitive (i2c and com interrupt, as
mentioned above, share the same hardware block for external
pin-based interrupts).
2022-08-05 15:12:57 +08:00
bunnie
e71efd3333 update the release notes as we go along 2022-08-05 05:10:44 +08:00
bunnie
2658dd4b71 add peek handler, heuristic to close sockets that are stuck
- Peek now has a handler for reads that can't be met immediately
- add a count to the number of times a close socket has been polled,
if it exceeds a threshold close the socket anyways. This is a compromise
between trying to figure out how to implement a fully non-blocking TcpClose,
and having an interlocked one that cleans up state but ends up blocking
the case where you have, in the same thread, a sender and receiver
(which is ironically somehow legal and does not cause deadlock,
because the TcpClose in Unix is not blocking on internal state
being cleared up).
2022-08-05 05:07:44 +08:00
bunnie
495ca1e2b7 fix timeouts, peek
- timeouts were being overwritten before they were read
- peek now behaves according to what the test bench expects
2022-08-05 05:05:41 +08:00
bunnie
32e78039b7 xous-side of 0-port listener binding
0 is a "valid" port and it means OS please give me a port.
This implements a method where a random port is chosen until
you find one that's not occupied.
2022-08-05 05:04:35 +08:00
bunnie
1cf0479528 remove heuristic from read loop, now that read works. 2022-08-05 05:04:03 +08:00
bunnie
89cba7250e commit the latest test state
a lot of tests are now passing, but still some work to do
on the clone routines.
2022-08-05 05:03:10 +08:00
bunnie
24a0848a43 add nonblocking flag to opcode map 2022-08-05 05:02:39 +08:00
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
20c2e979c8 add more tests, make print outputs a bit clearer 2022-08-04 21:11:55 +08:00
bunnie
8a797764c1 (possibly dubious) fix on 'unattended' Stream close
If a Stream is opened and a process isn't constantly polling it,
it'll never close if the remote side goes away -- you'll just
end up hanging in a FIN-WAIT-2 condition.

Add some logic to detect this and close out streams automatically
where the remote has hung up.

I'm not actually sure this is what you're *supposed* to do, but,
lacking a formal specification, all I can do is try to get
this thing to pass the test bench. And pass it does.
2022-08-04 21:10:17 +08:00
bunnie
80f78a0f5d tweak debug noise down 2022-08-04 21:09:49 +08:00
bunnie
9f3bef04cc tweak debug noise down 2022-08-04 21:09:24 +08:00
bunnie
6045c75cf0 refactor TcpClose; fix RxWait
TcpClose should not immediately remove the socket. It
has to wait until the FIN comes. Add a fin waiter state.
Also rewrite to use "retain". Woo. I'm starting to get
the hang of Rust closures. Only took a couple years.

RxWait gets stuck in CLOSE_WAIT state. It's a state where
you "could" transmit, but you can't receive anymore.
In this case respond with a 0-length receive? That seems
to be what leads to the right behavior. I would have thought
you'd want to respond with a timeout error but that doesn't
match what's in the test bench.
2022-08-04 05:03:08 +08:00
bunnie
4992d4ebff Merge branch 'main' into nettest 2022-08-04 02:01:14 +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