Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cbor-smol to v0.5.0 #547

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ version = "1.7.2"
memory-regions = { path = "components/memory-regions" }

# forked
admin-app = { git = "https://github.com/Nitrokey/admin-app.git", tag = "v0.1.0-nitrokey.16" }
fido-authenticator = { git = "https://github.com/Nitrokey/fido-authenticator.git", tag = "v0.1.1-nitrokey.21" }
trussed = { git = "https://github.com/nitrokey/trussed.git", tag = "v0.1.0-nitrokey.21" }
admin-app = { git = "https://github.com/Nitrokey/admin-app.git", tag = "v0.1.0-nitrokey.17" }
fido-authenticator = { git = "https://github.com/Nitrokey/fido-authenticator.git", tag = "v0.1.1-nitrokey.22" }
trussed = { git = "https://github.com/nitrokey/trussed.git", tag = "v0.1.0-nitrokey.22" }

# unreleased upstream changes
cbor-smol = { git = "https://github.com/trussed-dev/cbor-smol.git", rev = "4a368461e06e3ca52d79638b9ab8f34b038491fc" }
ctaphid-dispatch = { git = "https://github.com/Nitrokey/ctaphid-dispatch.git", tag = "v0.1.1-nitrokey.3" }
littlefs2 = { git = "https://github.com/trussed-dev/littlefs2.git", rev = "960e57d9fc0d209308c8e15dc26252bbe1ff6ba8" }
littlefs2-sys = { git = "https://github.com/trussed-dev/littlefs2-sys.git", rev = "39626c0dbc2f6c38b74889a5bf9d5a200614f121" }
Expand All @@ -32,9 +31,9 @@ p256-cortex-m4 = { git = "https://github.com/ycrypto/p256-cortex-m4.git", rev =

# unreleased crates
# secrets-app = { git = "https://github.com/Nitrokey/trussed-secrets-app", tag = "v0.13.0" }
secrets-app = { git = "https://github.com/Nitrokey/trussed-secrets-app", rev = "690e9d1ffb84ed8a1b74db1370eaecc31a6f6560" }
secrets-app = { git = "https://github.com/Nitrokey/trussed-secrets-app", rev = "afbf6b8a2f92b5693bfee483dade2608c633b51c" }
# webcrypt = { git = "https://github.com/nitrokey/nitrokey-websmartcard-rust", tag = "v0.8.0-rc9" }
webcrypt = { git = "https://github.com/nitrokey/nitrokey-websmartcard-rust", rev = "447d172f36a66fe9eee50015cc46bfdfdfa51442" }
webcrypt = { git = "https://github.com/nitrokey/nitrokey-websmartcard-rust", rev = "2ceed58651387ee468c791bcca3f2ee2d2470a2d" }
# opcard = { git = "https://github.com/Nitrokey/opcard-rs", tag = "v1.5.0" }
opcard = { git = "https://github.com/Nitrokey/opcard-rs", rev = "79e22c3f379c312a4b1bbe24e6b2da847219b367" }
# piv-authenticator = { git = "https://github.com/Nitrokey/piv-authenticator.git", tag = "v0.3.7" }
Expand All @@ -50,7 +49,8 @@ trussed-hkdf = { git = "https://github.com/trussed-dev/trussed-staging.git", tag
trussed-rsa-alloc = { git = "https://github.com/trussed-dev/trussed-rsa-backend.git", tag = "v0.2.1" }
trussed-usbip = { git = "https://github.com/Nitrokey/pc-usbip-runner.git", tag = "v0.0.1-nitrokey.5" }
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", tag = "v0.3.6" }
# trussed-se050-backend = { git = "https://github.com/Nitrokey/trussed-se050-backend.git", tag = "v0.3.6" }
trussed-se050-backend = { git = "https://github.com/Nitrokey/trussed-se050-backend.git", rev = "09e3f601976224f1fd3487b8e1f72e205c2093c3" }

[profile.release]
codegen-units = 1
Expand Down
2 changes: 1 addition & 1 deletion components/apps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ piv-authenticator = { version = "0.3.8", features = ["apdu-dispatch", "delog", "
provisioner-app = { path = "../provisioner-app", optional = true }

[dev-dependencies]
cbor-smol = "0.4"
cbor-smol = "0.5"
hex = "0.4"

[features]
Expand Down
7 changes: 4 additions & 3 deletions components/apps/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ mod tests {
#[cfg(feature = "piv-authenticator")]
use super::PivConfig;
use super::{Config, FidoConfig, OpcardConfig};
use cbor_smol::cbor_serialize_bytes;
use cbor_smol::cbor_serialize;

#[test]
fn test_config_size() {
Expand All @@ -1201,10 +1201,11 @@ mod tests {
piv: PivConfig { disabled: true },
fs_version: 1,
};
let data: heapless_bytes::Bytes<1024> = cbor_serialize_bytes(&config).unwrap();
let mut buffer = [0; 1024];
let data = cbor_serialize(&config, &mut buffer).unwrap();
// littlefs2 is most efficient with files < 1/4 of the block size. The block sizes are 512
// bytes for LPC55 and 256 bytes for NRF52. As the block count is only problematic on the
// LPC55, this could be increased to 128 if necessary.
assert!(data.len() < 64, "{}: {}", data.len(), hex::encode(&data));
assert!(data.len() < 64, "{}: {}", data.len(), hex::encode(data));
}
}