diff --git a/crates/core/src/bc/xml.rs b/crates/core/src/bc/xml.rs index c5db821..f01ce1d 100644 --- a/crates/core/src/bc/xml.rs +++ b/crates/core/src/bc/xml.rs @@ -318,7 +318,7 @@ pub struct Extension { pub check_pos: Option, /// Encrypted binary has this to verify successful decryption #[serde(rename = "checkValue", skip_serializing_if = "Option::is_none")] - pub check_value: Option, + pub check_value: Option, /// Used in newer encrypted payload packets #[serde(rename = "encryptLen", skip_serializing_if = "Option::is_none")] pub encrypt_len: Option, @@ -1737,3 +1737,49 @@ fn test_binary_deser() { _ => panic!(), } } + +#[test] +fn test_enc3_extension() { + let _ = env_logger::builder().is_test(true).try_init(); + let sample = indoc!( + r#" + + 1024 + 1 + 0 + 1667510320 + + "# + ); + let b = Extension::try_parse(sample.as_bytes()).unwrap(); + match b { + Extension { + encrypt_len: Some(1024), + binary_data: Some(1), + check_pos: Some(0), + check_value: Some(1667510320), + .. + } => {} + _ => panic!(), + } + + let sample = indoc!( + r#" + + + 0 + -1211658 + + "# + ); + let b = Extension::try_parse(sample.as_bytes()).unwrap(); + match b { + Extension { + encrypt_len: Some(1024), + check_pos: Some(0), + check_value: Some(-1211658), + .. + } => {} + _ => panic!(), + } +}