Egor Duda
cc1fb2543e
Accommodate Store requirements for max_word_writes and max_page_erases
2022-06-07 17:04:18 +03:00
Egor Duda
0158cc846d
Use 0xff for consistency
2022-06-07 15:58:08 +03:00
Egor Duda
2708074949
Improve variable names and comments readability
2022-06-06 15:08:42 +03:00
Egor Duda
660b6b76b2
Make FileOptions available to library's users
2022-06-06 15:06:29 +03:00
Egor Duda
4e47968233
Separate options type for FileStorage, remove hardcoded constants
2022-06-05 22:40:59 +03:00
Egor Duda
c0299c3225
No need for specific feature, use std instead
2022-06-05 22:40:32 +03:00
Egor Duda
f2cb2f72e7
Use StorageError::CustomError for implementations-specific (I/O) errors
2022-06-05 22:39:13 +03:00
Egor Duda
1cf7373bfe
With new Storage API there's no need to double-buffer file data
...
read_slice(...) can return Cow::Owned buffer to the caller
2022-06-05 15:16:49 +03:00
Egor Duda
db26f6125b
Implement file-backed persistent storage
...
This allows running ctap2 authenticator application on non-embedded host OS
to implement virtual FIDO2 authenticator for QEMU
2022-06-05 15:08:52 +03:00
Julien Cretin
0f368f0b48
Add justification for Cow usage
2022-06-03 17:03:06 +02:00
Julien Cretin
f57126634b
Allow read_slice to return a Vec
2022-06-03 11:16:43 +02:00
Julien Cretin
5685e95b79
Remove useless dependency after rng256 was split out
2022-05-19 15:20:39 +02:00
kaczmarczyck
8979af6ca4
adds Eq to PartialEq ( #477 )
2022-05-05 15:50:28 +02:00
kaczmarczyck
4782d7e186
Separate RNG library ( #470 )
...
* seperates the RNG library
* fixes crypto tests
* adds rng256 workflow
* fixes formatting
2022-04-28 11:36:43 +02:00
Howard Yang
17ecd46b04
Generate valid structure for MakeCredential params
...
* Add crate arbitrary as ctap's optional dependency, when feature "fuzz"
is activated.
* Derive Arbitrary for all the necessary types in order to generate the
concrete types from random bytes.
* Add a fuzz target that transforms the input to valid format for
MakeCredential.
2022-03-22 19:06:20 +08:00
kaczmarczyck
7e7d5e38a1
enforces Module imports granularity ( #445 )
2022-03-14 20:44:48 +01:00
Julien Cretin
dc00b94ee8
Remove steal_storage
2022-03-07 19:43:58 +01:00
Julien Cretin
8a2e99960f
Reduce maximum fuzz input size
...
The fuzzer timed out (60s) on a 17k input. On my machine it runs for 12s and 7s
after truncation to 10k.
2022-02-28 12:39:08 +01:00
Julien Cretin
d47ca7fa54
Add documentation
2022-01-26 11:05:02 +01:00
Julien Cretin
b59df7001f
Remove the software-specific Decrypt16BytesBlock and Encrypt16BytesBlock traits
...
They assume blocks are encrypted/decrypted one at a time. To avoid one syscall
per block, it is preferable to encrypt/decrypt the data at once.
Change-Id: I795c8f5b7901a1b55fa3b06fa45fe57ab19d06ea
2022-01-26 11:05:02 +01:00
kaczmarczyck
98c9191679
HMAC: only 32 byte keys ( #424 )
...
* only support HMAC with 32 byte keys
* includes HMAC in the trait to be generic
* re-added HAMC test
2022-01-18 13:14:11 +01:00
Julien Cretin
ce08f82d68
Restrict Sha256 to be used sequentially
...
Also remove useless HashBlockSize64Bytes bound.
2022-01-17 15:36:51 +01:00
kaczmarczyck
522e6079e3
Forward desktop test fixes ( #419 )
...
* fixes clippy warnings for compilers until 2021-11-25
* fixes run_desktop_tests
* removes page_size
2021-11-30 11:07:17 +01:00
Julien Cretin
d085d54878
Update test
2021-10-04 12:24:15 +02:00
Julien Cretin
af3bee64a5
Introduce window size to fix hidden entries
2021-10-04 12:24:15 +02:00
Julien Cretin
9dc5286633
Revert "Continue compacting until content fits window during compaction"
...
This reverts commit 67fa8bee0b .
2021-10-04 12:24:15 +02:00
Julien Cretin
daa16d948f
Add test
2021-10-04 12:24:15 +02:00
Julien Cretin
67fa8bee0b
Continue compacting until content fits window during compaction
...
Also increase the virtual window size.
2021-09-27 13:59:29 +02:00
Julien Cretin
a3965eac2d
Also debug the model besides the storage
2021-09-27 13:59:29 +02:00
Julien Cretin
fbca34b1d1
Add test
2021-09-27 13:59:29 +02:00
kaczmarczyck
930a44c105
Fix CBOR fuzzing timeout ( #384 )
...
* early return for map and array comparison
* leaner ordering assignment
2021-09-22 10:33:08 +02:00
David Drysdale
c2b3aeca88
cbor: don't allow infinite nesting by default
...
Change the read()/write() methods to use a nesting limit of 127
internally, to avoid the possibility of heavily nested inputs exhausting
the stack.
Library users that still want to skip nesting checks can still get at
this functionality by using `{read,write}_nested(..., None)`.
2021-09-09 07:03:27 +02:00
Julien Cretin
cbbb4b3e08
Reduce the store fuzzer input length
2021-08-30 11:41:14 +02:00
Julien Cretin
ed28941a6d
Decrease maximum input size for store fuzzing
...
We currently have around 12% inputs timing out (was around 27% before the 100k
limit).
2021-08-13 22:15:50 +02:00
Julien Cretin
3d4b652e12
Increase the max data len from 10k to 100k
2021-08-05 15:08:53 +02:00
Julien Cretin
445c1c6edd
Explicitly limit the fuzzer input length
...
This is to avoid timeouts in oss-fuzz.
2021-08-05 15:08:53 +02:00
kaczmarczyck
b7a3e06cf4
ECDSA signatures and public keys in CTAP ( #358 )
...
* ECDSA signatures and public keys in CTAP
* adds one constant usage
* documents pub functions in ECDSA
* typo: involved
* extends wrong length test
2021-08-04 13:39:49 +02:00
David Drysdale
74d712da0d
cbor: add local copy of LICENSE
...
Also bump crate version to 0.1.2 in preparation for release.
2021-06-29 10:01:29 +02:00
kaczmarczyck
5f20ba544b
CBOR annotations for crates.io ( #333 )
...
* add default readme to fix crates.io
* badges in README
2021-06-25 15:14:14 +02:00
David Drysdale
0287a09573
cbor: allow user to control nesting ( #329 )
...
* cbor: allow user to control nesting
- Make the default read/write entrypoints allow infinite nesting.
- Add {read,write}_nested() entrypoints that allow the crate user to
control the depth of nesting that's allowed.
- Along the way, convert the write[_nested] variants to return a
`Result<(), EncoderError>` rather than a bool. This exposes
more failure information (and forces the caller to take notice
of those tailures), and allows use of the ? operator.
* fixup: transmute error
Co-authored-by: kaczmarczyck <43844792+kaczmarczyck@users.noreply.github.com >
2021-06-18 19:39:54 +02:00
David Drysdale
c7750a4e8c
cbor: fix spelling of 'extraneous'
2021-06-17 12:31:10 +02:00
David Drysdale
1cee2414f4
fixup: more comparisons, re-order tests slightly
2021-06-17 10:33:36 +02:00
David Drysdale
fbe68b55cd
cbor: support tagged values
2021-06-17 10:33:36 +02:00
David Drysdale
3aca5fbc74
cbor: prepare for publishing as standalone crate
...
- Add an example of usage
- Add a minimal README, including the example code
- Document public items
- Add more info to Cargo.toml
2021-06-16 17:16:05 +02:00
David Drysdale
7719078d46
cbor: rename crate to sk-cbor
...
In anticipation of publishing to crates.io, which already has a `cbor`
crate.
2021-06-16 17:16:05 +02:00
David Drysdale
f2812e4fe2
cbor: drop std feature, use core in tests ( #327 )
2021-06-16 15:40:18 +02:00
kaczmarczyck
77f6db6110
don't clone map keys ( #325 )
2021-06-15 08:46:04 +02:00
Julien Cretin
b3b652aa53
Stop using try_trait
...
It is too much instable.
2021-06-09 13:51:04 +02:00
Julien Cretin
e32eb5358f
Merge branch 'develop' into usize_32_or_std
2021-04-26 13:12:55 +02:00
kaczmarczyck
9a1c060234
Remove KeyType from CBOR ( #306 )
...
* removes KeyType from CBOR
* type_label usage in writer
2021-04-14 10:19:10 +02:00