Commit Graph

139 Commits

Author SHA1 Message Date
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
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