Karolin Varner
1275b992a0
Merge branch 'main' into rustix
2024-11-28 21:01:07 +01:00
Martin Kröning
19b31bcdf0
refactor(mio): close FDs via std instead of rustix
...
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de >
2024-11-11 11:14:33 +01:00
Martin Kröning
939d216027
refactor: import FD traits from std instead of rustix
...
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de >
2024-11-11 11:14:33 +01:00
Paul Spooren
1d1c0e9da7
chore(examples): add examples to docs
...
Signed-off-by: Paul Spooren <mail@aparcar.org >
2024-11-08 11:17:43 +01:00
Paul Spooren
e19b724673
docs(typenum): fix docstring warnings
...
Signed-off-by: Paul Spooren <mail@aparcar.org >
2024-11-08 11:17:43 +01:00
Paul Spooren
f879ad5020
docs(result): fix docstring warnings
...
Signed-off-by: Paul Spooren <mail@aparcar.org >
2024-11-08 11:17:43 +01:00
Paul Spooren
29e7087cb5
docs(mem): fix docstring warnings
...
Signed-off-by: Paul Spooren <mail@aparcar.org >
2024-11-08 11:17:43 +01:00
Paul Spooren
637a08d222
docs(io): fix docstring warnings
...
Signed-off-by: Paul Spooren <mail@aparcar.org >
2024-11-08 11:17:43 +01:00
Paul Spooren
6416c247f4
docs(fd): fix docstring warnings
...
Signed-off-by: Paul Spooren <mail@aparcar.org >
2024-11-08 11:17:43 +01:00
Paul Spooren
4b3b7e41e4
docs(util): fix docstring warnings
...
Signed-off-by: Paul Spooren <mail@aparcar.org >
2024-11-08 11:17:43 +01:00
Paul Spooren
325fb915f0
docs(result): add docstring and examples
...
Signed-off-by: Paul Spooren <mail@aparcar.org >
2024-11-08 11:17:43 +01:00
Paul Spooren
43cb0c09c5
docs(length_prefix_encoding): fix docstring warnings
...
Signed-off-by: Paul Spooren <mail@aparcar.org >
2024-11-08 11:17:43 +01:00
Paul Spooren
0836a2eb28
docs(zerocopy): fix docstring warnings
...
Signed-off-by: Paul Spooren <mail@aparcar.org >
2024-11-08 11:17:43 +01:00
Paul Spooren
ca7df013d5
docs(option): fix docstring warnings
...
Signed-off-by: Paul Spooren <mail@aparcar.org >
2024-11-08 11:17:43 +01:00
Paul Spooren
1209d68718
docs(zeroize): fix docstring warnings
...
Signed-off-by: Paul Spooren <mail@aparcar.org >
2024-11-08 11:17:43 +01:00
Paul Spooren
8806494899
docs(mio): fix docstring warnings
...
Signed-off-by: Paul Spooren <mail@aparcar.org >
2024-11-08 11:17:43 +01:00
Karolin Varner
6aea3c0c1f
chore: Documentation and unit tests for rosenpass_util::io
2024-10-24 14:01:20 +02:00
Karolin Varner
e4fdfcae08
chore: Documentation and unit tests for rosenpass_util::functional
2024-10-24 14:01:20 +02:00
Karolin Varner
48e629fff7
feat: sideffect/mutating should take FnMut over Fn
2024-10-24 14:01:20 +02:00
Karolin Varner
6321bb36fc
chore: Formatting
2024-10-24 14:01:20 +02:00
Karolin Varner
2f9ff487ba
chore: Unused import
2024-10-24 14:01:20 +02:00
Karolin Varner
c0c06cd1dc
chore: Wrong formatting for module doc
2024-10-24 14:01:20 +02:00
Karolin Varner
e9772effa6
chore: Documentation and unit tests for rosenpass_util::file
2024-10-24 14:01:20 +02:00
Karolin Varner
cf68f15674
chore: Documentation and unit tests for rosenpass_util::fd
2024-10-24 14:01:20 +02:00
Karolin Varner
dd5d45cdc9
chore: Documentation and unit tests for rosenpass_util::controlflow
2024-10-24 14:01:20 +02:00
Karolin Varner
3ae52b9824
chore: Documentation and unit tests for crate rosenpass-util::build
2024-10-13 19:22:14 +02:00
Karolin Varner
cbf361206b
chore: Documentation and unit tests for crate rosenpass-util::b64
2024-10-13 17:21:30 +02:00
Paul Spooren
d913e19883
test: add tests for controlflow
...
While at it, fix the label handling and fix a typo in continue_if, where
a `break` falsely replaced a `continue`
Signed-off-by: Paul Spooren <mail@aparcar.org >
2024-08-19 17:24:38 +02:00
Paul Spooren
1555d0897b
feat(ord): drop obsolete RTX_BUFFER_SIZE and usize_max
...
The RTX_BUFFER_SIZE function is nowhere used in the code and when
dropping it, usize_max (const version of max()) becomes obsolete, too.
Signed-off-by: Paul Spooren <mail@aparcar.org >
2024-08-19 17:24:37 +02:00
Paul Spooren
abdbf8f3da
feat(util/time): cleanup, document and add tests
...
Drop the unused `dur` function, it's nowhere found in the code.
Document both Timebase and Timebase::now()
Add tests
Signed-off-by: Paul Spooren <mail@aparcar.org >
2024-08-19 17:24:16 +02:00
Paul Spooren
9f78531979
tests: cleanup fd.rs tests
...
Trigger the internal assert of owned.rs instead of writing our own. To
correctly test it use `should_panic` macro.
Signed-off-by: Paul Spooren <mail@aparcar.org >
2024-08-19 17:24:16 +02:00
Karolin Varner
77760d71df
feat(API): Use mio::Token based polling
...
Avoid polling every single IO source to collect events,
poll those specific IO sources mio tells us about.
2024-08-19 00:31:01 +02:00
Karolin Varner
53e560191f
feat(API): Close API connections after error
2024-08-19 00:31:01 +02:00
Karolin Varner
594f894206
feat(API): AddPskBroker endpoint
2024-08-17 15:30:10 +02:00
Karolin Varner
a831e01a5c
chore: Utilities to check for unix domain stream sockets
2024-08-17 15:30:10 +02:00
Karolin Varner
24eebe29a1
feat(API): AddListenSocket endpoint
2024-08-16 14:37:42 +02:00
Karolin Varner
edf1e774c1
feat(API): SupplyKeypair endpoint
2024-08-16 11:13:34 +02:00
Karolin Varner
7a31b57227
chore(API): Infrastructure to use endpoints with fd. passing
2024-08-16 08:39:27 +02:00
Karolin Varner
48f7ff93e3
chore(API, AppServer): Deal with CryptoServer being uninit.
...
Before this, we would just raise an error.
2024-08-16 08:34:07 +02:00
Karolin Varner
7b3b7612cf
chore(api): API should have access to AppServer
...
The borrow checker does not approve, hence there are many shenanigans
with extension traits.
2024-08-16 08:34:07 +02:00
Karolin Varner
08653c3338
chore: clippy
2024-08-16 00:35:46 +02:00
Paul Spooren
1853e0a3c0
feat: add test case and check fd value
...
Signed-off-by: Paul Spooren <mail@aparcar.org >
2024-08-12 11:37:15 +02:00
Benjamin Lipp
245d4d1a0f
feat: add tests for util file.rs
...
Co-authored-by: Paul Spooren <mail@aparcar.org >
2024-08-12 11:37:15 +02:00
Katherine Watson
9fd3df67ed
chore: Fix typos and add various comments
2024-08-07 23:11:13 -07:00
Karolin Varner
6d47169a5c
feat: Set CLOEXEC flag on claimed fds and mask them
...
Masking the file descriptors (by replaying them with a file descriptor pointing towards /dev/null)
mitigates use after free (on file descriptor) attacks. In case some
piece of code still holds a reference to the file descriptor, that
file descriptor now merely holds a reference to /dev/null.
Otherwise, the file descriptor might be reused and the reference
could now mistakenly point to all sorts of – potentially more harmful – files, such as memfd_secret
file descriptors, storing our secret keys.
2024-08-05 16:16:09 +02:00
Karolin Varner
730a03957a
feat: A variety of utilities in preparation for implementing the API
2024-08-03 16:50:21 +02:00
Karolin Varner
ea071f5363
feat: Convenience functions and traits to automatically handle ErrorKind::{Interrupt, WouldBlock}
2024-08-03 16:49:02 +02:00
Karolin Varner
3063d3e4c2
feat: Convenience traits to get the ErrorKind of an io error for match clauses
2024-08-03 16:48:25 +02:00
Karolin Varner
1bf0eed90a
feat: Convenience function to just call a function
2024-08-03 16:46:48 +02:00
Karolin Varner
54ac5eecdb
chore: Warnings & clippy hints
2024-08-03 14:13:03 +02:00