From 1fbec4c54b492d7390d5223ec4ab2ec78ef4c848 Mon Sep 17 00:00:00 2001 From: Kyle Kotowick Date: Sun, 27 Oct 2024 22:44:18 -0400 Subject: [PATCH] Fix feature name; use local copies for testing --- Cargo.lock | 203 ++++++++++++++++++++++++++++++++----- Cargo.toml | 11 +- components/apps/Cargo.toml | 8 +- 3 files changed, 191 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d818ae3b..d9673f72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -194,6 +194,7 @@ dependencies = [ "trussed-hkdf", "trussed-hpke", "trussed-manage", + "trussed-pqc-backend", "trussed-rsa-alloc", "trussed-se050-backend", "trussed-se050-manage", @@ -318,7 +319,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.69", + "syn 2.0.85", ] [[package]] @@ -522,6 +523,11 @@ name = "cc" version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "066fce287b1d4eafef758e89e09d724a24808a9196fe9756b8ca90e86d0719a2" +dependencies = [ + "jobserver", + "libc", + "once_cell", +] [[package]] name = "cexpr" @@ -645,7 +651,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.85", ] [[package]] @@ -787,11 +793,12 @@ dependencies = [ [[package]] name = "cosey" version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39323fe531b92e7acad90b8550b58cec63d29a6c5a56e02de4b25b6aeedbf82e" dependencies = [ + "cfg-if", "heapless-bytes", + "pqcrypto-dilithium", "serde", + "serde-big-array", "serde_repr", ] @@ -878,8 +885,6 @@ dependencies = [ [[package]] name = "ctap-types" version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1beeb5a05e42c7cbfb788ce3e9fd6ce7d0aa214893b5ca6cd38d09ac9afe722" dependencies = [ "bitflags 1.3.2", "cbor-smol", @@ -963,7 +968,7 @@ checksum = "5fe87ce4529967e0ba1dcf8450bab64d97dfd5010a6256187ffe2e43e6f0e049" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.85", ] [[package]] @@ -1006,6 +1011,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + [[package]] name = "ecdsa" version = "0.16.9" @@ -1180,7 +1191,6 @@ dependencies = [ [[package]] name = "fido-authenticator" version = "0.1.1" -source = "git+https://github.com/Nitrokey/fido-authenticator.git?tag=v0.1.1-nitrokey.23#5b6ae97b5f92962b545a1af1bf5b69fee66bca0a" dependencies = [ "apdu-app", "cbor-smol", @@ -1680,6 +1690,15 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" version = "0.3.69" @@ -2310,6 +2329,117 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "pqcrypto" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ac15ee741fa95113ea76e7b08ce966e55c7e725621119ec1a59cf88a96e94b4" +dependencies = [ + "pqcrypto-classicmceliece", + "pqcrypto-dilithium", + "pqcrypto-falcon", + "pqcrypto-hqc", + "pqcrypto-kyber", + "pqcrypto-sphincsplus", + "pqcrypto-traits", +] + +[[package]] +name = "pqcrypto-classicmceliece" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020d75adba68e21bcd1a6268a7145bff549fe7559e75a122e19f6f00bfb896d7" +dependencies = [ + "cc", + "glob", + "libc", + "pqcrypto-internals", + "pqcrypto-traits", +] + +[[package]] +name = "pqcrypto-dilithium" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685de0fa68c6786559d5fcdaa414f0cd68ef3f5d162f61823bd7424cd276726f" +dependencies = [ + "cc", + "glob", + "libc", + "pqcrypto-internals", + "pqcrypto-traits", +] + +[[package]] +name = "pqcrypto-falcon" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35d1d53b8392f416aa11943f83c0372d88090d9c236b21a7f19352e61542119d" +dependencies = [ + "cc", + "glob", + "libc", + "pqcrypto-internals", + "pqcrypto-traits", +] + +[[package]] +name = "pqcrypto-hqc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e945bdfba5a47894067969abaa04d773c8dae56d1f33efa93fc5b84636b85bf" +dependencies = [ + "cc", + "glob", + "libc", + "pqcrypto-internals", + "pqcrypto-traits", +] + +[[package]] +name = "pqcrypto-internals" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10cdd9eee50fe65bbd4f40211f1a492f1ee52e97a51100950b6f1fa319ab7cd" +dependencies = [ + "cc", + "dunce", + "getrandom", + "libc", +] + +[[package]] +name = "pqcrypto-kyber" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15c00293cf898859d0c771455388054fd69ab712263c73fdc7f287a39b1ba000" +dependencies = [ + "cc", + "glob", + "libc", + "pqcrypto-internals", + "pqcrypto-traits", +] + +[[package]] +name = "pqcrypto-sphincsplus" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82ea17a14b7623f262460f07e2773ae62b25c65e935db87581addd60cc9316c3" +dependencies = [ + "cc", + "glob", + "libc", + "pqcrypto-internals", + "pqcrypto-traits", +] + +[[package]] +name = "pqcrypto-traits" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94e851c7654eed9e68d7d27164c454961a616cf8c203d500607ef22c737b51bb" + [[package]] name = "pretty_env_logger" version = "0.5.0" @@ -2703,13 +2833,22 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.204" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" dependencies = [ "serde_derive", ] +[[package]] +name = "serde-big-array" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11fc7cc2c76d73e0f27ee52abbd64eec84d46f370c88371120433196934e4b7f" +dependencies = [ + "serde", +] + [[package]] name = "serde-byte-array" version = "0.1.2" @@ -2727,7 +2866,7 @@ checksum = "fca2da10b1f1623f47130256065e05e94fd7a98dbd26a780a4c5de831b21e5c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.85", ] [[package]] @@ -2741,13 +2880,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.85", ] [[package]] @@ -2769,7 +2908,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.85", ] [[package]] @@ -2962,7 +3101,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.69", + "syn 2.0.85", ] [[package]] @@ -2984,9 +3123,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.69" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201fcda3845c23e8212cd466bfebf0bd20694490fc0356ae8e428e0824a915a6" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -3042,7 +3181,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.85", ] [[package]] @@ -3132,7 +3271,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.85", ] [[package]] @@ -3177,7 +3316,6 @@ dependencies = [ [[package]] name = "trussed" version = "0.1.0" -source = "git+https://github.com/nitrokey/trussed.git?tag=v0.1.0-nitrokey.23#92dd7f010e61ba17895d7844ea31b8f288e308b8" dependencies = [ "aes", "bitflags 2.6.0", @@ -3202,6 +3340,7 @@ dependencies = [ "nb 1.1.0", "p256-cortex-m4", "postcard 0.7.3", + "pqcrypto-dilithium", "rand_chacha", "rand_core", "salty", @@ -3277,9 +3416,23 @@ dependencies = [ "trussed", ] +[[package]] +name = "trussed-pqc-backend" +version = "0.1.0" +dependencies = [ + "der", + "pkcs8", + "pqcrypto", + "pqcrypto-dilithium", + "serde", + "serde-big-array", + "trussed", +] + [[package]] name = "trussed-rsa-alloc" version = "0.2.1" +source = "git+https://github.com/trussed-dev/trussed-rsa-backend.git?tag=v0.2.1#655eca355df59e85a9f1d803623bc2efa10a8b5a" dependencies = [ "delog", "heapless-bytes", @@ -3404,7 +3557,7 @@ checksum = "560b82d656506509d43abe30e0ba64c56b1953ab3d4fe7ba5902747a7a3cedd5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.85", ] [[package]] @@ -3647,7 +3800,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.85", "wasm-bindgen-shared", ] @@ -3669,7 +3822,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.85", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3909,5 +4062,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.85", ] diff --git a/Cargo.toml b/Cargo.toml index af4a1f22..3e3df1b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,8 +18,8 @@ memory-regions = { path = "components/memory-regions" } # forked admin-app = { git = "https://github.com/Nitrokey/admin-app.git", tag = "v0.1.0-nitrokey.18" } -fido-authenticator = { git = "https://github.com/Nitrokey/fido-authenticator.git", tag = "v0.1.1-nitrokey.23" } -trussed = { git = "https://github.com/nitrokey/trussed.git", tag = "v0.1.0-nitrokey.23" } +#fido-authenticator = { git = "https://github.com/Nitrokey/fido-authenticator.git", tag = "v0.1.1-nitrokey.23" } +#trussed = { git = "https://github.com/nitrokey/trussed.git", tag = "v0.1.0-nitrokey.23" } # unreleased upstream changes ctaphid-dispatch = { git = "https://github.com/Nitrokey/ctaphid-dispatch.git", tag = "v0.1.1-nitrokey.3" } @@ -45,6 +45,13 @@ trussed-usbip = { git = "https://github.com/Nitrokey/pc-usbip-runner.git", tag = trussed-se050-manage = { git = "https://github.com/Nitrokey/trussed-se050-backend.git", tag = "se050-manage-v0.1.0" } trussed-se050-backend = { git = "https://github.com/Nitrokey/trussed-se050-backend.git", rev = "f4ff60b8aa0f322a424613165f66ed9112c7a94f" } +trussed-pqc-backend = { path = "../trussed-pqc-backend" } +trussed = { path = "../trussed" } +fido-authenticator = { path = "../fido-authenticator" } +ctap-types = { path = "../ctap-types" } +cosey = { path = "../cosey" } +trussed-rsa-backend = { path = "../trussed-rsa-backend" } + [profile.release] codegen-units = 1 lto = "fat" diff --git a/components/apps/Cargo.toml b/components/apps/Cargo.toml index 8c572f75..ef9530cd 100644 --- a/components/apps/Cargo.toml +++ b/components/apps/Cargo.toml @@ -81,10 +81,10 @@ backend-software-hpke = ["trussed-staging/hpke"] # If any of the PQC algorithms are selected for compilation, then the # PQC backend must be included and the corresponding algorithm features # there must be set. -backend-pqc = ["dep:trussed-pqc-backend"] -backend-dilithium2 = ["backend-pqc", "trussed-pqc-backend/dilithium2", "fido-authenticator/backend-dilithium2"] -backend-dilithium3 = ["backend-pqc", "trussed-pqc-backend/dilithium3", "fido-authenticator/backend-dilithium3"] -backend-dilithium5 = ["backend-pqc", "trussed-pqc-backend/dilithium5", "fido-authenticator/backend-dilithium5"] +backend-dilithium = ["dep:trussed-pqc-backend"] +backend-dilithium2 = ["backend-dilithium", "trussed-pqc-backend/dilithium2", "fido-authenticator/backend-dilithium2"] +backend-dilithium3 = ["backend-dilithium", "trussed-pqc-backend/dilithium3", "fido-authenticator/backend-dilithium3"] +backend-dilithium5 = ["backend-dilithium", "trussed-pqc-backend/dilithium5", "fido-authenticator/backend-dilithium5"] log-all = ["admin-app/log-all", "fido-authenticator?/log-all", "secrets-app?/log-all", "webcrypt?/log-all", "opcard?/log-all", "provisioner-app?/log-all"]