diff --git a/tools/tlv_tool/Cargo.toml b/tools/tlv_tool/Cargo.toml index 2aaabe8..f8c1e23 100644 --- a/tools/tlv_tool/Cargo.toml +++ b/tools/tlv_tool/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -matter-iot= { path = "../../matter" } +matter-iot = { path = "../../matter" } log = {version = "0.4.14", features = ["max_level_trace", "release_max_level_warn"]} simple_logger = "1.16.0" clap = "2.34" diff --git a/tools/tlv_tool/src/main.rs b/tools/tlv_tool/src/main.rs index 821e0d0..cc08cb4 100644 --- a/tools/tlv_tool/src/main.rs +++ b/tools/tlv_tool/src/main.rs @@ -15,13 +15,12 @@ * limitations under the License. */ -extern crate clap; use clap::{App, Arg}; use matter::cert; use matter::tlv; +use matter::utils::epoch::sys_utc_calendar; use simple_logger::SimpleLogger; use std::process; -use std::u8; fn main() { SimpleLogger::new() @@ -96,7 +95,7 @@ fn main() { } else if m.is_present("as-asn1") { let mut asn1_cert = [0_u8; 1024]; let cert = cert::Cert::new(&tlv_list[..index]).unwrap(); - let len = cert.as_asn1(&mut asn1_cert).unwrap(); + let len = cert.as_asn1(&mut asn1_cert, sys_utc_calendar).unwrap(); println!("{:02x?}", &asn1_cert[..len]); } else { tlv::print_tlv_list(&tlv_list[..index]);