diff --git a/Cargo.lock b/Cargo.lock index 6e8ae93..2656f38 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -190,19 +190,20 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bincode" -version = "2.0.0-rc.3" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11ea1a0346b94ef188834a65c068a03aec181c94896d481d7a0a40d85b0ce95" +checksum = "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740" dependencies = [ "bincode_derive", "serde", + "unty", ] [[package]] name = "bincode_derive" -version = "2.0.0-rc.3" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e30759b3b99a1b802a7a3aa21c85c3ded5c28e1c83170d82d70f08bbf7f3e4c" +checksum = "bf95709a440f45e986983918d0e8a1f30a9b1df04918fc828670606804ac3c09" dependencies = [ "virtue", ] @@ -1952,6 +1953,12 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" +[[package]] +name = "unty" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae" + [[package]] name = "url" version = "2.5.2" @@ -2023,9 +2030,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "virtue" -version = "0.0.13" +version = "0.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dcc60c0624df774c82a0ef104151231d37da4962957d691c011c852b2473314" +checksum = "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1" [[package]] name = "want" diff --git a/Cargo.toml b/Cargo.toml index bcb31c9..c3c49ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ license = "Apache-2.0" [workspace.dependencies] akd = { version = "0.11", default-features = false } -bincode = "2.0.0-rc.3" +bincode = "2" anyhow = "1.0" clap = { version = "4.5", features = ["derive"] } clap-verbosity-flag = "2.2.0" diff --git a/plexi_core/src/lib.rs b/plexi_core/src/lib.rs index fc9e1f7..e71aea0 100644 --- a/plexi_core/src/lib.rs +++ b/plexi_core/src/lib.rs @@ -105,8 +105,8 @@ impl Encode for Ciphersuite { } #[cfg(feature = "bincode")] -impl Decode for Ciphersuite { - fn decode( +impl Decode for Ciphersuite { + fn decode>( decoder: &mut D, ) -> Result { let value: u32 = bincode::Decode::decode(decoder)?; @@ -115,8 +115,8 @@ impl Decode for Ciphersuite { } #[cfg(feature = "bincode")] -impl<'de> BorrowDecode<'de> for Ciphersuite { - fn borrow_decode>( +impl<'de, Context> BorrowDecode<'de, Context> for Ciphersuite { + fn borrow_decode>( buffer: &mut B, ) -> Result { let value = u32::borrow_decode(buffer)?; @@ -485,8 +485,11 @@ impl SignatureResponse { pub fn verify(&self, verifying_key: &[u8]) -> anyhow::Result<()> { // at the time of writing, all versions use ed25519 keys. This simplifies parsing of the verifying key. match self.version { - #[cfg(feature = "bincode")] - Ciphersuite::BincodeEd25519 => (), + Ciphersuite::BincodeEd25519 => { + if !cfg!(feature = "bincode") { + return Err(anyhow!("Verification is not supported for bincode.")); + } + } Ciphersuite::ProtobufEd25519 => (), Ciphersuite::Unknown(_) => { return Err(anyhow!(