xous-core/apps/vault/libraries/crypto/Cargo.toml

46 lines
1.2 KiB
TOML
Raw Permalink Normal View History

mulling this pile of OpenSK code to see what we should cut, what we should keep alright. the composite device problem is solved. The bigger issue I'm mulling is if I should try to port the Google OpenSK FIDO2 stack into Xous, or if I should just do a limited U2F implementation. Poking around at the OpenSK stuff...porting looks possible, but, it's going to be vendoring in all of the source from the OpenSK project. So it'll be tough to apply patches if they happen; on the other hand, the OpenSK implementation is FIDO2 certified, and the stable branch hasn't moved since Nov 2021. The main downsides of the OpenSK implementation are: - it uses nightly. I think it can be stripped out, though; I haven't seen a "good reason" for it yet, it's mostly because Tock uses nightly. There's only one alarming use of it and it's in the crypto crates but those will be stripped out because.... - the crypto libraries are in fact not suitable for use. I dug into them and they definitely need to be gutted and replaced with the community-blessed crypto libraries and APIs. which is one big reason why once this goes into Xous land it doesn't go back easily into OpenSK land -- they actually have slightly different crypto APIs. more modern ones, to be fair, but, they haven't been reviewed. - the implementation has "too many features"...for example, I don't think we'll ever realistically do authenticator attestation as it requires signing NDAs and provisioning secret keys that we can't share with users. But that code is there, and we'll either have to gut or bodge it. The plusses are: - it's FIDO2 certified. So, at least the protocol stack is probably complete and fully implemented, which means for features we don't use today I can just leave hooks or dummy values there for a fast migration path. - Looks like they aren't changing things too fast in the dev branch...so this probably is not like riding a greased pig - Looks like a couple of paid professionals wrote the code...better than what we have going on here - I think I see a path to carve out their "persistent store" and glom it into the PDDB; a path to adapt their crypto traits into Xous-native traits; and a path to connect their CTAP protocol engine to the Xous HID server. So it seems feasible. But they baked in some bad API assumptions deeply enough that they are one-way streets I think to get these ports done. I'm going to sleep on this, but I'm leaning toward trying to pull in the OpenSK code because even tho it is a bit painful it probably gets a bigger feature scope and so far it looks like I wouldn't be changing any protocol-level stuff for the port, I would just be monkeying around with the internal storage, crypto, and USB implementations, so ideally the end result is we get a certified FIDO2 protocol engine for the effort. I think the main concern I have going in this direction is I don't see a way to do this and simultaneously be able to absorb upstream patches into this vendored code, because their API assumptions are too different. Any bug fixes or patches would have to be manually applied and merged. But maybe that's not such a big deal...?
2022-05-26 19:01:39 +00:00
[package]
2022-05-28 10:19:52 +00:00
name = "ctap-crypto"
mulling this pile of OpenSK code to see what we should cut, what we should keep alright. the composite device problem is solved. The bigger issue I'm mulling is if I should try to port the Google OpenSK FIDO2 stack into Xous, or if I should just do a limited U2F implementation. Poking around at the OpenSK stuff...porting looks possible, but, it's going to be vendoring in all of the source from the OpenSK project. So it'll be tough to apply patches if they happen; on the other hand, the OpenSK implementation is FIDO2 certified, and the stable branch hasn't moved since Nov 2021. The main downsides of the OpenSK implementation are: - it uses nightly. I think it can be stripped out, though; I haven't seen a "good reason" for it yet, it's mostly because Tock uses nightly. There's only one alarming use of it and it's in the crypto crates but those will be stripped out because.... - the crypto libraries are in fact not suitable for use. I dug into them and they definitely need to be gutted and replaced with the community-blessed crypto libraries and APIs. which is one big reason why once this goes into Xous land it doesn't go back easily into OpenSK land -- they actually have slightly different crypto APIs. more modern ones, to be fair, but, they haven't been reviewed. - the implementation has "too many features"...for example, I don't think we'll ever realistically do authenticator attestation as it requires signing NDAs and provisioning secret keys that we can't share with users. But that code is there, and we'll either have to gut or bodge it. The plusses are: - it's FIDO2 certified. So, at least the protocol stack is probably complete and fully implemented, which means for features we don't use today I can just leave hooks or dummy values there for a fast migration path. - Looks like they aren't changing things too fast in the dev branch...so this probably is not like riding a greased pig - Looks like a couple of paid professionals wrote the code...better than what we have going on here - I think I see a path to carve out their "persistent store" and glom it into the PDDB; a path to adapt their crypto traits into Xous-native traits; and a path to connect their CTAP protocol engine to the Xous HID server. So it seems feasible. But they baked in some bad API assumptions deeply enough that they are one-way streets I think to get these ports done. I'm going to sleep on this, but I'm leaning toward trying to pull in the OpenSK code because even tho it is a bit painful it probably gets a bigger feature scope and so far it looks like I wouldn't be changing any protocol-level stuff for the port, I would just be monkeying around with the internal storage, crypto, and USB implementations, so ideally the end result is we get a certified FIDO2 protocol engine for the effort. I think the main concern I have going in this direction is I don't see a way to do this and simultaneously be able to absorb upstream patches into this vendored code, because their API assumptions are too different. Any bug fixes or patches would have to be manually applied and merged. But maybe that's not such a big deal...?
2022-05-26 19:01:39 +00:00
version = "0.1.0"
authors = [
"Fabian Kaczmarczyck <kaczmarczyck@google.com>",
"Guillaume Endignoux <guillaumee@google.com>",
"Jean-Michel Picod <jmichel@google.com>",
]
license = "Apache-2.0"
edition = "2018"
[dependencies]
cbor = { path = "../cbor" }
arrayref = "0.3.6"
subtle = { version = "2.2.3", default-features = false }
trng = { path = "../../../../services/trng" }
2026-01-29 11:12:00 +00:00
xous-names = { package = "xous-api-names", version = "0.9.71" }
rand_core = "0.6.3"
p256 = { version = "0.11.1", default-features = false, features = [
"ecdsa",
"ecdh",
"std",
] }
cbc = "0.1.2"
aes = { path = "../../../../services/aes" }
2024-01-31 17:42:18 +00:00
sha2 = { version = "0.10.8" }
2022-05-31 19:11:26 +00:00
log = "0.4.14" # xous debugging
2022-05-31 19:11:26 +00:00
[target.'cfg(any(windows,unix))'.dependencies]
rand = "0.8.5"
rand_chacha = "0.3.1"
cbor = { path = "../cbor" }
regex = { version = "1" }
untrusted = { version = "0.7.0" }
hex = { version = "0.3.2", default-features = false } # do not update this, it's required to be at this version for tests to work.
2022-05-31 19:11:26 +00:00
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0" }
# ring = { version = "0.16.11" }
2022-05-31 20:14:57 +00:00
byteorder = { version = "1", default-features = false }
rfc6979 = "0.2.0"
[features]
with_ctap1 = []
2024-08-18 18:39:21 +00:00
derive_debug = []