Skip to content

Commit

Permalink
fix: Fix most issues related to dependency update, except hashbrown v…
Browse files Browse the repository at this point in the history
…ersion (#349)

* Fix most issues, except hashbrown version

* Remove CMS test prints

* Downgrade hashbrown version
  • Loading branch information
Nicceboy authored Oct 21, 2024
1 parent 4e35705 commit d1208da
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 32 deletions.
58 changes: 42 additions & 16 deletions Cargo.lock

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

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ bitvec.workspace = true
bytes = { version = "1.7.2", default-features = false }
chrono.workspace = true
either = { version = "1.13.0", default-features = false }
hashbrown = "0.15.0"
hashbrown = "0.14.5"
konst = { version = "0.3.9", default-features = false }
nom = { version = "7.1.3", default-features = false, features = ["alloc"] }
nom-bitvec = { package = "bitvec-nom2", version = "0.2.1" }
Expand All @@ -82,7 +82,9 @@ once_cell = { version = "1.20.2", default-features = false, features = [
] }
rasn-compiler = { version = "0.5.3", optional = true }
rasn-derive = { version = "0.20", path = "macros", optional = true }
snafu = { version = "0.8.5", default-features = false, features = ["rust_1_81"] }
snafu = { version = "0.8.5", default-features = false, features = [
"rust_1_81",
] }
serde_json = { version = "1", default-features = false, features = ["alloc"] }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/types/constructed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ mod tests {

assert_eq!(set_a, set_b);
assert_ne!(set_a, set_c);
let hasher = hashbrown::DefaultHashBuilder::default();
let hasher = hashbrown::hash_map::DefaultHashBuilder::default();
let hashed_a = hasher.hash_one(&set_a);
let hashed_c = hasher.hash_one(set_c);
assert_ne!(hashed_a, hashed_c);
Expand Down
14 changes: 7 additions & 7 deletions standards/cbr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ extern crate alloc;

use rasn::prelude::*;

pub const PAL_ZONE: &'static Oid = Oid::const_new(&[1, 3, 6, 1, 4, 1, 46609, 1, 2]);
pub const PAL_FREQUENCY: &'static Oid = Oid::const_new(&[1, 3, 6, 1, 4, 1, 46609, 1, 3]);
pub const CBSD_FCCID: &'static Oid = Oid::const_new(&[1, 3, 6, 1, 4, 1, 46609, 1, 4]);
pub const CBSD_SERIAL: &'static Oid = Oid::const_new(&[1, 3, 6, 1, 4, 1, 46609, 1, 5]);
pub const SAS_FRN: &'static Oid = Oid::const_new(&[1, 3, 6, 1, 4, 1, 46609, 1, 6]);
pub const CPIR: &'static Oid = Oid::const_new(&[1, 3, 6, 1, 4, 1, 46609, 1, 7]);
pub const TEST: &'static Oid = Oid::const_new(&[1, 3, 6, 1, 4, 1, 46609, 1, 8]);
pub const PAL_ZONE: &Oid = Oid::const_new(&[1, 3, 6, 1, 4, 1, 46609, 1, 2]);
pub const PAL_FREQUENCY: &Oid = Oid::const_new(&[1, 3, 6, 1, 4, 1, 46609, 1, 3]);
pub const CBSD_FCCID: &Oid = Oid::const_new(&[1, 3, 6, 1, 4, 1, 46609, 1, 4]);
pub const CBSD_SERIAL: &Oid = Oid::const_new(&[1, 3, 6, 1, 4, 1, 46609, 1, 5]);
pub const SAS_FRN: &Oid = Oid::const_new(&[1, 3, 6, 1, 4, 1, 46609, 1, 6]);
pub const CPIR: &Oid = Oid::const_new(&[1, 3, 6, 1, 4, 1, 46609, 1, 7]);
pub const TEST: &Oid = Oid::const_new(&[1, 3, 6, 1, 4, 1, 46609, 1, 8]);

#[derive(AsnType, Debug, Clone, Decode, Encode, PartialEq, Eq, Hash)]
#[rasn(delegate)]
Expand Down
3 changes: 3 additions & 0 deletions standards/cms/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ path = "../.."
[dependencies.rasn-pkix]
version = "0.20"
path = "../pkix"

[dev-dependencies]
pretty_assertions = "1.4.1"
3 changes: 1 addition & 2 deletions standards/cms/tests/test_cms.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use pretty_assertions::assert_eq;
use rasn::der::{decode, encode};

use rasn_cms::authenticode::{
Expand All @@ -15,7 +16,6 @@ fn test_cms_signed() {
let info = decode::<ContentInfo>(SIGNED_DATA).unwrap();
assert_eq!(CONTENT_SIGNED_DATA, info.content_type);
let data = decode::<SignedData>(info.content.as_bytes()).unwrap();
println!("{:#?}", data);

assert_eq!(CONTENT_DATA, data.encap_content_info.content_type);

Expand All @@ -29,7 +29,6 @@ fn test_cms_encrypted() {
let info = decode::<ContentInfo>(ENCRYPTED_DATA).unwrap();
assert_eq!(CONTENT_ENVELOPED_DATA, info.content_type);
let data = decode::<EnvelopedData>(info.content.as_bytes()).unwrap();
println!("{:#?}", data);

assert_eq!(CONTENT_DATA, data.encrypted_content_info.content_type);

Expand Down
5 changes: 3 additions & 2 deletions standards/pkix/src/est.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub struct Attribute {

#[cfg(test)]
mod tests {
use base64::prelude::{Engine as _, BASE64_STANDARD};
use pretty_assertions::assert_eq;

use alloc::{borrow::Cow, string::ToString, vec};
Expand Down Expand Up @@ -163,7 +164,7 @@ mod tests {

let data_bin = rasn::der::encode(&data).unwrap();
let txt = "MEEGCSqGSIb3DQEJBzASBgcqhkjOPQIBMQcGBSuBBAAiMBYGCSqGSIb3DQEJDjEJBgcrBgEBAQEWBggqhkjOPQQDAw==";
let bin = base64::decode(txt).unwrap();
let bin = BASE64_STANDARD.decode(txt).unwrap();
assert_eq!(data_bin, bin);
let decoded_data = rasn::der::decode::<CsrAttrs>(&bin);
assert!(decoded_data.is_ok());
Expand Down Expand Up @@ -238,7 +239,7 @@ mod tests {

let data_bin = rasn::der::encode(&data).unwrap();
let txt = "MHwGBysGAQEBARYwIgYDiDcBMRsTGVBhcnNlIFNFVCBhcyAyLjk5OS4xIGRhdGEGCSqGSIb3DQEJBzAsBgOINwIxJQYDiDcDBgOINwQTGVBhcnNlIFNFVCBhcyAyLjk5OS4yIGRhdGEGCSskAwMCCAEBCwYJYIZIAWUDBAIC";
let bin = base64::decode(txt).unwrap();
let bin = BASE64_STANDARD.decode(txt).unwrap();
assert_eq!(bin, data_bin);
let decoded_data = rasn::der::decode::<CsrAttrs>(&bin);
assert!(decoded_data.is_ok());
Expand Down
4 changes: 2 additions & 2 deletions standards/pkix/tests/digicert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use rasn_pkix::*;
fn it_works() {
let contents = pem::parse(include_bytes!("data/DigiCertAssuredIDTLSCA.crt.pem")).unwrap();

let cert: rasn_pkix::Certificate = rasn::der::decode(&contents.contents).unwrap();
let cert: rasn_pkix::Certificate = rasn::der::decode(contents.contents()).unwrap();

assert_eq!(contents.contents, rasn::der::encode(&cert).unwrap());
assert_eq!(contents.contents(), rasn::der::encode(&cert).unwrap());
}

#[test]
Expand Down

0 comments on commit d1208da

Please sign in to comment.