Commit Graph

123 Commits

Author SHA1 Message Date
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
kaczmarczyck
78b7767682 CBOR maps use Vec instead of BTreeMap (#303)
* CBOR uses Vec for map internally

* remove BTreeMap from get_info

* rename cbor_map_btree and clean up cbor_array_vec

* destructure now takes Vec, not BTreeMap

* adds dedup in CBOR writer

* fail to write CBOR maps with duplicates

* CBOR interface refinements

* macro documentation for CBOR map and array
2021-04-13 14:46:28 +02:00
Julien Cretin
6cb6538db6 Fix typography 2021-03-15 12:10:13 +01:00
Julien Cretin
3c7c5a4810 Update the documentation to use linking by name
See https://doc.rust-lang.org/stable/rustdoc/linking-to-items-by-name.html
2021-03-13 13:16:57 +01:00
kaczmarczyck
eb0a0770dd adds the PIN protocol trait (#292)
* adds the PIN protocol trait

* improved documentation

* SharedSecret not mutable
2021-03-10 13:20:29 +01:00
kaczmarczyck
5e9c32dff5 HKDF for CTAP2.1 (#290)
* implements hkdf, both regular and FIDO specific

* improved documentation

* constant usage in function return type
2021-03-03 16:33:25 +01:00
Fabian Kaczmarczyck
9270afbc21 remove derive_debug feature 2021-02-02 06:45:04 +01:00
Fabian Kaczmarczyck
371e8b6f35 remove conditional trait implementation 2021-02-02 05:46:03 +01:00
kaczmarczyck
18f391d48f Merge branch 'develop' into large-blobs 2021-01-25 19:27:45 +01:00
Fabian Kaczmarczyck
4f3c773b15 formats code, clippy 2021-01-25 18:17:14 +01:00
Julien Cretin
ae0156d287 Factor test tools between store and fragment
Those need the driver to deal with the fact that the store is stateful. Those
tests can't be moved to the test suite because they use private functions.
2021-01-25 17:30:50 +01:00
Julien Cretin
41a3f512c8 Remove useless check 2021-01-25 11:31:42 +01:00
Julien Cretin
f0c51950cb Add fragmentation support 2021-01-23 21:27:59 +01:00
Julien Cretin
8634e2ec24 Make StoreUpdate generic over the byte slice ownership
This permits to call it without having to create a Vec<u8> when possible.
2021-01-20 15:56:06 +01:00
Julien Cretin
a712d1476b Return error instead of debug assert
With dirty storage we hit the assert. Returning an error permits to continue to
catch if the invariant is broken for normal operation while being able to
continue fuzzing with dirty storage.
2021-01-18 16:41:03 +01:00
Julien Cretin
55038cc084 Add bound-test in addition to equality-test 2021-01-18 16:13:01 +01:00
Julien Cretin
2cd760bad7 Merge branch 'develop' into v2_optim 2021-01-18 16:10:08 +01:00
Fabian Kaczmarczyck
2776bd9b8e new CoseKey data format 2021-01-12 15:11:20 +01:00
Fabian Kaczmarczyck
6f9f833c0b moves COSE related conversion from crypto to data_formats 2021-01-08 15:42:35 +01:00
Julien Cretin
1d576fdd31 Add unit-test for Store::entries 2020-12-14 21:06:12 +01:00
Julien Cretin
edcc206e9d Make store operations constant wrt flash operations 2020-12-10 18:41:32 +01:00
Julien Cretin
8800c3e906 Merge branch 'master' into no_ram_storage 2020-12-10 15:48:45 +01:00
Julien Cretin
19ebacec15 Do not use delay_map anymore
This permits to avoid copies. Before we used to do one copy per storage
operation. Now we do one copy per store operation.
2020-12-10 13:36:33 +01:00
Julien Cretin
4253854cf1 Remove ram_storage feature
We don't need to build a production key without persistent storage. Tests and
fuzzing continue to use the std feature to use the RAM implementation (that does
sanity checks).
2020-12-10 13:06:05 +01:00
Julien Cretin
a0e3048f82 Add debug helper for fuzzing 2020-11-30 11:30:49 +01:00
Julien Cretin
f548a35f01 Do not crash with dirty init 2020-11-30 10:29:18 +01:00
Julien Cretin
ed5a9e5b24 Apply review comments 2020-11-28 19:01:16 +01:00
Julien Cretin
9f04408433 Merge branch 'master' into v2_fuzz 2020-11-28 18:45:41 +01:00