Commit Graph

1244 Commits

Author SHA1 Message Date
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
12f6ed6e0b Merge pull request #487 from ia0/read_cow
Allow read_slice to return a Vec
2022-06-03 18:31:45 +02: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
hcyang
85fe9cd29d Add sturctured get assertion and client pin fuzzers (#482) 2022-05-27 10:34:38 +08:00
Julien Cretin
4cfc5f57d4 Merge pull request #481 from ia0/ed25519
Add local and github tests for ed25519
2022-05-20 11:03:07 +02:00
Julien Cretin
67ef705eb4 Add ed25519 to local and github tests 2022-05-20 10:31:52 +02:00
Julien Cretin
926410509a Merge pull request #478 from egor-duda/ed25519
Support ed25519 crypto algorithm
2022-05-20 10:31:11 +02:00
egor-duda
9a9d68ec41 Merge branch 'develop' into ed25519 2022-05-19 22:58:02 +03:00
Julien Cretin
7b872df01e Merge pull request #480 from ia0/remove_dep
Remove useless dependency after rng256 was split out
2022-05-19 17:24:14 +02:00
Julien Cretin
5685e95b79 Remove useless dependency after rng256 was split out 2022-05-19 15:20:39 +02:00
Egor Duda
9d36da16c7 More detailed description for "ed25519" option 2022-05-19 12:00:28 +03:00
Egor Duda
5aac730f93 Delete spurious file 2022-05-19 08:50:47 +03:00
Egor Duda
1277b97018 Remove obsolete comment 2022-05-18 20:51:28 +03:00
Egor Duda
e4d3262623 Reserve version IDs to avoid accidental reuse with other options 2022-05-18 20:50:56 +03:00
Julien Cretin
6f40c9ad48 Merge pull request #479 from ia0/no_eq
Only derive PartialEq and Eq for PrivateKey for tests
2022-05-17 23:48:24 +02:00
Julien Cretin
07424c3123 Only derive PartialEq and Eq for PrivateKey for tests
We shouldn't compare private keys in prod for side-channel resilience. Ideally
we shouldn't clone too. We currently do for storage. Fixing this would probably
require to serialize the private key in the credential struct.
2022-05-17 22:59:18 +02:00
Egor Duda
25d538cde6 fix formatting 2022-05-17 23:03:22 +03:00
Egor Duda
42bfd7860d whitespace cleanup 2022-05-17 19:53:45 +03:00
Egor Duda
b9c48b480a Common setting for unsupported CredentialId version 2022-05-17 19:49:25 +03:00
Egor Duda
dc7311a3bd Shorter idiomatic expression for finding preferred crypto algorithm 2022-05-17 17:33:21 +03:00
Egor Duda
c7116b1c21 Return strict warning checking
llvm_asm! don't cause warnings in older edition of Rust
2022-05-17 17:16:01 +03:00
Egor Duda
06230d15e1 Fix compile warning 2022-05-17 17:15:47 +03:00
Egor Duda
245436f135 ed25519-compact crate does not require newer edition of Rust 2022-05-17 17:15:03 +03:00
Egor Duda
55056b721c Use ed25519-compact crate instead of ed25519-dalek
ed25519-dalek does not implement Clone and Eq for secret keys, and
relevant PR in its repository wait for merge from long time ago, leading
to potential problems with maintainability
2022-05-16 21:48:43 +03:00
Egor Duda
0ef0bb23f4 Remove unneeded code (covered by default branch) 2022-05-16 18:15:03 +03:00
Egor Duda
7f6ff31dd1 Static allocation for list of supported algorithms 2022-05-16 18:12:15 +03:00
Egor Duda
9713332eff third-party code is modified via patching 2022-05-16 18:08:11 +03:00
Egor Duda
3b8884c088 Separate test for reading ed25519 key from bad cbor 2022-05-13 22:06:10 +03:00
Egor Duda
e473af7118 Cleaner assignment syntax 2022-05-13 21:55:18 +03:00
Egor Duda
658dbe2381 Add patch to build libtock-rs with Rust 2021, needed for ed25519 support 2022-05-13 21:06:34 +03:00
Egor Duda
f24445b325 with_ed25519 -> ed25519 ("with_*" naming is discouraged) 2022-05-13 20:43:09 +03:00
Egor Duda
983bc5c5b2 Add support for ed25519 keys (#335) 2022-05-12 22:56:33 +03:00
kaczmarczyck
f95ae1f5ab Make private keys extensible (#476)
* adds PrivateKey to handle different algorithms

* fixes input check problem of decrypt_credential_source

* addresses comments

* version number not encrypted

* version number test

* adds a credential size test

* removes the algorithm from credential encoding
2022-05-10 14:31:29 +02:00
hcyang
3a39c4dff1 Add test_helpers (#474)
* Add set_enterprise_attestation in TestEnv

* Add test_helpers for Test Unification

* Used it in structured fuzzer and enterprise attestation unittests

* Restructure test_helpers

* Rename setup_enterprise_attestation to enable_
2022-05-10 18:50:18 +08:00
kaczmarczyck
8979af6ca4 adds Eq to PartialEq (#477) 2022-05-05 15:50:28 +02:00
Liam Murphy
2b541d853b Create a 2nd USB interface for the Vendor HID (#472)
* Add USB interface for Vendor HID.

This new interface is enumerated by the host, but the device transmits
all packets on the existing interface, so the device won't function
correct in this mode until this this fixed.

The changes are in tock, and so appear as a patch here. These are:
* supporting multiple HIDs in the USB configuration
* adding the HID descriptors for the new inteface
* supporting the vendor_hid feature in relevant Cargo.toml files.
NOTE: only boards/nordic/nrf52840dk_opensk has been updated.

As the changes are in tockos, deploy script needed to pass vendor_hid
feature to tockos build stage.

Demo of output:
lsusb -v -d 1915:521f | grep "NumInterfaces"
    bNumInterfaces          2

* fix some whitespace from review

* Add vendor_hid feature in all boards in this repo, not via a patch in tock.

The boards directories are copied to tockos as part of
setup-submodules.sh

* Remove nesting from HID config in create_descriptor_buffers()

* update comments about HID descriptor use.
2022-05-03 10:35:35 +02:00
hcyang
a0e11bd5aa Move remaining customizations to new file (#473) 2022-04-28 13:33:34 +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
kaczmarczyck
360efa4eaf replaces ThreadRng with env RNG (#469) 2022-04-27 15:49:45 +02:00
kaczmarczyck
397c4165ca removes unit tests for crypto library from script (#467) 2022-04-26 16:00:06 +02:00
kaczmarczyck
8dc6dab450 Enterprise attestation testing (#465)
* fix enterprise attestation check

* returns storage errors
2022-04-26 12:24:43 +02:00
hcyang
2b6424360c Move enterprise mode related customizations to new file (#463)
* Move enterprise mode related customizations to new file

* Fix cargo clippy error

* Add is_enterpris_rp_id API to avoid cloning

* Only expose enterprise_rp_id_list API in std
2022-04-25 09:45:59 +08:00
kaczmarczyck
0f47e99a08 Workflow for cargo bloat (#462)
* adds cargo bloat workflow

* uses notice instead

* warning for bigger sizes, ignore equal sizes

* DO NOT MERGE, TEST COMMIT

* reverted test commit
2022-04-21 12:48:04 +02:00