From 6c600ae4b0e9b4fc1be270a162ce7145451996ba Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sat, 13 May 2023 22:31:46 +0800 Subject: [PATCH] feat: update dependencies --- Cargo.lock | 107 ++++++------------------------------------------- Cargo.toml | 6 +-- src/pkiutil.rs | 5 +-- 3 files changed, 17 insertions(+), 101 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 70caaa0..e8f7f60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -187,6 +187,12 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + [[package]] name = "base64ct" version = "1.6.0" @@ -464,16 +470,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - [[package]] name = "const-oid" version = "0.9.2" @@ -618,50 +614,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "cxx" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote 1.0.27", - "scratch", - "syn 2.0.15", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" -dependencies = [ - "proc-macro2", - "quote 1.0.27", - "syn 2.0.15", -] - [[package]] name = "data-encoding" version = "2.3.3" @@ -1146,12 +1098,11 @@ dependencies = [ [[package]] name = "iana-time-zone-haiku" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "cxx", - "cxx-build", + "cc", ] [[package]] @@ -1364,15 +1315,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "link-cplusplus" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" -dependencies = [ - "cc", -] - [[package]] name = "linux-raw-sys" version = "0.3.7" @@ -1842,11 +1784,12 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "pem" -version = "1.1.1" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +checksum = "6b13fe415cdf3c8e44518e18a7c95a13431d9bdf6d15367d82b23c377fdd441a" dependencies = [ - "base64 0.13.1", + "base64 0.21.0", + "serde", ] [[package]] @@ -2281,12 +2224,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" -[[package]] -name = "scratch" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" - [[package]] name = "sec1" version = "0.3.0" @@ -2666,15 +2603,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", -] - [[package]] name = "textwrap" version = "0.11.0" @@ -3153,15 +3081,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi 0.3.9", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" diff --git a/Cargo.toml b/Cargo.toml index 444a61b..0f8f14e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,14 +25,14 @@ chrono = "0.4" simpledateformat = "0.1" ring = "0.16" openssl = "0.10" -pem = "1.1" +pem = "2.0" yubikey = { version = "0.7", features = ["untested"] } yubico_manager = "0.9" x509 = "0.2" x509-parser = "0.13" ssh-agent = { version = "0.2", features = ["agent"] } -p256 = { version = "0.13.0", features = ["pem", "ecdh"] } -spki = { version = "0.7.0", features = ["pem"] } +p256 = { version = "0.13", features = ["pem", "ecdh"] } +spki = { version = "0.7", features = ["pem"] } #lazy_static = "1.4.0" #ssh-key = "0.4.0" #ctap-hid-fido2 = "2.1.3" diff --git a/src/pkiutil.rs b/src/pkiutil.rs index 2dc9aed..9785f5f 100644 --- a/src/pkiutil.rs +++ b/src/pkiutil.rs @@ -38,10 +38,7 @@ pub fn get_pki_algorithm(algorithm_identifier: &AlgorithmIdentifier) -> XResult< } pub fn bytes_to_pem(tag: &str, contents: T) -> String where T: Into> { - let cert_public_key_pem_obj = Pem { - tag: tag.to_string(), - contents: contents.into(), - }; + let cert_public_key_pem_obj = Pem::new(tag, contents); pem::encode(&cert_public_key_pem_obj).trim().to_string() }