From d0bd9776e37e778f06e7e5f835bbbf5d16c5ac48 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Wed, 19 Oct 2022 18:56:52 -0700 Subject: meta: initial commit Create the initial scaffolding for a rust project, using `cargo` and a nix template. --- src/x509-info/.envrc | 1 + src/x509-info/.github/dependabot.yml | 11 +++++ src/x509-info/.github/workflows/build.yml | 73 +++++++++++++++++++++++++++++++ src/x509-info/.gitignore | 1 + src/x509-info/Cargo.toml | 8 ++++ src/x509-info/LICENSE | 20 +++++++++ src/x509-info/flake.nix | 61 ++++++++++++++++++++++++++ src/x509-info/rust-toolchain.toml | 3 ++ src/x509-info/rustfmt.toml | 1 + src/x509-info/src/main.rs | 3 ++ 10 files changed, 182 insertions(+) create mode 100644 src/x509-info/.envrc create mode 100644 src/x509-info/.github/dependabot.yml create mode 100644 src/x509-info/.github/workflows/build.yml create mode 100644 src/x509-info/.gitignore create mode 100644 src/x509-info/Cargo.toml create mode 100644 src/x509-info/LICENSE create mode 100644 src/x509-info/flake.nix create mode 100644 src/x509-info/rust-toolchain.toml create mode 100644 src/x509-info/rustfmt.toml create mode 100644 src/x509-info/src/main.rs (limited to 'src') diff --git a/src/x509-info/.envrc b/src/x509-info/.envrc new file mode 100644 index 0000000..a5dbbcb --- /dev/null +++ b/src/x509-info/.envrc @@ -0,0 +1 @@ +use flake . diff --git a/src/x509-info/.github/dependabot.yml b/src/x509-info/.github/dependabot.yml new file mode 100644 index 0000000..2b2ebcf --- /dev/null +++ b/src/x509-info/.github/dependabot.yml @@ -0,0 +1,11 @@ +version: 2 +updates: +- package-ecosystem: cargo + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/src/x509-info/.github/workflows/build.yml b/src/x509-info/.github/workflows/build.yml new file mode 100644 index 0000000..68deda2 --- /dev/null +++ b/src/x509-info/.github/workflows/build.yml @@ -0,0 +1,73 @@ +name: gh-ssh-keys CI + +on: + push: + +jobs: + check: + name: Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - uses: actions-rs/cargo@v1 + with: + command: check + - uses: actions-rs/cargo@v1 + with: + command: check + args: --no-default-features + + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - uses: actions-rs/cargo@v1 + with: + command: test + - uses: actions-rs/cargo@v1 + with: + command: test + args: --no-default-features + + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - run: rustup component add rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - run: rustup component add clippy + - uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- -D warnings diff --git a/src/x509-info/.gitignore b/src/x509-info/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/src/x509-info/.gitignore @@ -0,0 +1 @@ +/target diff --git a/src/x509-info/Cargo.toml b/src/x509-info/Cargo.toml new file mode 100644 index 0000000..0dff6ec --- /dev/null +++ b/src/x509-info/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "x509-info" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/src/x509-info/LICENSE b/src/x509-info/LICENSE new file mode 100644 index 0000000..ac375e1 --- /dev/null +++ b/src/x509-info/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2022 Franck Cuny + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/x509-info/flake.nix b/src/x509-info/flake.nix new file mode 100644 index 0000000..0dbaee0 --- /dev/null +++ b/src/x509-info/flake.nix @@ -0,0 +1,61 @@ +{ + description = "A CLI to display information about x509 certificates."; + + inputs = { + flake-utils.url = "github:numtide/flake-utils"; + nixpkgs.url = "github:NixOS/nixpkgs"; + rust-overlay.url = "github:oxalica/rust-overlay"; + naersk.url = "github:nmattia/naersk"; + }; + + outputs = + { self + , flake-utils + , nixpkgs + , naersk + , rust-overlay + }: + + flake-utils.lib.eachDefaultSystem + (system: + let + overlays = [ (import rust-overlay) ]; + pkgs = import nixpkgs { inherit system overlays; }; + rust-toolchain = + (pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override { + extensions = [ "rust-src" ]; + }; + naersk-lib = naersk.lib."${system}".override { + rustc = rust-toolchain; + }; + in + rec + { + packages.x509-info = naersk-lib.buildPackage { + pname = "x509-info"; + root = ./.; + buildInputs = with pkgs; [ ]; + }; + + defaultPackage = packages.x509-info; + + devShell = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + rust-toolchain + cargo-audit + cargo-deny + cargo-cross + rust-analyzer + ] ++ pkgs.lib.optionals (pkgs.stdenv.isLinux) (with pkgs; [ cargo-watch ]); + + shellHook = '' + cargo --version + ''; + }; + }) + // { + overlay = final: prev: { + x509-info = self.defaultPackage.${prev.system}; + }; + }; +} diff --git a/src/x509-info/rust-toolchain.toml b/src/x509-info/rust-toolchain.toml new file mode 100644 index 0000000..e7ae097 --- /dev/null +++ b/src/x509-info/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "1.64.0" +components = [ "rustfmt", "clippy" ] diff --git a/src/x509-info/rustfmt.toml b/src/x509-info/rustfmt.toml new file mode 100644 index 0000000..3a26366 --- /dev/null +++ b/src/x509-info/rustfmt.toml @@ -0,0 +1 @@ +edition = "2021" diff --git a/src/x509-info/src/main.rs b/src/x509-info/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/src/x509-info/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} -- cgit v1.2.3 From 0a4c7d9eab61c7892d0868139389956f98b48b62 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Wed, 19 Oct 2022 20:08:32 -0700 Subject: build: fix the name of the workflow --- src/x509-info/.github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/x509-info/.github/workflows/build.yml b/src/x509-info/.github/workflows/build.yml index 68deda2..649d03c 100644 --- a/src/x509-info/.github/workflows/build.yml +++ b/src/x509-info/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: gh-ssh-keys CI +name: x509-info CI on: push: -- cgit v1.2.3 From 10b51ea2f3f75ce3cbcaf19f0b7f2ecb01ab0bb5 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Wed, 19 Oct 2022 19:53:43 -0700 Subject: feat: get information about a given certificate Read the domain name from the CLI, and get and print information about the certificate to STDOUT. The output looks like this: ``` > ./target/debug/x509-info badssl.com Subject: CN=*.badssl.com O= L= Issuer: CN=R3 O=Let's Encrypt L= DNS Names: *.badssl.com, badssl.com Validity Period Not before: 2022-08-12T07:57:46-07:00 Not After: 2022-11-10T06:57:45-08:00 ``` --- src/x509-info/.github/workflows/build.yml | 15 + src/x509-info/Cargo.lock | 887 ++++++++++++++++++++++++++++++ src/x509-info/Cargo.toml | 6 + src/x509-info/README.md | 15 + src/x509-info/flake.lock | 126 +++++ src/x509-info/src/client.rs | 43 ++ src/x509-info/src/main.rs | 106 +++- 7 files changed, 1197 insertions(+), 1 deletion(-) create mode 100644 src/x509-info/Cargo.lock create mode 100644 src/x509-info/README.md create mode 100644 src/x509-info/flake.lock create mode 100644 src/x509-info/src/client.rs (limited to 'src') diff --git a/src/x509-info/.github/workflows/build.yml b/src/x509-info/.github/workflows/build.yml index 649d03c..ef02e63 100644 --- a/src/x509-info/.github/workflows/build.yml +++ b/src/x509-info/.github/workflows/build.yml @@ -71,3 +71,18 @@ jobs: with: command: clippy args: -- -D warnings + + run: + name: Run + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - uses: actions-rs/cargo@v1 + with: + command: run + args: -- fcuny.net diff --git a/src/x509-info/Cargo.lock b/src/x509-info/Cargo.lock new file mode 100644 index 0000000..d728988 --- /dev/null +++ b/src/x509-info/Cargo.lock @@ -0,0 +1,887 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "asn1-rs" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf6690c370453db30743b373a60ba498fc0d6d83b11f4abfd87a84a075db5dd4" +dependencies = [ + "asn1-rs-derive", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time 0.3.15", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bumpalo" +version = "3.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" + +[[package]] +name = "cc" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-integer", + "num-traits", + "time 0.1.44", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "clap" +version = "4.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06badb543e734a2d6568e19a40af66ed5364360b9226184926f89d229b4b4267" +dependencies = [ + "atty", + "bitflags", + "clap_derive", + "clap_lex", + "once_cell", + "strsim", + "termcolor", +] + +[[package]] +name = "clap_derive" +version = "4.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c42f169caba89a7d512b5418b09864543eeb4d497416c917d7137863bd2076ad" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" +dependencies = [ + "os_str_bytes", +] + +[[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 = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "cxx" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f83d0ebf42c6eafb8d7c52f7e5f2d3003b89c7aa4fd2b79229209459a849af8" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07d050484b55975889284352b0ffc2ecbda25c0c55978017c132b29ba0818a86" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d2199b00553eda8012dfec8d3b1c75fce747cf27c169a270b3b99e3448ab78" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcb67a6de1f602736dd7eaead0080cf3435df806c61b24b13328db128c58868f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "data-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" + +[[package]] +name = "der-parser" +version = "8.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42d4bc9b0db0a0df9ae64634ac5bdefb7afcb534e182275ca0beadbe486701c1" +dependencies = [ + "asn1-rs", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + +[[package]] +name = "displaydoc" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5a6ef98976b22b3b7f2f3a806f858cb862044cfa66805aa3ad84cb3d3b785ed" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + +[[package]] +name = "itoa" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" + +[[package]] +name = "js-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.135" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" + +[[package]] +name = "link-cplusplus" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" +dependencies = [ + "cc", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "nom" +version = "7.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + +[[package]] +name = "oid-registry" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d4bda43fd1b844cbc6e6e54b5444e2b1bc7838bce59ad205902cccbb26d6761" +dependencies = [ + "asn1-rs", +] + +[[package]] +name = "once_cell" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "os_str_bytes" +version = "6.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rusticata-macros" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +dependencies = [ + "nom", +] + +[[package]] +name = "rustls" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" +dependencies = [ + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" +dependencies = [ + "base64", +] + +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static", + "windows-sys", +] + +[[package]] +name = "scratch" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "security-framework" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "syn" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "unicode-xid", +] + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "time" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +dependencies = [ + "libc", + "wasi", + "winapi", +] + +[[package]] +name = "time" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d634a985c4d4238ec39cacaed2e7ae552fbd3c476b552c1deac3021b7d7eaf0c" +dependencies = [ + "itoa", + "libc", + "num_threads", + "time-macros", +] + +[[package]] +name = "time-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" + +[[package]] +name = "unicode-ident" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasm-bindgen" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" + +[[package]] +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" +dependencies = [ + "webpki", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +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", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "x509-info" +version = "0.1.0" +dependencies = [ + "chrono", + "clap", + "rustls", + "rustls-native-certs", + "webpki-roots", + "x509-parser", +] + +[[package]] +name = "x509-parser" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" +dependencies = [ + "asn1-rs", + "base64", + "data-encoding", + "der-parser", + "lazy_static", + "nom", + "oid-registry", + "rusticata-macros", + "thiserror", + "time 0.3.15", +] diff --git a/src/x509-info/Cargo.toml b/src/x509-info/Cargo.toml index 0dff6ec..1cfac68 100644 --- a/src/x509-info/Cargo.toml +++ b/src/x509-info/Cargo.toml @@ -6,3 +6,9 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +chrono = "0.4" +clap = {version = "4.0.8", features = ["derive", "cargo"]} +rustls = "0.20.7" +rustls-native-certs = "0.6.2" +webpki-roots = "0.22.5" +x509-parser = "0.14" diff --git a/src/x509-info/README.md b/src/x509-info/README.md new file mode 100644 index 0000000..c8a1090 --- /dev/null +++ b/src/x509-info/README.md @@ -0,0 +1,15 @@ +# x509-info + +At this point it's pretty clear that I'll never remember the syntax for `openssl` to show various information about a certificate. At last I will not have to google for that syntax ever again. + +``` shell +$ x509-info github.com + Subject: CN=github.com O=GitHub, Inc. L=San Francisco + Issuer: CN=DigiCert TLS Hybrid ECC SHA384 2020 CA1 O=DigiCert Inc L= + DNS Names: github.com, www.github.com + Validity Period + Not before: 2022-03-14T17:00:00-07:00 + Not After: 2023-03-15T16:59:59-07:00 +``` + +Could the same be achieved with a wrapper around `openssl` ? yes. diff --git a/src/x509-info/flake.lock b/src/x509-info/flake.lock new file mode 100644 index 0000000..610cec8 --- /dev/null +++ b/src/x509-info/flake.lock @@ -0,0 +1,126 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "naersk": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1662220400, + "narHash": "sha256-9o2OGQqu4xyLZP9K6kNe1pTHnyPz0Wr3raGYnr9AIgY=", + "owner": "nmattia", + "repo": "naersk", + "rev": "6944160c19cb591eb85bbf9b2f2768a935623ed3", + "type": "github" + }, + "original": { + "owner": "nmattia", + "repo": "naersk", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1666215963, + "narHash": "sha256-+kSNzDXqoEVEryrJ9WrvGSvi784xPMXkk7jTJPFdT/k=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e66821278399ba9565178ce3b525e72275fe004e", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1666229941, + "narHash": "sha256-0e6aB1+ZqKuQdyjwgHltHlWMYJZCn6b0gYxdTSfIKCE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d3c2379d149073e53eb5580deafad475c1cabe28", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1665296151, + "narHash": "sha256-uOB0oxqxN9K7XGF1hcnY+PQnlQJ+3bP2vCn/+Ru/bbc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "14ccaaedd95a488dd7ae142757884d8e125b3363", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "naersk": "naersk", + "nixpkgs": "nixpkgs_2", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1666234887, + "narHash": "sha256-WZ13mLYvByYlZKz6Q8pufvi+E3Hwo92fMKA2Kw02hRA=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "dd334e95eb46e79e52a75c80ef9ba73c3d867840", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/src/x509-info/src/client.rs b/src/x509-info/src/client.rs new file mode 100644 index 0000000..11c48db --- /dev/null +++ b/src/x509-info/src/client.rs @@ -0,0 +1,43 @@ +use rustls::{ + Certificate, ClientConfig, ClientConnection, OwnedTrustAnchor, RootCertStore, ServerName, +}; +use std::error::Error; + +use std::io::Write; +use std::sync::Arc; + +pub fn get_certificates(domain: String, port: u16) -> Result, Box> { + let mut tcp_stream = std::net::TcpStream::connect(format!("{}:{}", domain, port))?; + + let mut root_store = RootCertStore::empty(); + root_store.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(|ta| { + OwnedTrustAnchor::from_subject_spki_name_constraints( + ta.subject, + ta.spki, + ta.name_constraints, + ) + })); + + let config = ClientConfig::builder() + .with_safe_defaults() + .with_root_certificates(root_store) + .with_no_client_auth(); + + let server_name = ServerName::try_from(domain.as_ref())?; + + let mut conn = ClientConnection::new(Arc::new(config), server_name)?; + while conn.wants_write() { + conn.write_tls(&mut tcp_stream)?; + } + + tcp_stream.flush()?; + while conn.is_handshaking() && conn.peer_certificates().is_none() { + conn.read_tls(&mut tcp_stream)?; + conn.process_new_packets()?; + } + + match conn.peer_certificates() { + Some(c) => Ok(c.to_vec()), + None => Err("no certificate found")?, + } +} diff --git a/src/x509-info/src/main.rs b/src/x509-info/src/main.rs index e7a11a9..99d2c65 100644 --- a/src/x509-info/src/main.rs +++ b/src/x509-info/src/main.rs @@ -1,3 +1,107 @@ +extern crate webpki_roots; + +mod client; + +use chrono::TimeZone as _; +use clap::Parser; +use x509_parser::prelude::*; + +#[derive(Parser, Debug)] +#[clap(author, version, about, long_about = None)] +struct Args { + /// Domain to check + domain: String, + + /// Port to check + #[clap(short, long, default_value_t = 443)] + port: u16, +} + fn main() { - println!("Hello, world!"); + let args = Args::parse(); + + let domain = args.domain; + + let certs = client::get_certificates(domain, args.port); + + match certs { + Ok(certs) => { + let (_, cert) = + x509_parser::certificate::X509Certificate::from_der(certs[0].as_ref()).unwrap(); + pretty_print(cert); + } + Err(e) => { + println!("error: {}", e); + std::process::exit(1); + } + }; +} + +fn pretty_print(cert: X509Certificate) { + println!( + "\tSubject: CN={} O={} L={}", + cert.subject() + .iter_common_name() + .next() + .and_then(|cn| cn.as_str().ok()) + .unwrap(), + cert.subject() + .iter_organization() + .next() + .and_then(|o| o.as_str().ok()) + .unwrap_or_default(), + cert.subject() + .iter_locality() + .next() + .and_then(|l| l.as_str().ok()) + .unwrap_or_default(), + ); + println!( + "\tIssuer: CN={} O={} L={}", + cert.issuer() + .iter_common_name() + .next() + .and_then(|cn| cn.as_str().ok()) + .unwrap(), + cert.issuer() + .iter_organization() + .next() + .and_then(|o| o.as_str().ok()) + .unwrap_or_default(), + cert.issuer() + .iter_locality() + .next() + .and_then(|l| l.as_str().ok()) + .unwrap_or_default(), + ); + + let not_before = chrono::Local + .timestamp(cert.validity().not_before.timestamp(), 0) + .to_rfc3339(); + + let not_after = chrono::Local + .timestamp(cert.validity().not_after.timestamp(), 0) + .to_rfc3339(); + + if let Some(subnames) = subject_alternative_name(cert) { + let dns_names = subnames.join(", "); + println!("\tDNS Names: {}", dns_names); + } + + println!("\tValidity Period"); + println!("\t\tNot before: {}", not_before); + println!("\t\tNot After: {}", not_after); +} + +fn subject_alternative_name(cert: X509Certificate) -> Option> { + let mut subnames = Vec::new(); + if let Ok(Some(san)) = cert.subject_alternative_name() { + let san = san.value; + for name in &san.general_names { + if let GeneralName::DNSName(name) = name { + subnames.push(name.to_string()); + } + } + } + Some(subnames) } -- cgit v1.2.3 From 253a8e7d53d36b6f325bac48c6a03b12d888fde1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 22 Oct 2022 00:51:01 +0000 Subject: build(deps): bump actions/checkout from 2 to 3 Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- src/x509-info/.github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/x509-info/.github/workflows/build.yml b/src/x509-info/.github/workflows/build.yml index ef02e63..cabbcba 100644 --- a/src/x509-info/.github/workflows/build.yml +++ b/src/x509-info/.github/workflows/build.yml @@ -8,7 +8,7 @@ jobs: name: Check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -26,7 +26,7 @@ jobs: name: Test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -44,7 +44,7 @@ jobs: name: Rustfmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -60,7 +60,7 @@ jobs: name: Clippy runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -76,7 +76,7 @@ jobs: name: Run runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: profile: minimal -- cgit v1.2.3 From cb60010d3d86e652ae87839ef16992670ef8e0d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 20:36:49 +0000 Subject: build(deps): bump clap from 4.0.17 to 4.0.18 Bumps [clap](https://github.com/clap-rs/clap) from 4.0.17 to 4.0.18. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.17...v4.0.18) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- src/x509-info/Cargo.lock | 8 ++++---- src/x509-info/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/x509-info/Cargo.lock b/src/x509-info/Cargo.lock index d728988..e00923a 100644 --- a/src/x509-info/Cargo.lock +++ b/src/x509-info/Cargo.lock @@ -114,9 +114,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.17" +version = "4.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06badb543e734a2d6568e19a40af66ed5364360b9226184926f89d229b4b4267" +checksum = "335867764ed2de42325fafe6d18b8af74ba97ee0c590fa016f157535b42ab04b" dependencies = [ "atty", "bitflags", @@ -129,9 +129,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.0.13" +version = "4.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f169caba89a7d512b5418b09864543eeb4d497416c917d7137863bd2076ad" +checksum = "16a1b0f6422af32d5da0c58e2703320f379216ee70198241c84173a8c5ac28f3" dependencies = [ "heck", "proc-macro-error", diff --git a/src/x509-info/Cargo.toml b/src/x509-info/Cargo.toml index 1cfac68..5f92f1b 100644 --- a/src/x509-info/Cargo.toml +++ b/src/x509-info/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] chrono = "0.4" -clap = {version = "4.0.8", features = ["derive", "cargo"]} +clap = {version = "4.0.18", features = ["derive", "cargo"]} rustls = "0.20.7" rustls-native-certs = "0.6.2" webpki-roots = "0.22.5" -- cgit v1.2.3 From 09b29c4885ddb675030fc768a6f562b1edcc3da9 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 1 Nov 2022 07:55:38 -0700 Subject: meta: ignore result directory --- src/x509-info/.gitignore | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/x509-info/.gitignore b/src/x509-info/.gitignore index ea8c4bf..d787b70 100644 --- a/src/x509-info/.gitignore +++ b/src/x509-info/.gitignore @@ -1 +1,2 @@ /target +/result -- cgit v1.2.3 From c8f6aed45daeb711335e87c61f8d133462694360 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 1 Nov 2022 09:06:32 -0700 Subject: meta: add a configuration to allow/deny dependencies cargo-deny is a plugin to lint a project's dependency graph. This allow me to set which licenses are allowed for the dependencies, and configure the security vulnerability database. --- src/x509-info/deny.toml | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/x509-info/deny.toml (limited to 'src') diff --git a/src/x509-info/deny.toml b/src/x509-info/deny.toml new file mode 100644 index 0000000..fd95cdb --- /dev/null +++ b/src/x509-info/deny.toml @@ -0,0 +1,46 @@ +[advisories] +db-path = "~/.cargo/advisory-db" +db-urls = ["https://github.com/rustsec/advisory-db"] +vulnerability = "deny" +unmaintained = "warn" +yanked = "warn" +notice = "warn" +ignore = [] + +[licenses] +unlicensed = "deny" +allow = ["MIT", "Apache-2.0", "ISC", "Unicode-DFS-2016", "OpenSSL"] +deny = [] +copyleft = "allow" +default = "deny" +confidence-threshold = 0.8 +exceptions = [] + +[licenses.private] +ignore = false +registries = [] + +# see https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html#example +[[licenses.clarify]] +name = "ring" +expression = "MIT AND ISC AND OpenSSL" +license-files = [ + { path = "LICENSE", hash = 0xbd0eed23 } +] + +[bans] +multiple-versions = "warn" +wildcards = "allow" +highlight = "all" +allow = [] +deny = [] +skip = [] +skip-tree = [] + +[sources] +unknown-registry = "warn" +unknown-git = "warn" +allow-registry = ["https://github.com/rust-lang/crates.io-index"] +allow-git = [] + +[sources.allow-org] -- cgit v1.2.3 From 8ec83a00ad9e589fc8f51300f1992ae15df64ae0 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 1 Nov 2022 08:42:15 -0700 Subject: build: configure rust overlay to follow nixpkgs --- src/x509-info/flake.lock | 20 +++----------------- src/x509-info/flake.nix | 5 ++++- 2 files changed, 7 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/x509-info/flake.lock b/src/x509-info/flake.lock index 610cec8..d4cb665 100644 --- a/src/x509-info/flake.lock +++ b/src/x509-info/flake.lock @@ -77,22 +77,6 @@ "type": "github" } }, - "nixpkgs_3": { - "locked": { - "lastModified": 1665296151, - "narHash": "sha256-uOB0oxqxN9K7XGF1hcnY+PQnlQJ+3bP2vCn/+Ru/bbc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "14ccaaedd95a488dd7ae142757884d8e125b3363", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "root": { "inputs": { "flake-utils": "flake-utils", @@ -104,7 +88,9 @@ "rust-overlay": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_3" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1666234887, diff --git a/src/x509-info/flake.nix b/src/x509-info/flake.nix index 0dbaee0..4861588 100644 --- a/src/x509-info/flake.nix +++ b/src/x509-info/flake.nix @@ -4,7 +4,10 @@ inputs = { flake-utils.url = "github:numtide/flake-utils"; nixpkgs.url = "github:NixOS/nixpkgs"; - rust-overlay.url = "github:oxalica/rust-overlay"; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; naersk.url = "github:nmattia/naersk"; }; -- cgit v1.2.3 From 04a4d34e94c6333768a136ef8f40d367629f7e00 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 1 Nov 2022 08:51:36 -0700 Subject: build: get rid of naersk We can build a rust binary without naesrk,with the help of `buildRustPackage`. Simplify a bit the overall build by consuming information from Cargo.toml and Cargo.lock. --- src/x509-info/flake.lock | 35 +---------------------------------- src/x509-info/flake.nix | 48 +++++++++++++++++++++++++++--------------------- 2 files changed, 28 insertions(+), 55 deletions(-) (limited to 'src') diff --git a/src/x509-info/flake.lock b/src/x509-info/flake.lock index d4cb665..9080ba8 100644 --- a/src/x509-info/flake.lock +++ b/src/x509-info/flake.lock @@ -30,39 +30,7 @@ "type": "github" } }, - "naersk": { - "inputs": { - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1662220400, - "narHash": "sha256-9o2OGQqu4xyLZP9K6kNe1pTHnyPz0Wr3raGYnr9AIgY=", - "owner": "nmattia", - "repo": "naersk", - "rev": "6944160c19cb591eb85bbf9b2f2768a935623ed3", - "type": "github" - }, - "original": { - "owner": "nmattia", - "repo": "naersk", - "type": "github" - } - }, "nixpkgs": { - "locked": { - "lastModified": 1666215963, - "narHash": "sha256-+kSNzDXqoEVEryrJ9WrvGSvi784xPMXkk7jTJPFdT/k=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "e66821278399ba9565178ce3b525e72275fe004e", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "nixpkgs_2": { "locked": { "lastModified": 1666229941, "narHash": "sha256-0e6aB1+ZqKuQdyjwgHltHlWMYJZCn6b0gYxdTSfIKCE=", @@ -80,8 +48,7 @@ "root": { "inputs": { "flake-utils": "flake-utils", - "naersk": "naersk", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "rust-overlay": "rust-overlay" } }, diff --git a/src/x509-info/flake.nix b/src/x509-info/flake.nix index 4861588..ca1762f 100644 --- a/src/x509-info/flake.nix +++ b/src/x509-info/flake.nix @@ -8,48 +8,53 @@ url = "github:oxalica/rust-overlay"; inputs.nixpkgs.follows = "nixpkgs"; }; - naersk.url = "github:nmattia/naersk"; }; outputs = { self , flake-utils , nixpkgs - , naersk , rust-overlay }: + let + # Borrow project metadata from the Rust config + meta = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package; + inherit (meta) name version; + overlays = [ + # Rust helpers + (import rust-overlay) + # Build Rust toolchain using helpers from rust-overlay + (self: super: { + # This supplies cargo, rustc, rustfmt, etc. + rustToolchain = super.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; + }) + ]; + in flake-utils.lib.eachDefaultSystem (system: let - overlays = [ (import rust-overlay) ]; - pkgs = import nixpkgs { inherit system overlays; }; - rust-toolchain = - (pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override { - extensions = [ "rust-src" ]; - }; - naersk-lib = naersk.lib."${system}".override { - rustc = rust-toolchain; - }; + pkgs = import nixpkgs { inherit overlays system; }; in - rec { - packages.x509-info = naersk-lib.buildPackage { - pname = "x509-info"; - root = ./.; - buildInputs = with pkgs; [ ]; + packages = rec { + default = x509-info; + x509-info = pkgs.rustPlatform.buildRustPackage { + pname = name; + inherit version; + src = ./.; + release = true; + cargoLock.lockFile = ./Cargo.lock; + }; }; - defaultPackage = packages.x509-info; - devShell = pkgs.mkShell { nativeBuildInputs = with pkgs; [ - rust-toolchain + rustToolchain cargo-audit cargo-deny - cargo-cross rust-analyzer - ] ++ pkgs.lib.optionals (pkgs.stdenv.isLinux) (with pkgs; [ cargo-watch ]); + ]; shellHook = '' cargo --version @@ -62,3 +67,4 @@ }; }; } + -- cgit v1.2.3 From 587837449b0c4f565502a81185a1e597144679ca Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 1 Nov 2022 08:37:28 -0700 Subject: fix: disable default feature on `chrono` crate See https://github.com/chronotope/chrono/issues/602 for more details. --- src/x509-info/Cargo.lock | 93 +++++++++++++++++++++++------------------------- src/x509-info/Cargo.toml | 2 +- 2 files changed, 46 insertions(+), 49 deletions(-) (limited to 'src') diff --git a/src/x509-info/Cargo.lock b/src/x509-info/Cargo.lock index e00923a..005aee6 100644 --- a/src/x509-info/Cargo.lock +++ b/src/x509-info/Cargo.lock @@ -24,7 +24,7 @@ dependencies = [ "num-traits", "rusticata-macros", "thiserror", - "time 0.3.15", + "time", ] [[package]] @@ -69,9 +69,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base64" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "bitflags" @@ -87,9 +87,9 @@ checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "cc" -version = "1.0.73" +version = "1.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "581f5dba903aac52ea3feb5ec4810848460ee833876f1f9b0fdeab1f19091574" [[package]] name = "cfg-if" @@ -104,11 +104,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" dependencies = [ "iana-time-zone", - "js-sys", "num-integer", "num-traits", - "time 0.1.44", - "wasm-bindgen", "winapi", ] @@ -177,9 +174,9 @@ checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "cxx" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f83d0ebf42c6eafb8d7c52f7e5f2d3003b89c7aa4fd2b79229209459a849af8" +checksum = "6b7d4e43b25d3c994662706a1d4fcfc32aaa6afd287502c111b237093bb23f3a" dependencies = [ "cc", "cxxbridge-flags", @@ -189,9 +186,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07d050484b55975889284352b0ffc2ecbda25c0c55978017c132b29ba0818a86" +checksum = "84f8829ddc213e2c1368e51a2564c552b65a8cb6a28f31e576270ac81d5e5827" dependencies = [ "cc", "codespan-reporting", @@ -204,15 +201,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d2199b00553eda8012dfec8d3b1c75fce747cf27c169a270b3b99e3448ab78" +checksum = "e72537424b474af1460806647c41d4b6d35d09ef7fe031c5c2fa5766047cc56a" [[package]] name = "cxxbridge-macro" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb67a6de1f602736dd7eaead0080cf3435df806c61b24b13328db128c58868f" +checksum = "309e4fb93eed90e1e14bea0da16b209f81813ba9fc7830c20ed151dd7bc0a4d7" dependencies = [ "proc-macro2", "quote", @@ -267,9 +264,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.51" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5a6ef98976b22b3b7f2f3a806f858cb862044cfa66805aa3ad84cb3d3b785ed" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -312,9 +309,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.135" +version = "0.2.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" +checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" [[package]] name = "link-cplusplus" @@ -406,9 +403,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" [[package]] name = "openssl-probe" @@ -418,9 +415,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "os_str_bytes" -version = "6.3.0" +version = "6.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" +checksum = "3baf96e39c5359d2eb0dd6ccb42c62b91d9678aa68160d261b9e0ccbf9e9dea9" [[package]] name = "proc-macro-error" @@ -570,6 +567,12 @@ dependencies = [ "libc", ] +[[package]] +name = "serde" +version = "1.0.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" + [[package]] name = "spin" version = "0.5.2" @@ -584,9 +587,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.102" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" +checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" dependencies = [ "proc-macro2", "quote", @@ -636,32 +639,32 @@ dependencies = [ [[package]] name = "time" -version = "0.1.44" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" -dependencies = [ - "libc", - "wasi", - "winapi", -] - -[[package]] -name = "time" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d634a985c4d4238ec39cacaed2e7ae552fbd3c476b552c1deac3021b7d7eaf0c" +checksum = "0fab5c8b9980850e06d92ddbe3ab839c062c801f3927c0fb8abd6fc8e918fbca" dependencies = [ "itoa", "libc", "num_threads", + "serde", + "time-core", "time-macros", ] +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + [[package]] name = "time-macros" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" +checksum = "65bb801831d812c562ae7d2bfb531f26e66e4e1f6b17307ba4149c5064710e5b" +dependencies = [ + "time-core", +] [[package]] name = "unicode-ident" @@ -693,12 +696,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasm-bindgen" version = "0.2.83" @@ -883,5 +880,5 @@ dependencies = [ "oid-registry", "rusticata-macros", "thiserror", - "time 0.3.15", + "time", ] diff --git a/src/x509-info/Cargo.toml b/src/x509-info/Cargo.toml index 5f92f1b..4120200 100644 --- a/src/x509-info/Cargo.toml +++ b/src/x509-info/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -chrono = "0.4" +chrono = {version = "0.4.20", features = ["clock"], default-features = false } clap = {version = "4.0.18", features = ["derive", "cargo"]} rustls = "0.20.7" rustls-native-certs = "0.6.2" -- cgit v1.2.3 From 4ba1bc4f7cc4a45ece429d6ee138e7ce7f4517bc Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 1 Nov 2022 07:50:19 -0700 Subject: ci: rewrite GitHub actions to use `nix develop|build` Instead of relying on GitHub actions to check/test/build the code, I can rely entirely on nix to do these steps. This has the added benefit that the workflow will be similar to my local environment and make it easy to test the worfklow before running it on GitHub. --- src/x509-info/.github/workflows/build.yml | 111 ++++++++++-------------------- 1 file changed, 36 insertions(+), 75 deletions(-) (limited to 'src') diff --git a/src/x509-info/.github/workflows/build.yml b/src/x509-info/.github/workflows/build.yml index cabbcba..0d3d439 100644 --- a/src/x509-info/.github/workflows/build.yml +++ b/src/x509-info/.github/workflows/build.yml @@ -8,81 +8,42 @@ jobs: name: Check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 - with: - command: check - - uses: actions-rs/cargo@v1 - with: - command: check - args: --no-default-features + - name: git checkout + uses: actions/checkout@v3 + - name: install nix + uses: cachix/install-nix-action@v17 + # This is a workaround for https://github.com/oxalica/rust-overlay/issues/54, + # avoiding link errors when running cargo commands with `nix develop`. + - name: Remove existing binaries from ~/.cargo/bin + run: rm --recursive --force --verbose ~/.cargo/bin + - name: check rust formatting + run: nix develop --command cargo fmt --check + - name: audit rust code + run: nix develop --command cargo-deny check + - name: clippy + run: nix develop --command cargo clippy -- -D warnings - test: - name: Test + test_and_build: + name: Test and build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 - with: - command: test - - uses: actions-rs/cargo@v1 - with: - command: test - args: --no-default-features - - fmt: - name: Rustfmt - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - run: rustup component add rustfmt - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - clippy: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - run: rustup component add clippy - - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings - - run: - name: Run - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 - with: - command: run - args: -- fcuny.net + - name: git checkout + uses: actions/checkout@v3 + - name: install nix + uses: cachix/install-nix-action@v17 + - name: Set up Rust cache + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: x509-info-app-${{ hashFiles('**/Cargo.lock') }} + - name: test + run: nix develop --command cargo test + - name: build + run: nix build . + - name: validate + run: nix run . -- fcuny.net -- cgit v1.2.3 From 03a62e4114ab546c3b3eec8f83403e06341aed85 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 1 Nov 2022 17:31:41 -0700 Subject: build: add pre-commit checks --- src/x509-info/.gitignore | 1 + src/x509-info/flake.lock | 24 ++++++++++++++++++++++++ src/x509-info/flake.nix | 35 +++++++++++++++++++++++++++++++---- 3 files changed, 56 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/x509-info/.gitignore b/src/x509-info/.gitignore index d787b70..53e2c1a 100644 --- a/src/x509-info/.gitignore +++ b/src/x509-info/.gitignore @@ -1,2 +1,3 @@ /target /result +/.pre-commit-config.yaml diff --git a/src/x509-info/flake.lock b/src/x509-info/flake.lock index 9080ba8..af07128 100644 --- a/src/x509-info/flake.lock +++ b/src/x509-info/flake.lock @@ -45,10 +45,34 @@ "type": "github" } }, + "pre-commit-hooks": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1666604592, + "narHash": "sha256-Bxy7xeVAwC0yxFaeYZM7N9Us/ebxpMC9TCceKEFeay4=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "1b436f36e2812c589e6d830e3223059ea9661100", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "flake-utils": "flake-utils", "nixpkgs": "nixpkgs", + "pre-commit-hooks": "pre-commit-hooks", "rust-overlay": "rust-overlay" } }, diff --git a/src/x509-info/flake.nix b/src/x509-info/flake.nix index ca1762f..5948fa8 100644 --- a/src/x509-info/flake.nix +++ b/src/x509-info/flake.nix @@ -6,7 +6,16 @@ nixpkgs.url = "github:NixOS/nixpkgs"; rust-overlay = { url = "github:oxalica/rust-overlay"; - inputs.nixpkgs.follows = "nixpkgs"; + inputs = { + nixpkgs.follows = "nixpkgs"; + }; + }; + pre-commit-hooks = { + url = "github:cachix/pre-commit-hooks.nix"; + inputs = { + flake-utils.follows = "flake-utils"; + nixpkgs.follows = "nixpkgs"; + }; }; }; @@ -15,6 +24,7 @@ , flake-utils , nixpkgs , rust-overlay + , pre-commit-hooks }: let # Borrow project metadata from the Rust config @@ -48,6 +58,25 @@ }; }; + checks = { + pre-commit = pre-commit-hooks.lib.${system}.run { + src = ./.; + hooks = { + clippy = { + enable = true; + entry = pkgs.lib.mkForce "cargo clippy -- -D warnings"; + }; + nixpkgs-fmt = { + enable = true; + }; + rustfmt = { + enable = true; + entry = pkgs.lib.mkForce "cargo fmt -- --check --color always"; + }; + }; + }; + }; + devShell = pkgs.mkShell { nativeBuildInputs = with pkgs; [ rustToolchain @@ -56,9 +85,7 @@ rust-analyzer ]; - shellHook = '' - cargo --version - ''; + inherit (self.checks.${system}.pre-commit) shellHook; }; }) // { -- cgit v1.2.3 From 521cff79e048e4e4c16138b0552133f1b6d6619a Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 1 Nov 2022 17:45:58 -0700 Subject: build: follow flake-inputs for rust overlay --- src/x509-info/flake.lock | 19 +++---------------- src/x509-info/flake.nix | 1 + 2 files changed, 4 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/x509-info/flake.lock b/src/x509-info/flake.lock index af07128..c3ece1f 100644 --- a/src/x509-info/flake.lock +++ b/src/x509-info/flake.lock @@ -15,21 +15,6 @@ "type": "github" } }, - "flake-utils_2": { - "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1666229941, @@ -78,7 +63,9 @@ }, "rust-overlay": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": [ + "flake-utils" + ], "nixpkgs": [ "nixpkgs" ] diff --git a/src/x509-info/flake.nix b/src/x509-info/flake.nix index 5948fa8..6061f08 100644 --- a/src/x509-info/flake.nix +++ b/src/x509-info/flake.nix @@ -7,6 +7,7 @@ rust-overlay = { url = "github:oxalica/rust-overlay"; inputs = { + flake-utils.follows = "flake-utils"; nixpkgs.follows = "nixpkgs"; }; }; -- cgit v1.2.3 From 9bb6132e02f00ede19f6fd929b0ebcd8d0e21fa8 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Fri, 4 Nov 2022 18:11:43 -0700 Subject: buid: use crane to build the binary crane is a nix library to build cargo projects, similar to naersk. The main advantage over naersk is the composability. I'll give it a try and see if it's faster for local development. --- src/x509-info/flake.lock | 84 ++++++++++++++++++++++++++++++++++++++++++++++-- src/x509-info/flake.nix | 60 ++++++++++++++++++---------------- 2 files changed, 114 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/x509-info/flake.lock b/src/x509-info/flake.lock index c3ece1f..67d9a74 100644 --- a/src/x509-info/flake.lock +++ b/src/x509-info/flake.lock @@ -1,6 +1,60 @@ { "nodes": { + "crane": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1667522439, + "narHash": "sha256-1tDYoumL5337T4BkC87iRXbAfeyeeOXa5WAbeP/ENqQ=", + "owner": "ipetkov", + "repo": "crane", + "rev": "b70e77d2e2d480a3a0bce3ecd2d981679588b23f", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { "locked": { "lastModified": 1659877975, "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", @@ -55,13 +109,39 @@ }, "root": { "inputs": { - "flake-utils": "flake-utils", + "crane": "crane", + "flake-utils": "flake-utils_2", "nixpkgs": "nixpkgs", "pre-commit-hooks": "pre-commit-hooks", - "rust-overlay": "rust-overlay" + "rust-overlay": "rust-overlay_2" } }, "rust-overlay": { + "inputs": { + "flake-utils": [ + "crane", + "flake-utils" + ], + "nixpkgs": [ + "crane", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1667487142, + "narHash": "sha256-bVuzLs1ZVggJAbJmEDVO9G6p8BH3HRaolK70KXvnWnU=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "cf668f737ac986c0a89e83b6b2e3c5ddbd8cf33b", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "rust-overlay_2": { "inputs": { "flake-utils": [ "flake-utils" diff --git a/src/x509-info/flake.nix b/src/x509-info/flake.nix index 6061f08..c0e0eeb 100644 --- a/src/x509-info/flake.nix +++ b/src/x509-info/flake.nix @@ -11,6 +11,10 @@ nixpkgs.follows = "nixpkgs"; }; }; + crane = { + url = "github:ipetkov/crane"; + inputs.nixpkgs.follows = "nixpkgs"; + }; pre-commit-hooks = { url = "github:cachix/pre-commit-hooks.nix"; inputs = { @@ -25,43 +29,45 @@ , flake-utils , nixpkgs , rust-overlay + , crane , pre-commit-hooks }: - let - # Borrow project metadata from the Rust config - meta = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package; - inherit (meta) name version; - overlays = [ - # Rust helpers - (import rust-overlay) - # Build Rust toolchain using helpers from rust-overlay - (self: super: { - # This supplies cargo, rustc, rustfmt, etc. - rustToolchain = super.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; - }) - ]; - in flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs { inherit overlays system; }; + pkgs = import nixpkgs { + inherit system; + overlays = [ (import rust-overlay) ]; + }; + rust-toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; + + craneLib = (crane.mkLib pkgs).overrideScope' (_: _: { + cargo = rust-toolchain; + clippy = rust-toolchain; + rustc = rust-toolchain; + rustfmt = rust-toolchain; + }); + + src = ./.; + + cargoArtifacts = craneLib.buildDepsOnly { + inherit src; + }; + + x509-info = craneLib.buildPackage { + inherit cargoArtifacts src; + }; in { - packages = rec { - default = x509-info; - x509-info = pkgs.rustPlatform.buildRustPackage { - pname = name; - inherit version; - src = ./.; - release = true; - cargoLock.lockFile = ./Cargo.lock; - }; + packages.default = x509-info; + apps.default = flake-utils.lib.mkApp { + drv = x509-info; }; checks = { pre-commit = pre-commit-hooks.lib.${system}.run { - src = ./.; + inherit src; hooks = { clippy = { enable = true; @@ -80,10 +86,8 @@ devShell = pkgs.mkShell { nativeBuildInputs = with pkgs; [ - rustToolchain - cargo-audit + rust-toolchain cargo-deny - rust-analyzer ]; inherit (self.checks.${system}.pre-commit) shellHook; -- cgit v1.2.3 From 42a74c6ec5953024faab56bc4651c45c328d2f2d Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 6 Nov 2022 10:47:48 -0800 Subject: ci: switch from GitHub action to drone I'm running my own CI at ci.fcuny.net using drone for now. I've spare compute capacity at home, and it's way faster than the GHA runners. For now I'm losing the following: - dependabot: that's a GitHub only function, I'll need to figure out something - nix flake update: I'll need to figure out a way to update flakes on a regular basis, probably a custom script to take care of that --- src/x509-info/.drone.yml | 35 ++++++++++++++++++++++ src/x509-info/.github/dependabot.yml | 11 ------- src/x509-info/.github/workflows/build.yml | 49 ------------------------------- src/x509-info/README.md | 2 ++ 4 files changed, 37 insertions(+), 60 deletions(-) create mode 100644 src/x509-info/.drone.yml delete mode 100644 src/x509-info/.github/dependabot.yml delete mode 100644 src/x509-info/.github/workflows/build.yml (limited to 'src') diff --git a/src/x509-info/.drone.yml b/src/x509-info/.drone.yml new file mode 100644 index 0000000..0816988 --- /dev/null +++ b/src/x509-info/.drone.yml @@ -0,0 +1,35 @@ +kind: pipeline +type: docker +name: checks + +trigger: + event: + - push + - pull_request + - cron + +steps: + - name: Run checks + image: nixpkgs/nix-flakes:nixos-22.05 + commands: + - nix develop --command cargo fmt --check + - nix develop --command cargo-deny check + - nix develop --command cargo clippy -- -D warnings +--- +kind: pipeline +type: docker +name: build + +trigger: + event: + - push + - pull_request + - cron + +steps: + - name: Run tests and build + image: nixpkgs/nix-flakes:nixos-22.05 + commands: + - nix develop --command cargo test + - nix build . + - nix run . -- fcuny.net diff --git a/src/x509-info/.github/dependabot.yml b/src/x509-info/.github/dependabot.yml deleted file mode 100644 index 2b2ebcf..0000000 --- a/src/x509-info/.github/dependabot.yml +++ /dev/null @@ -1,11 +0,0 @@ -version: 2 -updates: -- package-ecosystem: cargo - directory: "/" - schedule: - interval: daily - open-pull-requests-limit: 10 -- package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" diff --git a/src/x509-info/.github/workflows/build.yml b/src/x509-info/.github/workflows/build.yml deleted file mode 100644 index 0d3d439..0000000 --- a/src/x509-info/.github/workflows/build.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: x509-info CI - -on: - push: - -jobs: - check: - name: Check - runs-on: ubuntu-latest - steps: - - name: git checkout - uses: actions/checkout@v3 - - name: install nix - uses: cachix/install-nix-action@v17 - # This is a workaround for https://github.com/oxalica/rust-overlay/issues/54, - # avoiding link errors when running cargo commands with `nix develop`. - - name: Remove existing binaries from ~/.cargo/bin - run: rm --recursive --force --verbose ~/.cargo/bin - - name: check rust formatting - run: nix develop --command cargo fmt --check - - name: audit rust code - run: nix develop --command cargo-deny check - - name: clippy - run: nix develop --command cargo clippy -- -D warnings - - test_and_build: - name: Test and build - runs-on: ubuntu-latest - steps: - - name: git checkout - uses: actions/checkout@v3 - - name: install nix - uses: cachix/install-nix-action@v17 - - name: Set up Rust cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: x509-info-app-${{ hashFiles('**/Cargo.lock') }} - - name: test - run: nix develop --command cargo test - - name: build - run: nix build . - - name: validate - run: nix run . -- fcuny.net diff --git a/src/x509-info/README.md b/src/x509-info/README.md index c8a1090..39fc564 100644 --- a/src/x509-info/README.md +++ b/src/x509-info/README.md @@ -1,5 +1,7 @@ # x509-info +[![Build Status](https://ci.fcuny.net/api/badges/fcuny/x509-info/status.svg)](https://ci.fcuny.net/fcuny/x509-info) + At this point it's pretty clear that I'll never remember the syntax for `openssl` to show various information about a certificate. At last I will not have to google for that syntax ever again. ``` shell -- cgit v1.2.3 From d9ff8fd3b72d3667124dbb805777cb99372107c6 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 7 Nov 2022 18:56:58 -0800 Subject: ci: add pipeline to update flacks --- src/x509-info/.drone.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/x509-info/.drone.yml b/src/x509-info/.drone.yml index 0816988..3ff6a19 100644 --- a/src/x509-info/.drone.yml +++ b/src/x509-info/.drone.yml @@ -33,3 +33,17 @@ steps: - nix develop --command cargo test - nix build . - nix run . -- fcuny.net +--- +kind: pipeline +type: docker +name: flakes-update +trigger: + event: + - cron + +steps: + - name: update flakes + image: nixpkgs/nix-flakes:nixos-22.05 + commands: + - nix flake update --commit-lock-file + - nix develop -c git push origin --all -- cgit v1.2.3 From 7768eb86c3c0c0dab4223c6b7fc2d090488515ee Mon Sep 17 00:00:00 2001 From: Franck Date: Tue, 8 Nov 2022 03:30:10 +0000 Subject: flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'flake-utils': 'github:numtide/flake-utils/c0e246b9b83f637f4681389ecabcb2681b4f3af0' (2022-08-07) → 'github:numtide/flake-utils/5aed5285a952e0b949eb3ba02c12fa4fcfef535f' (2022-11-02) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/d3c2379d149073e53eb5580deafad475c1cabe28' (2022-10-20) → 'github:NixOS/nixpkgs/1d29ae3a66395506fd85655a8d74279ad4f9098f' (2022-11-08) • Updated input 'pre-commit-hooks': 'github:cachix/pre-commit-hooks.nix/1b436f36e2812c589e6d830e3223059ea9661100' (2022-10-24) → 'github:cachix/pre-commit-hooks.nix/06f48d63d473516ce5b8abe70d15be96a0147fcd' (2022-11-06) • Updated input 'rust-overlay': 'github:oxalica/rust-overlay/dd334e95eb46e79e52a75c80ef9ba73c3d867840' (2022-10-20) → 'github:oxalica/rust-overlay/9235990723630e1a55e1ed6bca5954e4e31cfbd7' (2022-11-08) --- src/x509-info/flake.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/x509-info/flake.lock b/src/x509-info/flake.lock index 67d9a74..f97f3bc 100644 --- a/src/x509-info/flake.lock +++ b/src/x509-info/flake.lock @@ -56,11 +56,11 @@ }, "flake-utils_2": { "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "owner": "numtide", "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "type": "github" }, "original": { @@ -71,11 +71,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1666229941, - "narHash": "sha256-0e6aB1+ZqKuQdyjwgHltHlWMYJZCn6b0gYxdTSfIKCE=", + "lastModified": 1667877958, + "narHash": "sha256-InhzugdvWBvvR5/6hVDRngkSOeqjcw0SI9brZtY5y+g=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d3c2379d149073e53eb5580deafad475c1cabe28", + "rev": "1d29ae3a66395506fd85655a8d74279ad4f9098f", "type": "github" }, "original": { @@ -94,11 +94,11 @@ ] }, "locked": { - "lastModified": 1666604592, - "narHash": "sha256-Bxy7xeVAwC0yxFaeYZM7N9Us/ebxpMC9TCceKEFeay4=", + "lastModified": 1667760143, + "narHash": "sha256-+X5CyeNEKp41bY/I1AJgW/fn69q5cLJ1bgiaMMCKB3M=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "1b436f36e2812c589e6d830e3223059ea9661100", + "rev": "06f48d63d473516ce5b8abe70d15be96a0147fcd", "type": "github" }, "original": { @@ -151,11 +151,11 @@ ] }, "locked": { - "lastModified": 1666234887, - "narHash": "sha256-WZ13mLYvByYlZKz6Q8pufvi+E3Hwo92fMKA2Kw02hRA=", + "lastModified": 1667875464, + "narHash": "sha256-0rO2Pzn//ANT3AphpEUantCbm86XcmKNEKhM73LFr04=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "dd334e95eb46e79e52a75c80ef9ba73c3d867840", + "rev": "9235990723630e1a55e1ed6bca5954e4e31cfbd7", "type": "github" }, "original": { -- cgit v1.2.3 From 1dbfaf2e096dd3c51023d37a9e8a84def07e4e16 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 8 Nov 2022 19:20:23 -0800 Subject: fix: configure properly the overlay --- src/x509-info/flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/x509-info/flake.nix b/src/x509-info/flake.nix index c0e0eeb..dfebcdb 100644 --- a/src/x509-info/flake.nix +++ b/src/x509-info/flake.nix @@ -95,7 +95,7 @@ }) // { overlay = final: prev: { - x509-info = self.defaultPackage.${prev.system}; + x509-info = self.packages.${prev.system}.default; }; }; } -- cgit v1.2.3 From d71a8fd88831e2d91b7cc2d65bae1c5da6f49df8 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Wed, 9 Nov 2022 17:54:19 -0800 Subject: fix: ensure rust-src is installed --- src/x509-info/flake.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/x509-info/flake.nix b/src/x509-info/flake.nix index dfebcdb..4b7967a 100644 --- a/src/x509-info/flake.nix +++ b/src/x509-info/flake.nix @@ -40,7 +40,9 @@ inherit system; overlays = [ (import rust-overlay) ]; }; - rust-toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; + rust-toolchain = (pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override { + extensions = [ "rust-src" ]; + }; craneLib = (crane.mkLib pkgs).overrideScope' (_: _: { cargo = rust-toolchain; -- cgit v1.2.3 From 15556996cd75003c54db1a5872c66fdf7075364d Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Wed, 9 Nov 2022 17:55:44 -0800 Subject: fix: small nit --- src/x509-info/.drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/x509-info/.drone.yml b/src/x509-info/.drone.yml index 3ff6a19..f3ec80f 100644 --- a/src/x509-info/.drone.yml +++ b/src/x509-info/.drone.yml @@ -13,7 +13,7 @@ steps: image: nixpkgs/nix-flakes:nixos-22.05 commands: - nix develop --command cargo fmt --check - - nix develop --command cargo-deny check + - nix develop --command cargo deny check - nix develop --command cargo clippy -- -D warnings --- kind: pipeline -- cgit v1.2.3 From 92658d136f77dbb1cf4028e8a69e9c1402155ef9 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 13 Nov 2022 11:36:39 -0800 Subject: ref: print succinct or detailed information about a cert Most of the time, all I want is to know when the certificate is going to expire. In some cases, I might want to see more details. This change introduce a new argument to the CLI to select what level of information to print. The new option (`--format`) will by default print the short summary, like this: ``` > ./target/debug/x509-info twitter.com twitter.com is valid until Mon, 12 Dec 2022 15:59:59 -0800 (29 days left) ``` While with `--format long` we get the following: ``` > ./target/debug/x509-info --format long twitter.com certificate version: V3 serial: 0d:e1:52:69:6b:2f:96:70:d6:c7:db:18:ce:1c:71:a0 subject: C=US, ST=California, L=San Francisco, O=Twitter, Inc., CN=twitter.com issuer: C=US, O=DigiCert Inc, CN=DigiCert TLS RSA SHA256 2020 CA1 validity not before : Sun, 12 Dec 2021 16:00:00 -0800 not after : Mon, 12 Dec 2022 15:59:59 -0800 validity days : 364 remaining days: 29 SANs: DNS:twitter.com DNS:www.twitter.com ``` --- src/x509-info/.drone.yml | 1 + src/x509-info/src/main.rs | 76 +++------------------------------ src/x509-info/src/output.rs | 100 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+), 71 deletions(-) create mode 100644 src/x509-info/src/output.rs (limited to 'src') diff --git a/src/x509-info/.drone.yml b/src/x509-info/.drone.yml index f3ec80f..7c469a4 100644 --- a/src/x509-info/.drone.yml +++ b/src/x509-info/.drone.yml @@ -33,6 +33,7 @@ steps: - nix develop --command cargo test - nix build . - nix run . -- fcuny.net + - nix run . -- --format long fcuny.net --- kind: pipeline type: docker diff --git a/src/x509-info/src/main.rs b/src/x509-info/src/main.rs index 99d2c65..d9eed13 100644 --- a/src/x509-info/src/main.rs +++ b/src/x509-info/src/main.rs @@ -1,8 +1,8 @@ extern crate webpki_roots; mod client; +mod output; -use chrono::TimeZone as _; use clap::Parser; use x509_parser::prelude::*; @@ -15,6 +15,9 @@ struct Args { /// Port to check #[clap(short, long, default_value_t = 443)] port: u16, + + #[clap(short, long,value_enum, default_value_t = output::OutputFormat::Short)] + format: output::OutputFormat, } fn main() { @@ -28,7 +31,7 @@ fn main() { Ok(certs) => { let (_, cert) = x509_parser::certificate::X509Certificate::from_der(certs[0].as_ref()).unwrap(); - pretty_print(cert); + output::OutputFormat::print(args.format, cert); } Err(e) => { println!("error: {}", e); @@ -36,72 +39,3 @@ fn main() { } }; } - -fn pretty_print(cert: X509Certificate) { - println!( - "\tSubject: CN={} O={} L={}", - cert.subject() - .iter_common_name() - .next() - .and_then(|cn| cn.as_str().ok()) - .unwrap(), - cert.subject() - .iter_organization() - .next() - .and_then(|o| o.as_str().ok()) - .unwrap_or_default(), - cert.subject() - .iter_locality() - .next() - .and_then(|l| l.as_str().ok()) - .unwrap_or_default(), - ); - println!( - "\tIssuer: CN={} O={} L={}", - cert.issuer() - .iter_common_name() - .next() - .and_then(|cn| cn.as_str().ok()) - .unwrap(), - cert.issuer() - .iter_organization() - .next() - .and_then(|o| o.as_str().ok()) - .unwrap_or_default(), - cert.issuer() - .iter_locality() - .next() - .and_then(|l| l.as_str().ok()) - .unwrap_or_default(), - ); - - let not_before = chrono::Local - .timestamp(cert.validity().not_before.timestamp(), 0) - .to_rfc3339(); - - let not_after = chrono::Local - .timestamp(cert.validity().not_after.timestamp(), 0) - .to_rfc3339(); - - if let Some(subnames) = subject_alternative_name(cert) { - let dns_names = subnames.join(", "); - println!("\tDNS Names: {}", dns_names); - } - - println!("\tValidity Period"); - println!("\t\tNot before: {}", not_before); - println!("\t\tNot After: {}", not_after); -} - -fn subject_alternative_name(cert: X509Certificate) -> Option> { - let mut subnames = Vec::new(); - if let Ok(Some(san)) = cert.subject_alternative_name() { - let san = san.value; - for name in &san.general_names { - if let GeneralName::DNSName(name) = name { - subnames.push(name.to_string()); - } - } - } - Some(subnames) -} diff --git a/src/x509-info/src/output.rs b/src/x509-info/src/output.rs new file mode 100644 index 0000000..7cfa13e --- /dev/null +++ b/src/x509-info/src/output.rs @@ -0,0 +1,100 @@ +use chrono::prelude::*; +use std::net::{Ipv4Addr, Ipv6Addr}; +use x509_parser::prelude::*; + +/// How to format the output data. +#[derive(PartialEq, Eq, Debug, Copy, Clone, clap::ValueEnum)] +pub enum OutputFormat { + /// Format the output as one line of plain text. + Short, + + /// Format the output as plain text. + Long, +} + +impl OutputFormat { + pub fn print(self, cert: X509Certificate) { + match self { + Self::Short => { + self.short(cert); + } + Self::Long => { + self.to_text(cert); + } + } + } + + fn short(self, cert: X509Certificate) { + let not_after = chrono::Local.timestamp(cert.validity().not_after.timestamp(), 0); + let now: DateTime = Local::now(); + let remaining = not_after - now; + println!( + "{} is valid until {} ({} days left)", + cert.subject() + .iter_common_name() + .next() + .and_then(|cn| cn.as_str().ok()) + .unwrap(), + not_after.to_rfc2822(), + remaining.num_days(), + ); + } + + fn to_text(self, cert: X509Certificate) { + let not_before = chrono::Local.timestamp(cert.validity().not_before.timestamp(), 0); + let not_after = chrono::Local.timestamp(cert.validity().not_after.timestamp(), 0); + let now: DateTime = Local::now(); + let remaining = not_after - now; + let validity_duration = not_after - not_before; + + println!("certificate"); + println!(" version: {}", cert.version); + println!(" serial: {}", cert.tbs_certificate.raw_serial_as_string()); + println!(" subject: {}", cert.subject()); + println!(" issuer: {}", cert.issuer()); + + println!(" validity"); + println!(" not before : {}", not_before.to_rfc2822()); + println!(" not after : {}", not_after.to_rfc2822()); + println!(" validity days : {}", validity_duration.num_days()); + println!(" remaining days: {}", remaining.num_days()); + + println!(" SANs:"); + if let Some(subnames) = subject_alternative_name(cert) { + for name in subnames { + println!(" {}", name); + } + } + } +} + +fn subject_alternative_name(cert: X509Certificate) -> Option> { + let mut subnames = Vec::new(); + if let Ok(Some(san)) = cert.subject_alternative_name() { + let san = san.value; + for name in &san.general_names { + let s = match name { + GeneralName::DNSName(s) => format!("DNS:{}", s), + GeneralName::IPAddress(b) => { + let ip = match b.len() { + 4 => { + let b = <[u8; 4]>::try_from(*b).unwrap(); + let ip = Ipv4Addr::from(b); + format!("{}", ip) + } + 16 => { + let b = <[u8; 16]>::try_from(*b).unwrap(); + let ip = Ipv6Addr::from(b); + format!("{}", ip) + } + l => format!("invalid (len={})", l), + }; + format!("IP address:{}", ip) + } + _ => format!("{:?}", name), + }; + subnames.push(s); + } + } + Some(subnames) +} -- cgit v1.2.3 From 23f894be98c979d5dbf6fbb9f2ec20fe75b37290 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 13 Nov 2022 15:20:52 -0800 Subject: doc: update README --- src/x509-info/README.md | 62 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 55 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/x509-info/README.md b/src/x509-info/README.md index 39fc564..61d450e 100644 --- a/src/x509-info/README.md +++ b/src/x509-info/README.md @@ -4,14 +4,62 @@ At this point it's pretty clear that I'll never remember the syntax for `openssl` to show various information about a certificate. At last I will not have to google for that syntax ever again. +## Usage + ``` shell -$ x509-info github.com - Subject: CN=github.com O=GitHub, Inc. L=San Francisco - Issuer: CN=DigiCert TLS Hybrid ECC SHA384 2020 CA1 O=DigiCert Inc L= - DNS Names: github.com, www.github.com - Validity Period - Not before: 2022-03-14T17:00:00-07:00 - Not After: 2023-03-15T16:59:59-07:00 +> x509-info --help +Usage: x509-info [OPTIONS] + +Arguments: + + Domain to check + +Options: + -p, --port + Port to check + + [default: 443] + + -f, --format + [default: short] + + Possible values: + - short: Format the output as one line of plain text + - long: Format the output as plain text + + -h, --help + Print help information (use `-h` for a summary) + + -V, --version + Print version information ``` +The default format will print a short message: + +``` shell +> x509-info twitter.com +twitter.com is valid until Mon, 12 Dec 2022 15:59:59 -0800 (29 days left) +``` + +It's possible to get more details: + +``` shell +> x509-info --format long twitter.com +certificate + version: V3 + serial: 0d:e1:52:69:6b:2f:96:70:d6:c7:db:18:ce:1c:71:a0 + subject: C=US, ST=California, L=San Francisco, O=Twitter, Inc., CN=twitter.com + issuer: C=US, O=DigiCert Inc, CN=DigiCert TLS RSA SHA256 2020 CA1 + validity + not before : Sun, 12 Dec 2021 16:00:00 -0800 + not after : Mon, 12 Dec 2022 15:59:59 -0800 + validity days : 364 + remaining days: 29 + SANs: + DNS:twitter.com + DNS:www.twitter.com +``` + +## Notes + Could the same be achieved with a wrapper around `openssl` ? yes. -- cgit v1.2.3 From 51640af5aa964b8eafa28e06e49528588b937a36 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 28 Mar 2023 18:48:21 -0700 Subject: add a flag to check expired certificate Add the `--insecure` flag so we can check certificates that are expired. When using the short format for the output (the default), if the certificate has expired, it will report how many days ago. For certificates that have not expired, the remaining number of days will be printed. --- src/x509-info/Cargo.toml | 2 +- src/x509-info/README.md | 29 ++++++++++++++-------- src/x509-info/src/client.rs | 59 ++++++++++++++++++++++++++++++++++----------- src/x509-info/src/main.rs | 6 ++++- src/x509-info/src/output.rs | 34 ++++++++++++++++++-------- 5 files changed, 94 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/x509-info/Cargo.toml b/src/x509-info/Cargo.toml index 4120200..f6b4e3e 100644 --- a/src/x509-info/Cargo.toml +++ b/src/x509-info/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] chrono = {version = "0.4.20", features = ["clock"], default-features = false } clap = {version = "4.0.18", features = ["derive", "cargo"]} -rustls = "0.20.7" +rustls = {version = "0.20.7", features = ["dangerous_configuration"]} rustls-native-certs = "0.6.2" webpki-roots = "0.22.5" x509-parser = "0.14" diff --git a/src/x509-info/README.md b/src/x509-info/README.md index 61d450e..f7e9121 100644 --- a/src/x509-info/README.md +++ b/src/x509-info/README.md @@ -7,8 +7,7 @@ At this point it's pretty clear that I'll never remember the syntax for `openssl ## Usage ``` shell -> x509-info --help -Usage: x509-info [OPTIONS] +$ Usage: x509-info [OPTIONS] Arguments: @@ -20,6 +19,9 @@ Options: [default: 443] + -i, --insecure + Accept invalid certificate + -f, --format [default: short] @@ -37,29 +39,36 @@ Options: The default format will print a short message: ``` shell -> x509-info twitter.com -twitter.com is valid until Mon, 12 Dec 2022 15:59:59 -0800 (29 days left) +$ x509-info twitter.com +twitter.com: Mon, 11 Dec 2023 15:59:59 -0800 (257 days left) ``` It's possible to get more details: ``` shell -> x509-info --format long twitter.com +$ x509-info --format=long twitter.com certificate version: V3 - serial: 0d:e1:52:69:6b:2f:96:70:d6:c7:db:18:ce:1c:71:a0 + serial: 0a:2c:01:b8:2b:5d:47:73:9a:5a:01:1a:6f:dc:1a:20 subject: C=US, ST=California, L=San Francisco, O=Twitter, Inc., CN=twitter.com issuer: C=US, O=DigiCert Inc, CN=DigiCert TLS RSA SHA256 2020 CA1 validity - not before : Sun, 12 Dec 2021 16:00:00 -0800 - not after : Mon, 12 Dec 2022 15:59:59 -0800 - validity days : 364 - remaining days: 29 + not before : Sat, 10 Dec 2022 16:00:00 -0800 + not after : Mon, 11 Dec 2023 15:59:59 -0800 + validity days : 365 + remaining days: 257 SANs: DNS:twitter.com DNS:www.twitter.com ``` +You can also check expired certificates: + +``` shell +$ x509-info --insecure expired.badssl.com +: Sun, 12 Apr 2015 16:59:59 -0700 (it expired -2907 days ago) +``` + ## Notes Could the same be achieved with a wrapper around `openssl` ? yes. diff --git a/src/x509-info/src/client.rs b/src/x509-info/src/client.rs index 11c48db..344e300 100644 --- a/src/x509-info/src/client.rs +++ b/src/x509-info/src/client.rs @@ -6,22 +6,53 @@ use std::error::Error; use std::io::Write; use std::sync::Arc; -pub fn get_certificates(domain: String, port: u16) -> Result, Box> { +struct SkipServerVerification; + +impl SkipServerVerification { + fn new() -> Arc { + Arc::new(Self) + } +} +impl rustls::client::ServerCertVerifier for SkipServerVerification { + fn verify_server_cert( + &self, + _end_entity: &rustls::Certificate, + _intermediates: &[rustls::Certificate], + _server_name: &rustls::ServerName, + _scts: &mut dyn Iterator, + _ocsp_response: &[u8], + _now: std::time::SystemTime, + ) -> Result { + Ok(rustls::client::ServerCertVerified::assertion()) + } +} + +pub fn get_certificates( + domain: String, + port: u16, + insecure: bool, +) -> Result, Box> { let mut tcp_stream = std::net::TcpStream::connect(format!("{}:{}", domain, port))?; - let mut root_store = RootCertStore::empty(); - root_store.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(|ta| { - OwnedTrustAnchor::from_subject_spki_name_constraints( - ta.subject, - ta.spki, - ta.name_constraints, - ) - })); - - let config = ClientConfig::builder() - .with_safe_defaults() - .with_root_certificates(root_store) - .with_no_client_auth(); + let config = if insecure { + ClientConfig::builder() + .with_safe_defaults() + .with_custom_certificate_verifier(SkipServerVerification::new()) + .with_no_client_auth() + } else { + let mut root_store = RootCertStore::empty(); + root_store.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(|ta| { + OwnedTrustAnchor::from_subject_spki_name_constraints( + ta.subject, + ta.spki, + ta.name_constraints, + ) + })); + ClientConfig::builder() + .with_safe_defaults() + .with_root_certificates(root_store) + .with_no_client_auth() + }; let server_name = ServerName::try_from(domain.as_ref())?; diff --git a/src/x509-info/src/main.rs b/src/x509-info/src/main.rs index d9eed13..c318a3d 100644 --- a/src/x509-info/src/main.rs +++ b/src/x509-info/src/main.rs @@ -16,6 +16,10 @@ struct Args { #[clap(short, long, default_value_t = 443)] port: u16, + /// Accept invalid certificate + #[clap(short, long, default_value_t = false)] + insecure: bool, + #[clap(short, long,value_enum, default_value_t = output::OutputFormat::Short)] format: output::OutputFormat, } @@ -25,7 +29,7 @@ fn main() { let domain = args.domain; - let certs = client::get_certificates(domain, args.port); + let certs = client::get_certificates(domain, args.port, args.insecure); match certs { Ok(certs) => { diff --git a/src/x509-info/src/output.rs b/src/x509-info/src/output.rs index 7cfa13e..e38aff1 100644 --- a/src/x509-info/src/output.rs +++ b/src/x509-info/src/output.rs @@ -28,16 +28,30 @@ impl OutputFormat { let not_after = chrono::Local.timestamp(cert.validity().not_after.timestamp(), 0); let now: DateTime = Local::now(); let remaining = not_after - now; - println!( - "{} is valid until {} ({} days left)", - cert.subject() - .iter_common_name() - .next() - .and_then(|cn| cn.as_str().ok()) - .unwrap(), - not_after.to_rfc2822(), - remaining.num_days(), - ); + + if remaining >= chrono::Duration::zero() { + println!( + "{}: {} ({} days left)", + cert.subject() + .iter_common_name() + .next() + .and_then(|cn| cn.as_str().ok()) + .unwrap_or(""), + not_after.to_rfc2822(), + remaining.num_days(), + ); + } else { + println!( + "{}: {} (it expired {} days ago)", + cert.subject() + .iter_common_name() + .next() + .and_then(|cn| cn.as_str().ok()) + .unwrap_or(""), + not_after.to_rfc2822(), + remaining.num_days(), + ); + } } fn to_text(self, cert: X509Certificate) { -- cgit v1.2.3 From cdfe1f02e8e7848c500fb83f952add7158c9368e Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Thu, 30 Mar 2023 19:16:55 -0700 Subject: use anyhow for error handling --- src/x509-info/Cargo.lock | 7 +++++++ src/x509-info/Cargo.toml | 1 + src/x509-info/src/client.rs | 6 +++--- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/x509-info/Cargo.lock b/src/x509-info/Cargo.lock index 005aee6..e24318b 100644 --- a/src/x509-info/Cargo.lock +++ b/src/x509-info/Cargo.lock @@ -11,6 +11,12 @@ dependencies = [ "libc", ] +[[package]] +name = "anyhow" +version = "1.0.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" + [[package]] name = "asn1-rs" version = "0.5.1" @@ -857,6 +863,7 @@ checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" name = "x509-info" version = "0.1.0" dependencies = [ + "anyhow", "chrono", "clap", "rustls", diff --git a/src/x509-info/Cargo.toml b/src/x509-info/Cargo.toml index f6b4e3e..e358a44 100644 --- a/src/x509-info/Cargo.toml +++ b/src/x509-info/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +anyhow = "1.0.70" chrono = {version = "0.4.20", features = ["clock"], default-features = false } clap = {version = "4.0.18", features = ["derive", "cargo"]} rustls = {version = "0.20.7", features = ["dangerous_configuration"]} diff --git a/src/x509-info/src/client.rs b/src/x509-info/src/client.rs index 344e300..8728f93 100644 --- a/src/x509-info/src/client.rs +++ b/src/x509-info/src/client.rs @@ -1,7 +1,7 @@ +use anyhow::{anyhow, Error}; use rustls::{ Certificate, ClientConfig, ClientConnection, OwnedTrustAnchor, RootCertStore, ServerName, }; -use std::error::Error; use std::io::Write; use std::sync::Arc; @@ -31,7 +31,7 @@ pub fn get_certificates( domain: String, port: u16, insecure: bool, -) -> Result, Box> { +) -> Result, Error> { let mut tcp_stream = std::net::TcpStream::connect(format!("{}:{}", domain, port))?; let config = if insecure { @@ -69,6 +69,6 @@ pub fn get_certificates( match conn.peer_certificates() { Some(c) => Ok(c.to_vec()), - None => Err("no certificate found")?, + None => Err(anyhow!("no certificate found for {}", domain))?, } } -- cgit v1.2.3 From 6fcb18893ed334fc03cfcbf1d51bb63a96408d14 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Thu, 30 Mar 2023 19:17:59 -0700 Subject: simplify the main function --- src/x509-info/src/main.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/x509-info/src/main.rs b/src/x509-info/src/main.rs index c318a3d..d37ce0c 100644 --- a/src/x509-info/src/main.rs +++ b/src/x509-info/src/main.rs @@ -27,11 +27,7 @@ struct Args { fn main() { let args = Args::parse(); - let domain = args.domain; - - let certs = client::get_certificates(domain, args.port, args.insecure); - - match certs { + match client::get_certificates(args.domain, args.port, args.insecure) { Ok(certs) => { let (_, cert) = x509_parser::certificate::X509Certificate::from_der(certs[0].as_ref()).unwrap(); -- cgit v1.2.3 From cde127d05455f09cf0f2f790de9ff6253a7f6fee Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Thu, 30 Mar 2023 19:19:49 -0700 Subject: update metadata in Cargo.toml --- src/x509-info/Cargo.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/x509-info/Cargo.toml b/src/x509-info/Cargo.toml index e358a44..e8b16e7 100644 --- a/src/x509-info/Cargo.toml +++ b/src/x509-info/Cargo.toml @@ -2,8 +2,10 @@ name = "x509-info" version = "0.1.0" edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +authors = ["Franck Cuny "] +description = "Print summary of x509 certificates." +homepage = "https://git.fcuny.net/x509-info/about/" +readme = "README.md" [dependencies] anyhow = "1.0.70" -- cgit v1.2.3 From f06938bc360be14fec155872e77609acf5953af8 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Thu, 30 Mar 2023 19:21:22 -0700 Subject: remove configuration for drone --- src/x509-info/.drone.yml | 50 ------------------------------------------------ 1 file changed, 50 deletions(-) delete mode 100644 src/x509-info/.drone.yml (limited to 'src') diff --git a/src/x509-info/.drone.yml b/src/x509-info/.drone.yml deleted file mode 100644 index 7c469a4..0000000 --- a/src/x509-info/.drone.yml +++ /dev/null @@ -1,50 +0,0 @@ -kind: pipeline -type: docker -name: checks - -trigger: - event: - - push - - pull_request - - cron - -steps: - - name: Run checks - image: nixpkgs/nix-flakes:nixos-22.05 - commands: - - nix develop --command cargo fmt --check - - nix develop --command cargo deny check - - nix develop --command cargo clippy -- -D warnings ---- -kind: pipeline -type: docker -name: build - -trigger: - event: - - push - - pull_request - - cron - -steps: - - name: Run tests and build - image: nixpkgs/nix-flakes:nixos-22.05 - commands: - - nix develop --command cargo test - - nix build . - - nix run . -- fcuny.net - - nix run . -- --format long fcuny.net ---- -kind: pipeline -type: docker -name: flakes-update -trigger: - event: - - cron - -steps: - - name: update flakes - image: nixpkgs/nix-flakes:nixos-22.05 - commands: - - nix flake update --commit-lock-file - - nix develop -c git push origin --all -- cgit v1.2.3 From 8790ea90d279f4437b0467f54f84d0bbc1a1ccdd Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Wed, 5 Jul 2023 11:02:11 -0700 Subject: replace rust-overlay with naersk This is mostly coming from https://github.com/DeterminateSystems/nix-installer/blob/main/flake.nix --- src/x509-info/flake.lock | 186 ++++++++++++++++---------------- src/x509-info/flake.nix | 221 ++++++++++++++++++++++++-------------- src/x509-info/nix/check.nix | 44 ++++++++ src/x509-info/rust-toolchain.toml | 2 +- 4 files changed, 282 insertions(+), 171 deletions(-) create mode 100644 src/x509-info/nix/check.nix (limited to 'src') diff --git a/src/x509-info/flake.lock b/src/x509-info/flake.lock index f97f3bc..4542a21 100644 --- a/src/x509-info/flake.lock +++ b/src/x509-info/flake.lock @@ -1,36 +1,34 @@ { "nodes": { - "crane": { + "fenix": { "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils", "nixpkgs": [ "nixpkgs" ], - "rust-overlay": "rust-overlay" + "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1667522439, - "narHash": "sha256-1tDYoumL5337T4BkC87iRXbAfeyeeOXa5WAbeP/ENqQ=", - "owner": "ipetkov", - "repo": "crane", - "rev": "b70e77d2e2d480a3a0bce3ecd2d981679588b23f", + "lastModified": 1688538381, + "narHash": "sha256-CH4j882pozkEmzvOlnyflnla+BpzRL+DeOiGUz4aK2E=", + "owner": "nix-community", + "repo": "fenix", + "rev": "b95669bcfa88a372848fb9f5f24c1679e641e7e2", "type": "github" }, "original": { - "owner": "ipetkov", - "repo": "crane", + "owner": "nix-community", + "repo": "fenix", "type": "github" } }, "flake-compat": { "flake": false, "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", "owner": "edolstra", "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", "type": "github" }, "original": { @@ -39,128 +37,134 @@ "type": "github" } }, - "flake-utils": { + "lowdown-src": { + "flake": false, "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "lastModified": 1633514407, + "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", + "owner": "kristapsdz", + "repo": "lowdown", + "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "kristapsdz", + "repo": "lowdown", "type": "github" } }, - "flake-utils_2": { + "naersk": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "lastModified": 1688534083, + "narHash": "sha256-/bI5vsioXscQTsx+Hk9X5HfweeNZz/6kVKsbdqfwW7g=", + "owner": "nix-community", + "repo": "naersk", + "rev": "abca1fb7a6cfdd355231fc220c3d0302dbb4369a", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "nix-community", + "repo": "naersk", + "type": "github" + } + }, + "nix": { + "inputs": { + "lowdown-src": "lowdown-src", + "nixpkgs": "nixpkgs", + "nixpkgs-regression": "nixpkgs-regression" + }, + "locked": { + "lastModified": 1674678482, + "narHash": "sha256-MtVatZVsV+dtjdD4AC4bztrnDFas+WZYHzQMt41FwzU=", + "owner": "nixos", + "repo": "nix", + "rev": "435a16b5556f4171b4204a3f65c9dedf215f168c", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "2.13.2", + "repo": "nix", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1667877958, - "narHash": "sha256-InhzugdvWBvvR5/6hVDRngkSOeqjcw0SI9brZtY5y+g=", + "lastModified": 1670461440, + "narHash": "sha256-jy1LB8HOMKGJEGXgzFRLDU1CBGL0/LlkolgnqIsF0D8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1d29ae3a66395506fd85655a8d74279ad4f9098f", + "rev": "04a75b2eecc0acf6239acf9dd04485ff8d14f425", "type": "github" }, "original": { "owner": "NixOS", + "ref": "nixos-22.11-small", "repo": "nixpkgs", "type": "github" } }, - "pre-commit-hooks": { - "inputs": { - "flake-utils": [ - "flake-utils" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, + "nixpkgs-regression": { "locked": { - "lastModified": 1667760143, - "narHash": "sha256-+X5CyeNEKp41bY/I1AJgW/fn69q5cLJ1bgiaMMCKB3M=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "06f48d63d473516ce5b8abe70d15be96a0147fcd", + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", "type": "github" }, "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", "type": "github" } }, - "root": { - "inputs": { - "crane": "crane", - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs", - "pre-commit-hooks": "pre-commit-hooks", - "rust-overlay": "rust-overlay_2" - } - }, - "rust-overlay": { - "inputs": { - "flake-utils": [ - "crane", - "flake-utils" - ], - "nixpkgs": [ - "crane", - "nixpkgs" - ] - }, + "nixpkgs_2": { "locked": { - "lastModified": 1667487142, - "narHash": "sha256-bVuzLs1ZVggJAbJmEDVO9G6p8BH3HRaolK70KXvnWnU=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "cf668f737ac986c0a89e83b6b2e3c5ddbd8cf33b", + "lastModified": 1688556768, + "narHash": "sha256-mhd6g0iJGjEfOr3+6mZZOclUveeNr64OwxdbNtLc8mY=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "27bd67e55fe09f9d68c77ff151c3e44c4f81f7de", "type": "github" }, "original": { - "owner": "oxalica", - "repo": "rust-overlay", + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", "type": "github" } }, - "rust-overlay_2": { + "root": { "inputs": { - "flake-utils": [ - "flake-utils" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, + "fenix": "fenix", + "flake-compat": "flake-compat", + "naersk": "naersk", + "nix": "nix", + "nixpkgs": "nixpkgs_2" + } + }, + "rust-analyzer-src": { + "flake": false, "locked": { - "lastModified": 1667875464, - "narHash": "sha256-0rO2Pzn//ANT3AphpEUantCbm86XcmKNEKhM73LFr04=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "9235990723630e1a55e1ed6bca5954e4e31cfbd7", + "lastModified": 1688494220, + "narHash": "sha256-9rYDFNKgbSHis5k13pHLvXMMZLBrvKyu+xyzsArXAJw=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "e95644e279592ea36061633779a2648afeb9536f", "type": "github" }, "original": { - "owner": "oxalica", - "repo": "rust-overlay", + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", "type": "github" } } diff --git a/src/x509-info/flake.nix b/src/x509-info/flake.nix index 4b7967a..4b95c2e 100644 --- a/src/x509-info/flake.nix +++ b/src/x509-info/flake.nix @@ -2,103 +2,166 @@ description = "A CLI to display information about x509 certificates."; inputs = { - flake-utils.url = "github:numtide/flake-utils"; - nixpkgs.url = "github:NixOS/nixpkgs"; - rust-overlay = { - url = "github:oxalica/rust-overlay"; - inputs = { - flake-utils.follows = "flake-utils"; - nixpkgs.follows = "nixpkgs"; - }; + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + + fenix = { + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs"; }; - crane = { - url = "github:ipetkov/crane"; + + naersk = { + url = "github:nix-community/naersk"; inputs.nixpkgs.follows = "nixpkgs"; }; - pre-commit-hooks = { - url = "github:cachix/pre-commit-hooks.nix"; - inputs = { - flake-utils.follows = "flake-utils"; - nixpkgs.follows = "nixpkgs"; - }; + + nix = { + url = "github:nixos/nix/2.13.2"; }; + + flake-compat = { url = "github:edolstra/flake-compat"; flake = false; }; }; outputs = { self - , flake-utils , nixpkgs - , rust-overlay - , crane - , pre-commit-hooks - }: - - flake-utils.lib.eachDefaultSystem - (system: - let - pkgs = import nixpkgs { - inherit system; - overlays = [ (import rust-overlay) ]; - }; - rust-toolchain = (pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override { - extensions = [ "rust-src" ]; - }; + , fenix + , naersk + , nix + , ... + } @ inputs: + let + supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ]; - craneLib = (crane.mkLib pkgs).overrideScope' (_: _: { - cargo = rust-toolchain; - clippy = rust-toolchain; - rustc = rust-toolchain; - rustfmt = rust-toolchain; - }); + forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: (forSystem system f)); - src = ./.; + forSystem = system: f: f rec { + inherit system; + pkgs = import nixpkgs { inherit system; overlays = [ self.overlays.default ]; }; + lib = pkgs.lib; + }; - cargoArtifacts = craneLib.buildDepsOnly { - inherit src; - }; + fenixToolchain = system: with fenix.packages.${system}; + combine ([ + stable.clippy + stable.rustc + stable.cargo + stable.rustfmt + stable.rust-src + ] ++ nixpkgs.lib.optionals (system == "x86_64-linux") [ + targets.x86_64-unknown-linux-musl.stable.rust-std + ]); + in + { + overlays.default = final: prev: + let + toolchain = fenixToolchain final.stdenv.system; + naerskLib = final.callPackage naersk { + cargo = toolchain; + rustc = toolchain; + }; + sharedAttrs = { + pname = "x509-info"; + version = "0.1.0"; + src = builtins.path { + name = "x509-info"; + path = self; + }; - x509-info = craneLib.buildPackage { - inherit cargoArtifacts src; - }; - in - { - packages.default = x509-info; - apps.default = flake-utils.lib.mkApp { - drv = x509-info; - }; + nativeBuildInputs = with final; [ ]; + buildInputs = with final; [ ] ++ lib.optionals (final.stdenv.isDarwin) (with final.darwin.apple_sdk.frameworks; [ + SystemConfiguration + ]); + + copyBins = true; + copyDocsToSeparateOutput = true; + + doCheck = true; + doDoc = true; + doDocFail = true; + cargoTestOptions = f: f ++ [ "--all" ]; - checks = { - pre-commit = pre-commit-hooks.lib.${system}.run { - inherit src; - hooks = { - clippy = { - enable = true; - entry = pkgs.lib.mkForce "cargo clippy -- -D warnings"; - }; - nixpkgs-fmt = { - enable = true; - }; - rustfmt = { - enable = true; - entry = pkgs.lib.mkForce "cargo fmt -- --check --color always"; - }; + override = { preBuild ? "", ... }: { + preBuild = preBuild + '' + # logRun "cargo clippy --all-targets --all-features -- -D warnings" + ''; }; }; + in + rec { + x509-info = naerskLib.buildPackage sharedAttrs; + } // nixpkgs.lib.optionalAttrs (prev.stdenv.system == "x86_64-linux") rec { + default = x509-info-static; + x509-info-static = naerskLib.buildPackage + (sharedAttrs // { + CARGO_BUILD_TARGET = "x86_64-unknown-linux-musl"; + }); }; - devShell = pkgs.mkShell { - nativeBuildInputs = with pkgs; [ - rust-toolchain - cargo-deny - ]; + devShells = forAllSystems ({ system, pkgs, ... }: + let + toolchain = fenixToolchain system; + check = import ./nix/check.nix { inherit pkgs toolchain; }; + in + { + default = pkgs.mkShell { + name = "x509-info-shell"; - inherit (self.checks.${system}.pre-commit) shellHook; - }; - }) - // { - overlay = final: prev: { - x509-info = self.packages.${prev.system}.default; - }; + RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library"; + + nativeBuildInputs = with pkgs; [ ]; + buildInputs = with pkgs; [ + toolchain + rust-analyzer + cargo-outdated + cacert + cargo-audit + nixpkgs-fmt + check.check-rustfmt + check.check-spelling + check.check-nixpkgs-fmt + check.check-semver + ] + ++ lib.optionals (pkgs.stdenv.isDarwin) (with pkgs; [ + libiconv + darwin.apple_sdk.frameworks.Security + ]) + ++ lib.optionals (pkgs.stdenv.isLinux) (with pkgs; [ + checkpolicy + ]); + }; + }); + + checks = forAllSystems ({ system, pkgs, ... }: + let + toolchain = fenixToolchain system; + check = import ./nix/check.nix { inherit pkgs toolchain; }; + in + { + check-rustfmt = pkgs.runCommand "check-rustfmt" { buildInputs = [ check.check-rustfmt ]; } '' + cd ${./.} + check-rustfmt + touch $out + ''; + check-spelling = pkgs.runCommand "check-spelling" { buildInputs = [ check.check-spelling ]; } '' + cd ${./.} + check-spelling + touch $out + ''; + check-nixpkgs-fmt = pkgs.runCommand "check-nixpkgs-fmt" { buildInputs = [ check.check-nixpkgs-fmt ]; } '' + cd ${./.} + check-nixpkgs-fmt + touch $out + ''; + }); + + packages = forAllSystems ({ system, pkgs, ... }: + { + inherit (pkgs) x509-info; + } // nixpkgs.lib.optionalAttrs (system == "x86_64-linux") { + inherit (pkgs) x509-info-static; + default = pkgs.x509-info-static; + } // nixpkgs.lib.optionalAttrs (pkgs.stdenv.isDarwin) { + default = pkgs.x509-info; + }); }; } - diff --git a/src/x509-info/nix/check.nix b/src/x509-info/nix/check.nix new file mode 100644 index 0000000..4d7743c --- /dev/null +++ b/src/x509-info/nix/check.nix @@ -0,0 +1,44 @@ +{ pkgs, toolchain }: + +let + inherit (pkgs) writeShellApplication; +in +{ + + # Format + check-rustfmt = (writeShellApplication { + name = "check-rustfmt"; + runtimeInputs = [ toolchain ]; + text = "cargo fmt --check"; + }); + + # Spelling + check-spelling = (writeShellApplication { + name = "check-spelling"; + runtimeInputs = with pkgs; [ git codespell ]; + text = '' + codespell \ + --ignore-words-list="crate" \ + --skip="./target,.git" \ + . + ''; + }); + + # NixFormatting + check-nixpkgs-fmt = (writeShellApplication { + name = "check-nixpkgs-fmt"; + runtimeInputs = with pkgs; [ git nixpkgs-fmt findutils ]; + text = '' + nixpkgs-fmt --check . + ''; + }); + + # Semver + check-semver = (writeShellApplication { + name = "check-semver"; + runtimeInputs = with pkgs; [ cargo-semver-checks ]; + text = '' + cargo-semver-checks semver-checks check-release + ''; + }); +} diff --git a/src/x509-info/rust-toolchain.toml b/src/x509-info/rust-toolchain.toml index e7ae097..f4ebfd7 100644 --- a/src/x509-info/rust-toolchain.toml +++ b/src/x509-info/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.64.0" +channel = "stable" components = [ "rustfmt", "clippy" ] -- cgit v1.2.3 From c623767f6522392e1ea3fe0caf47da9e4055d312 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 15 Apr 2024 19:34:43 -0700 Subject: add some workflows for CI and dependabot config --- src/x509-info/.github/dependabot.yml | 10 +++++++ src/x509-info/.github/workflows/ci.yml | 47 ++++++++++++++++++++++++++++++ src/x509-info/.github/workflows/update.yml | 29 ++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 src/x509-info/.github/dependabot.yml create mode 100644 src/x509-info/.github/workflows/ci.yml create mode 100644 src/x509-info/.github/workflows/update.yml (limited to 'src') diff --git a/src/x509-info/.github/dependabot.yml b/src/x509-info/.github/dependabot.yml new file mode 100644 index 0000000..d062b44 --- /dev/null +++ b/src/x509-info/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "weekly" diff --git a/src/x509-info/.github/workflows/ci.yml b/src/x509-info/.github/workflows/ci.yml new file mode 100644 index 0000000..271b774 --- /dev/null +++ b/src/x509-info/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +name: CI checks + +on: [push, pull_request] + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run tests + run: cargo test + - name: Verify working directory is clean + run: git diff --exit-code + + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: cargo fetch + - name: Build for target + run: cargo build --verbose + + bitrot: + name: Bitrot + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check unused code + run: cargo check --all-targets --all-features + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check clippy + run: cargo clippy + + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check formatting + run: cargo fmt --all -- --check diff --git a/src/x509-info/.github/workflows/update.yml b/src/x509-info/.github/workflows/update.yml new file mode 100644 index 0000000..788b88d --- /dev/null +++ b/src/x509-info/.github/workflows/update.yml @@ -0,0 +1,29 @@ +name: 'Update flake.lock' +on: + workflow_dispatch: + schedule: + - cron: '30 5 * * 0' + +# you need to grant permissions to create PR: +# https://github.com/DeterminateSystems/update-flake-lock/issues/75 +jobs: + update-flake-lock: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install Nix + uses: cachix/install-nix-action@v26 + with: + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + - name: Update flake.lock + id: update-flake-lock + uses: DeterminateSystems/update-flake-lock@v21 + with: + pr-title: "Update flake.lock" + commit-msg: "chore: update flake" + pr-assignees: fcuny + pr-labels: | + dependencies + automated -- cgit v1.2.3 From 229934f1b2a186aa4a65aa30fdd23831c3a0daa7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 02:35:36 +0000 Subject: build(deps): bump x509-parser from 0.14.0 to 0.16.0 Bumps [x509-parser](https://github.com/rusticata/x509-parser) from 0.14.0 to 0.16.0. - [Release notes](https://github.com/rusticata/x509-parser/releases) - [Changelog](https://github.com/rusticata/x509-parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/rusticata/x509-parser/compare/x509-parser-0.14.0...x509-parser-0.16.0) --- updated-dependencies: - dependency-name: x509-parser dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- src/x509-info/Cargo.lock | 143 ++++++++++++++++++++++++++++------------------- src/x509-info/Cargo.toml | 2 +- 2 files changed, 88 insertions(+), 57 deletions(-) (limited to 'src') diff --git a/src/x509-info/Cargo.lock b/src/x509-info/Cargo.lock index e24318b..306cd60 100644 --- a/src/x509-info/Cargo.lock +++ b/src/x509-info/Cargo.lock @@ -19,9 +19,9 @@ checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" [[package]] name = "asn1-rs" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf6690c370453db30743b373a60ba498fc0d6d83b11f4abfd87a84a075db5dd4" +checksum = "22ad1373757efa0f70ec53939aabc7152e1591cb485208052993070ac8d2429d" dependencies = [ "asn1-rs-derive", "asn1-rs-impl", @@ -35,25 +35,25 @@ dependencies = [ [[package]] name = "asn1-rs-derive" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.59", "synstructure", ] [[package]] name = "asn1-rs-impl" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" +checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.59", ] [[package]] @@ -140,7 +140,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -202,7 +202,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn", + "syn 1.0.103", ] [[package]] @@ -219,7 +219,7 @@ checksum = "309e4fb93eed90e1e14bea0da16b209f81813ba9fc7830c20ed151dd7bc0a4d7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -230,9 +230,9 @@ checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" [[package]] name = "der-parser" -version = "8.1.0" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42d4bc9b0db0a0df9ae64634ac5bdefb7afcb534e182275ca0beadbe486701c1" +checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" dependencies = [ "asn1-rs", "displaydoc", @@ -242,6 +242,15 @@ dependencies = [ "rusticata-macros", ] +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + [[package]] name = "displaydoc" version = "0.2.3" @@ -250,7 +259,7 @@ checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -370,6 +379,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-integer" version = "0.1.45" @@ -389,20 +404,11 @@ dependencies = [ "autocfg", ] -[[package]] -name = "num_threads" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" -dependencies = [ - "libc", -] - [[package]] name = "oid-registry" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d4bda43fd1b844cbc6e6e54b5444e2b1bc7838bce59ad205902cccbb26d6761" +checksum = "1c958dd45046245b9c3c2547369bb634eb461670b2e7e0de552905801a648d1d" dependencies = [ "asn1-rs", ] @@ -425,6 +431,12 @@ version = "6.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3baf96e39c5359d2eb0dd6ccb42c62b91d9678aa68160d261b9e0ccbf9e9dea9" +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -434,7 +446,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.103", "version_check", ] @@ -451,18 +463,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.47" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +checksum = "a56dea16b0a29e94408b9aa5e2940a4eedbd128a1ba20e8f7ae60fd3d465af0e" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.21" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -575,9 +587,23 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.147" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.59", +] [[package]] name = "spin" @@ -602,16 +628,26 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a6531ffc7b071655e4ce2e04bd464c4830bb585a61cabb96cf808f05172615a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "synstructure" -version = "0.12.6" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn", - "unicode-xid", + "syn 2.0.59", ] [[package]] @@ -640,18 +676,19 @@ checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] name = "time" -version = "0.3.16" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fab5c8b9980850e06d92ddbe3ab839c062c801f3927c0fb8abd6fc8e918fbca" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ + "deranged", "itoa", - "libc", - "num_threads", + "num-conv", + "powerfmt", "serde", "time-core", "time-macros", @@ -659,16 +696,17 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.5" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bb801831d812c562ae7d2bfb531f26e66e4e1f6b17307ba4149c5064710e5b" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] @@ -684,12 +722,6 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - [[package]] name = "untrusted" version = "0.7.1" @@ -723,7 +755,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.103", "wasm-bindgen-shared", ] @@ -745,7 +777,7 @@ checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -874,12 +906,11 @@ dependencies = [ [[package]] name = "x509-parser" -version = "0.14.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" +checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" dependencies = [ "asn1-rs", - "base64", "data-encoding", "der-parser", "lazy_static", diff --git a/src/x509-info/Cargo.toml b/src/x509-info/Cargo.toml index e8b16e7..fb5fda3 100644 --- a/src/x509-info/Cargo.toml +++ b/src/x509-info/Cargo.toml @@ -14,4 +14,4 @@ clap = {version = "4.0.18", features = ["derive", "cargo"]} rustls = {version = "0.20.7", features = ["dangerous_configuration"]} rustls-native-certs = "0.6.2" webpki-roots = "0.22.5" -x509-parser = "0.14" +x509-parser = "0.16" -- cgit v1.2.3 From 229b4f8fbf8a89479a40df03adc2df17cf8b481e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 02:35:51 +0000 Subject: build(deps): bump anyhow from 1.0.70 to 1.0.82 Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.70 to 1.0.82. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://github.com/dtolnay/anyhow/compare/1.0.70...1.0.82) --- updated-dependencies: - dependency-name: anyhow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- src/x509-info/Cargo.lock | 4 ++-- src/x509-info/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/x509-info/Cargo.lock b/src/x509-info/Cargo.lock index e24318b..158bc35 100644 --- a/src/x509-info/Cargo.lock +++ b/src/x509-info/Cargo.lock @@ -13,9 +13,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.70" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" +checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" [[package]] name = "asn1-rs" diff --git a/src/x509-info/Cargo.toml b/src/x509-info/Cargo.toml index e8b16e7..1905137 100644 --- a/src/x509-info/Cargo.toml +++ b/src/x509-info/Cargo.toml @@ -8,7 +8,7 @@ homepage = "https://git.fcuny.net/x509-info/about/" readme = "README.md" [dependencies] -anyhow = "1.0.70" +anyhow = "1.0.82" chrono = {version = "0.4.20", features = ["clock"], default-features = false } clap = {version = "4.0.18", features = ["derive", "cargo"]} rustls = {version = "0.20.7", features = ["dangerous_configuration"]} -- cgit v1.2.3 From ac816e390dc8e225031bdbc64b490414cf8d702b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 02:37:49 +0000 Subject: build(deps): bump rustls from 0.20.7 to 0.21.10 Bumps [rustls](https://github.com/rustls/rustls) from 0.20.7 to 0.21.10. - [Release notes](https://github.com/rustls/rustls/releases) - [Changelog](https://github.com/rustls/rustls/blob/main/CHANGELOG.md) - [Commits](https://github.com/rustls/rustls/compare/v/0.20.7...v/0.21.10) --- updated-dependencies: - dependency-name: rustls dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- src/x509-info/Cargo.lock | 167 +++++++++++++++++++++++++++++++++++++++++------ src/x509-info/Cargo.toml | 2 +- 2 files changed, 148 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/x509-info/Cargo.lock b/src/x509-info/Cargo.lock index 16c0dc5..4cb5320 100644 --- a/src/x509-info/Cargo.lock +++ b/src/x509-info/Cargo.lock @@ -93,9 +93,9 @@ checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "cc" -version = "1.0.74" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581f5dba903aac52ea3feb5ec4810848460ee833876f1f9b0fdeab1f19091574" +checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7" [[package]] name = "cfg-if" @@ -262,6 +262,17 @@ dependencies = [ "syn 1.0.103", ] +[[package]] +name = "getrandom" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + [[package]] name = "heck" version = "0.4.0" @@ -324,9 +335,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.137" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "link-cplusplus" @@ -488,12 +499,27 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", - "untrusted", + "spin 0.5.2", + "untrusted 0.7.1", "web-sys", "winapi", ] +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.52.0", +] + [[package]] name = "rusticata-macros" version = "4.1.0" @@ -505,14 +531,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.7" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring", + "ring 0.17.8", + "rustls-webpki", "sct", - "webpki", ] [[package]] @@ -536,6 +562,16 @@ dependencies = [ "base64", ] +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring 0.17.8", + "untrusted 0.9.0", +] + [[package]] name = "schannel" version = "0.1.20" @@ -543,7 +579,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" dependencies = [ "lazy_static", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -558,8 +594,8 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -611,6 +647,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "strsim" version = "0.10.0" @@ -728,12 +770,24 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + [[package]] name = "wasm-bindgen" version = "0.2.83" @@ -804,8 +858,8 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -854,43 +908,116 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.52.5", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" + [[package]] name = "windows_aarch64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" + [[package]] name = "windows_i686_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +[[package]] +name = "windows_i686_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" + [[package]] name = "windows_i686_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +[[package]] +name = "windows_i686_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" + [[package]] name = "windows_x86_64_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" + [[package]] name = "windows_x86_64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" + [[package]] name = "x509-info" version = "0.1.0" diff --git a/src/x509-info/Cargo.toml b/src/x509-info/Cargo.toml index 48426e7..d600c8f 100644 --- a/src/x509-info/Cargo.toml +++ b/src/x509-info/Cargo.toml @@ -11,7 +11,7 @@ readme = "README.md" anyhow = "1.0.82" chrono = {version = "0.4.20", features = ["clock"], default-features = false } clap = {version = "4.0.18", features = ["derive", "cargo"]} -rustls = {version = "0.20.7", features = ["dangerous_configuration"]} +rustls = {version = "0.21.10", features = ["dangerous_configuration"]} rustls-native-certs = "0.6.2" webpki-roots = "0.22.5" x509-parser = "0.16" -- cgit v1.2.3 From 12c6e2a122442acb9e3da09a87dd1544c000ee2e Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 16 Apr 2024 19:56:31 -0700 Subject: clippy should fail on warnings --- src/x509-info/.github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/x509-info/.github/workflows/ci.yml b/src/x509-info/.github/workflows/ci.yml index 271b774..ba21a0a 100644 --- a/src/x509-info/.github/workflows/ci.yml +++ b/src/x509-info/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Check clippy - run: cargo clippy + run: cargo clippy -- -Dwarnings fmt: name: Rustfmt -- cgit v1.2.3 From 617ba1686743f562503c38eab736969fe69a12a7 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 16 Apr 2024 19:58:14 -0700 Subject: use `add_trust_anchors` ``` error: use of deprecated method `rustls::RootCertStore::add_server_trust_anchors`: Please use `add_trust_anchors` instead ``` --- src/x509-info/src/client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/x509-info/src/client.rs b/src/x509-info/src/client.rs index 8728f93..1eb7e09 100644 --- a/src/x509-info/src/client.rs +++ b/src/x509-info/src/client.rs @@ -41,7 +41,7 @@ pub fn get_certificates( .with_no_client_auth() } else { let mut root_store = RootCertStore::empty(); - root_store.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(|ta| { + root_store.add_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(|ta| { OwnedTrustAnchor::from_subject_spki_name_constraints( ta.subject, ta.spki, -- cgit v1.2.3 From d9e0ff7ca0f8adfa47b8a091fc48f7454059ffc7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 12:14:23 +0000 Subject: build(deps): bump clap from 4.0.18 to 4.5.4 Bumps [clap](https://github.com/clap-rs/clap) from 4.0.18 to 4.5.4. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.18...v4.5.4) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- src/x509-info/Cargo.lock | 151 +++++++++++++++++++++++++---------------------- src/x509-info/Cargo.toml | 2 +- 2 files changed, 80 insertions(+), 73 deletions(-) (limited to 'src') diff --git a/src/x509-info/Cargo.lock b/src/x509-info/Cargo.lock index 4cb5320..13e1b72 100644 --- a/src/x509-info/Cargo.lock +++ b/src/x509-info/Cargo.lock @@ -11,6 +11,54 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" + +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "anyhow" version = "1.0.82" @@ -56,17 +104,6 @@ dependencies = [ "syn 2.0.59", ] -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -117,40 +154,43 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.18" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335867764ed2de42325fafe6d18b8af74ba97ee0c590fa016f157535b42ab04b" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ - "atty", - "bitflags", + "clap_builder", "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +dependencies = [ + "anstream", + "anstyle", "clap_lex", - "once_cell", "strsim", - "termcolor", ] [[package]] name = "clap_derive" -version = "4.0.18" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16a1b0f6422af32d5da0c58e2703320f379216ee70198241c84173a8c5ac28f3" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ "heck", - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.103", + "syn 2.0.59", ] [[package]] name = "clap_lex" -version = "0.3.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" -dependencies = [ - "os_str_bytes", -] +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "codespan-reporting" @@ -162,6 +202,12 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "core-foundation" version = "0.9.3" @@ -275,18 +321,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" - -[[package]] -name = "hermit-abi" -version = "0.1.19" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "iana-time-zone" @@ -436,42 +473,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "os_str_bytes" -version = "6.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3baf96e39c5359d2eb0dd6ccb42c62b91d9678aa68160d261b9e0ccbf9e9dea9" - [[package]] name = "powerfmt" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.103", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro2" version = "1.0.80" @@ -655,9 +662,9 @@ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" @@ -777,10 +784,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] -name = "version_check" -version = "0.9.4" +name = "utf8parse" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "wasi" diff --git a/src/x509-info/Cargo.toml b/src/x509-info/Cargo.toml index d600c8f..a91f126 100644 --- a/src/x509-info/Cargo.toml +++ b/src/x509-info/Cargo.toml @@ -10,7 +10,7 @@ readme = "README.md" [dependencies] anyhow = "1.0.82" chrono = {version = "0.4.20", features = ["clock"], default-features = false } -clap = {version = "4.0.18", features = ["derive", "cargo"]} +clap = {version = "4.5.4", features = ["derive", "cargo"]} rustls = {version = "0.21.10", features = ["dangerous_configuration"]} rustls-native-certs = "0.6.2" webpki-roots = "0.22.5" -- cgit v1.2.3 From 015c2773ad49b137a0721514cc2f2af3f9525106 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 17:19:37 +0000 Subject: bump a number of dependencies to their latest versions Updating all these dependencies required some significant code change. --- src/x509-info/Cargo.lock | 699 ++++++++++++++++++++++++-------------------- src/x509-info/Cargo.toml | 8 +- src/x509-info/flake.lock | 30 +- src/x509-info/src/client.rs | 102 ++++--- src/x509-info/src/output.rs | 12 +- 5 files changed, 486 insertions(+), 365 deletions(-) (limited to 'src') diff --git a/src/x509-info/Cargo.lock b/src/x509-info/Cargo.lock index 13e1b72..f8d3e27 100644 --- a/src/x509-info/Cargo.lock +++ b/src/x509-info/Cargo.lock @@ -2,6 +2,21 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -46,7 +61,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -56,7 +71,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -89,7 +104,7 @@ checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn", "synstructure", ] @@ -101,20 +116,70 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" + +[[package]] +name = "aws-lc-rs" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5509d663b2c00ee421bda8d6a24d6c42e15970957de1701b8df9f6fbe5707df1" +dependencies = [ + "aws-lc-sys", + "mirai-annotations", + "paste", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "8d5d317212c2a78d86ba6622e969413c38847b62f48111f8b763af3dac2f9840" +dependencies = [ + "bindgen", + "cc", + "cmake", + "dunce", + "fs_extra", + "libc", + "paste", +] [[package]] name = "base64" -version = "0.13.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" + +[[package]] +name = "bindgen" +version = "0.69.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +dependencies = [ + "bitflags 2.5.0", + "cexpr", + "clang-sys", + "itertools", + "lazy_static", + "lazycell", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", + "which", +] [[package]] name = "bitflags" @@ -122,17 +187,37 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + [[package]] name = "bumpalo" -version = "3.11.1" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "cc" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7" +checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" +dependencies = [ + "jobserver", + "libc", + "once_cell", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] [[package]] name = "cfg-if" @@ -142,14 +227,25 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.22" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ + "android-tzdata", "iana-time-zone", - "num-integer", "num-traits", - "winapi", + "windows-targets", +] + +[[package]] +name = "clang-sys" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +dependencies = [ + "glob", + "libc", + "libloading", ] [[package]] @@ -183,7 +279,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.59", + "syn", ] [[package]] @@ -193,13 +289,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] -name = "codespan-reporting" -version = "0.11.1" +name = "cmake" +version = "0.1.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" dependencies = [ - "termcolor", - "unicode-width", + "cc", ] [[package]] @@ -210,9 +305,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -220,59 +315,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" - -[[package]] -name = "cxx" -version = "1.0.80" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b7d4e43b25d3c994662706a1d4fcfc32aaa6afd287502c111b237093bb23f3a" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f8829ddc213e2c1368e51a2564c552b65a8cb6a28f31e576270ac81d5e5827" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote", - "scratch", - "syn 1.0.103", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e72537424b474af1460806647c41d4b6d35d09ef7fe031c5c2fa5766047cc56a" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "309e4fb93eed90e1e14bea0da16b209f81813ba9fc7830c20ed151dd7bc0a4d7" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.103", -] +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "data-encoding" -version = "2.3.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "der-parser" @@ -299,15 +350,43 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", + "syn", +] + +[[package]] +name = "dunce" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" + +[[package]] +name = "either" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "getrandom" version = "0.2.14" @@ -319,47 +398,79 @@ dependencies = [ "wasi", ] +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys", +] + [[package]] name = "iana-time-zone" -version = "0.1.53" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi", + "windows-core", ] [[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]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", ] [[package]] name = "itoa" -version = "1.0.4" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "jobserver" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +dependencies = [ + "libc", +] [[package]] name = "js-sys" -version = "0.3.60" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -370,6 +481,12 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + [[package]] name = "libc" version = "0.2.153" @@ -377,28 +494,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] -name = "link-cplusplus" -version = "1.0.7" +name = "libloading" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ - "cc", + "cfg-if", + "windows-targets", ] +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + [[package]] name = "log" -version = "0.4.17" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "minimal-lexical" @@ -406,11 +527,17 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +[[package]] +name = "mirai-annotations" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" + [[package]] name = "nom" -version = "7.1.1" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", @@ -418,9 +545,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -435,19 +562,18 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -463,9 +589,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.16.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl-probe" @@ -473,17 +599,33 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + [[package]] name = "powerfmt" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +[[package]] +name = "prettyplease" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ac2cf0f2e4f42b49f5ffd07dae8d746508ef7526c13940e5f524012ae6c6550" +dependencies = [ + "proc-macro2", + "syn", +] + [[package]] name = "proc-macro2" -version = "1.0.80" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56dea16b0a29e94408b9aa5e2940a4eedbd128a1ba20e8f7ae60fd3d465af0e" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] @@ -498,20 +640,34 @@ dependencies = [ ] [[package]] -name = "ring" -version = "0.16.20" +name = "regex" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", ] +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" + [[package]] name = "ring" version = "0.17.8" @@ -522,11 +678,17 @@ dependencies = [ "cfg-if", "getrandom", "libc", - "spin 0.9.8", - "untrusted 0.9.0", - "windows-sys 0.52.0", + "spin", + "untrusted", + "windows-sys", ] +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rusticata-macros" version = "4.1.0" @@ -536,82 +698,92 @@ dependencies = [ "nom", ] +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + [[package]] name = "rustls" -version = "0.21.10" +version = "0.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "afabcee0551bd1aa3e18e5adbf2c0544722014b899adb31bd186ec638d3da97e" dependencies = [ + "aws-lc-rs", "log", - "ring 0.17.8", + "once_cell", + "ring", + "rustls-pki-types", "rustls-webpki", - "sct", + "subtle", + "zeroize", ] [[package]] name = "rustls-native-certs" -version = "0.6.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" dependencies = [ "openssl-probe", "rustls-pemfile", + "rustls-pki-types", "schannel", "security-framework", ] [[package]] name = "rustls-pemfile" -version = "1.0.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ "base64", + "rustls-pki-types", ] [[package]] -name = "rustls-webpki" -version = "0.101.7" +name = "rustls-pki-types" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", -] +checksum = "beb461507cee2c2ff151784c52762cf4d9ff6a61f3e80968600ed24fa837fa54" [[package]] -name = "schannel" -version = "0.1.20" +name = "rustls-webpki" +version = "0.102.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +checksum = "f3bce581c0dd41bce533ce695a1437fa16a7ab5ac3ccfa99fe1a620a7885eabf" dependencies = [ - "lazy_static", - "windows-sys 0.36.1", + "aws-lc-rs", + "ring", + "rustls-pki-types", + "untrusted", ] [[package]] -name = "scratch" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" - -[[package]] -name = "sct" -version = "0.7.0" +name = "schannel" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "windows-sys", ] [[package]] name = "security-framework" -version = "2.7.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -620,9 +792,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.6.1" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" dependencies = [ "core-foundation-sys", "libc", @@ -630,29 +802,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.197" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", + "syn", ] [[package]] -name = "spin" -version = "0.5.2" +name = "shlex" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "spin" @@ -667,21 +839,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "syn" -version = "1.0.103" +name = "subtle" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "2.0.59" +version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a6531ffc7b071655e4ce2e04bd464c4830bb585a61cabb96cf808f05172615a" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", @@ -696,36 +863,27 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.59", -] - -[[package]] -name = "termcolor" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" -dependencies = [ - "winapi-util", + "syn", ] [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", + "syn", ] [[package]] @@ -761,21 +919,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.5" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" - -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "untrusted" @@ -797,9 +943,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -807,24 +953,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.103", + "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -832,94 +978,51 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 1.0.103", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" - -[[package]] -name = "web-sys" -version = "0.3.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" -dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", -] +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "webpki-roots" -version = "0.22.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" -dependencies = [ - "webpki", -] - -[[package]] -name = "winapi" -version = "0.3.9" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "rustls-pki-types", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" +name = "which" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ - "winapi", + "either", + "home", + "once_cell", + "rustix", ] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.36.1" +name = "windows-core" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", + "windows-targets", ] [[package]] @@ -938,13 +1041,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_msvc", + "windows_i686_gnu", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", + "windows_i686_msvc", + "windows_x86_64_gnu", "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.52.5", + "windows_x86_64_msvc", ] [[package]] @@ -953,24 +1056,12 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" -[[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" - [[package]] name = "windows_aarch64_msvc" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" -[[package]] -name = "windows_i686_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" - [[package]] name = "windows_i686_gnu" version = "0.52.5" @@ -983,24 +1074,12 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" -[[package]] -name = "windows_i686_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" - [[package]] name = "windows_i686_msvc" version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" - [[package]] name = "windows_x86_64_gnu" version = "0.52.5" @@ -1013,12 +1092,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" -[[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" - [[package]] name = "windows_x86_64_msvc" version = "0.52.5" @@ -1054,3 +1127,9 @@ dependencies = [ "thiserror", "time", ] + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/src/x509-info/Cargo.toml b/src/x509-info/Cargo.toml index a91f126..ca9abde 100644 --- a/src/x509-info/Cargo.toml +++ b/src/x509-info/Cargo.toml @@ -9,9 +9,9 @@ readme = "README.md" [dependencies] anyhow = "1.0.82" -chrono = {version = "0.4.20", features = ["clock"], default-features = false } +chrono = {version = "0.4.38", features = ["clock"], default-features = false } clap = {version = "4.5.4", features = ["derive", "cargo"]} -rustls = {version = "0.21.10", features = ["dangerous_configuration"]} -rustls-native-certs = "0.6.2" -webpki-roots = "0.22.5" +rustls = {version = "0.23.5", features = ["ring"]} +rustls-native-certs = "0.7.0" +webpki-roots = "0.26.1" x509-parser = "0.16" diff --git a/src/x509-info/flake.lock b/src/x509-info/flake.lock index 4542a21..89d56ee 100644 --- a/src/x509-info/flake.lock +++ b/src/x509-info/flake.lock @@ -8,11 +8,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1688538381, - "narHash": "sha256-CH4j882pozkEmzvOlnyflnla+BpzRL+DeOiGUz4aK2E=", + "lastModified": 1714285404, + "narHash": "sha256-MmoQIO+KRiH3UnH0myAp2Fgi84rmpROMfw9VIbqrjHA=", "owner": "nix-community", "repo": "fenix", - "rev": "b95669bcfa88a372848fb9f5f24c1679e641e7e2", + "rev": "94be183087845937b0fd77281c37d0796572b899", "type": "github" }, "original": { @@ -24,11 +24,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -60,11 +60,11 @@ ] }, "locked": { - "lastModified": 1688534083, - "narHash": "sha256-/bI5vsioXscQTsx+Hk9X5HfweeNZz/6kVKsbdqfwW7g=", + "lastModified": 1713520724, + "narHash": "sha256-CO8MmVDmqZX2FovL75pu5BvwhW+Vugc7Q6ze7Hj8heI=", "owner": "nix-community", "repo": "naersk", - "rev": "abca1fb7a6cfdd355231fc220c3d0302dbb4369a", + "rev": "c5037590290c6c7dae2e42e7da1e247e54ed2d49", "type": "github" }, "original": { @@ -128,11 +128,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1688556768, - "narHash": "sha256-mhd6g0iJGjEfOr3+6mZZOclUveeNr64OwxdbNtLc8mY=", + "lastModified": 1714245158, + "narHash": "sha256-9P2M0+tf1TE7Z5PwDVwhheuD2mFf6/phPr0Jvl7cxcc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "27bd67e55fe09f9d68c77ff151c3e44c4f81f7de", + "rev": "2b1f64b358f2cab62617f26b3870fd0ee375d848", "type": "github" }, "original": { @@ -154,11 +154,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1688494220, - "narHash": "sha256-9rYDFNKgbSHis5k13pHLvXMMZLBrvKyu+xyzsArXAJw=", + "lastModified": 1714217560, + "narHash": "sha256-zttBYGaoHpZfqWHQ8OI5f9OkGHCHb8tDBMySwsYNa2U=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "e95644e279592ea36061633779a2648afeb9536f", + "rev": "f216be4a0746142c5f30835b254871256a7637b8", "type": "github" }, "original": { diff --git a/src/x509-info/src/client.rs b/src/x509-info/src/client.rs index 1eb7e09..83e010c 100644 --- a/src/x509-info/src/client.rs +++ b/src/x509-info/src/client.rs @@ -1,29 +1,60 @@ use anyhow::{anyhow, Error}; -use rustls::{ - Certificate, ClientConfig, ClientConnection, OwnedTrustAnchor, RootCertStore, ServerName, -}; +use rustls::client::danger::{HandshakeSignatureValid, ServerCertVerified, ServerCertVerifier}; +use rustls::crypto::{ring, verify_tls12_signature, verify_tls13_signature, CryptoProvider}; +use rustls::pki_types::{self, CertificateDer, ServerName, UnixTime}; +use rustls::{ClientConfig, ClientConnection}; +use rustls::{DigitallySignedStruct, SignatureScheme}; use std::io::Write; use std::sync::Arc; -struct SkipServerVerification; +#[derive(Debug)] +struct NoCertificateVerification {} -impl SkipServerVerification { - fn new() -> Arc { - Arc::new(Self) - } -} -impl rustls::client::ServerCertVerifier for SkipServerVerification { +impl ServerCertVerifier for NoCertificateVerification { fn verify_server_cert( &self, - _end_entity: &rustls::Certificate, - _intermediates: &[rustls::Certificate], - _server_name: &rustls::ServerName, - _scts: &mut dyn Iterator, + _end_entity: &CertificateDer<'_>, + _intermediates: &[CertificateDer<'_>], + _server_name: &pki_types::ServerName<'_>, _ocsp_response: &[u8], - _now: std::time::SystemTime, - ) -> Result { - Ok(rustls::client::ServerCertVerified::assertion()) + _now: UnixTime, + ) -> Result { + Ok(ServerCertVerified::assertion()) + } + + fn verify_tls12_signature( + &self, + message: &[u8], + cert: &CertificateDer<'_>, + dss: &DigitallySignedStruct, + ) -> Result { + verify_tls12_signature( + message, + cert, + dss, + &ring::default_provider().signature_verification_algorithms, + ) + } + + fn verify_tls13_signature( + &self, + message: &[u8], + cert: &CertificateDer<'_>, + dss: &DigitallySignedStruct, + ) -> Result { + verify_tls13_signature( + message, + cert, + dss, + &ring::default_provider().signature_verification_algorithms, + ) + } + + fn supported_verify_schemes(&self) -> Vec { + ring::default_provider() + .signature_verification_algorithms + .supported_schemes() } } @@ -31,30 +62,35 @@ pub fn get_certificates( domain: String, port: u16, insecure: bool, -) -> Result, Error> { +) -> Result>, Error> { let mut tcp_stream = std::net::TcpStream::connect(format!("{}:{}", domain, port))?; let config = if insecure { ClientConfig::builder() - .with_safe_defaults() - .with_custom_certificate_verifier(SkipServerVerification::new()) + .dangerous() + .with_custom_certificate_verifier(Arc::new(NoCertificateVerification {})) .with_no_client_auth() } else { - let mut root_store = RootCertStore::empty(); - root_store.add_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(|ta| { - OwnedTrustAnchor::from_subject_spki_name_constraints( - ta.subject, - ta.spki, - ta.name_constraints, - ) - })); - ClientConfig::builder() - .with_safe_defaults() - .with_root_certificates(root_store) - .with_no_client_auth() + let root_store = rustls::RootCertStore { + roots: webpki_roots::TLS_SERVER_ROOTS.to_vec(), + }; + ClientConfig::builder_with_provider( + CryptoProvider { + cipher_suites: vec![ring::cipher_suite::TLS13_CHACHA20_POLY1305_SHA256], + kx_groups: vec![ring::kx_group::X25519], + ..ring::default_provider() + } + .into(), + ) + .with_protocol_versions(&[&rustls::version::TLS13]) + .unwrap() + .with_root_certificates(root_store) + .with_no_client_auth() }; - let server_name = ServerName::try_from(domain.as_ref())?; + let server_name = ServerName::try_from(domain.clone()) + .expect("invalid DNS name") + .to_owned(); let mut conn = ClientConnection::new(Arc::new(config), server_name)?; while conn.wants_write() { diff --git a/src/x509-info/src/output.rs b/src/x509-info/src/output.rs index e38aff1..963ef20 100644 --- a/src/x509-info/src/output.rs +++ b/src/x509-info/src/output.rs @@ -25,7 +25,9 @@ impl OutputFormat { } fn short(self, cert: X509Certificate) { - let not_after = chrono::Local.timestamp(cert.validity().not_after.timestamp(), 0); + let not_after = chrono::Local + .timestamp_opt(cert.validity().not_after.timestamp(), 0) + .unwrap(); let now: DateTime = Local::now(); let remaining = not_after - now; @@ -55,8 +57,12 @@ impl OutputFormat { } fn to_text(self, cert: X509Certificate) { - let not_before = chrono::Local.timestamp(cert.validity().not_before.timestamp(), 0); - let not_after = chrono::Local.timestamp(cert.validity().not_after.timestamp(), 0); + let not_before = chrono::Local + .timestamp_opt(cert.validity().not_before.timestamp(), 0) + .unwrap(); + let not_after = chrono::Local + .timestamp_opt(cert.validity().not_after.timestamp(), 0) + .unwrap(); let now: DateTime = Local::now(); let remaining = not_after - now; let validity_duration = not_after - not_before; -- cgit v1.2.3 From 25f7eabb6f3f5d7874b38e013810d26fec7a66f1 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 28 Apr 2024 19:28:46 -0700 Subject: fix URL to the repository --- src/x509-info/Cargo.toml | 2 +- src/x509-info/README.md | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/x509-info/Cargo.toml b/src/x509-info/Cargo.toml index ca9abde..fb9e6ca 100644 --- a/src/x509-info/Cargo.toml +++ b/src/x509-info/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" authors = ["Franck Cuny "] description = "Print summary of x509 certificates." -homepage = "https://git.fcuny.net/x509-info/about/" +homepage = "https://github.com/fcuny/x509-info/" readme = "README.md" [dependencies] diff --git a/src/x509-info/README.md b/src/x509-info/README.md index f7e9121..a269ee5 100644 --- a/src/x509-info/README.md +++ b/src/x509-info/README.md @@ -1,7 +1,5 @@ # x509-info -[![Build Status](https://ci.fcuny.net/api/badges/fcuny/x509-info/status.svg)](https://ci.fcuny.net/fcuny/x509-info) - At this point it's pretty clear that I'll never remember the syntax for `openssl` to show various information about a certificate. At last I will not have to google for that syntax ever again. ## Usage -- cgit v1.2.3 From 4c49b6ae25f34b5da4c0c27606502f5498a0975f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 12 May 2024 20:04:15 +0000 Subject: chore: update flake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'fenix': 'github:nix-community/fenix/94be183087845937b0fd77281c37d0796572b899' (2024-04-28) → 'github:nix-community/fenix/297c756ba6249d483c1dafe42378560458842173' (2024-05-10) • Updated input 'fenix/rust-analyzer-src': 'github:rust-lang/rust-analyzer/f216be4a0746142c5f30835b254871256a7637b8' (2024-04-27) → 'github:rust-lang/rust-analyzer/5bf2f85c8054d80424899fa581db1b192230efb5' (2024-05-09) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/2b1f64b358f2cab62617f26b3870fd0ee375d848' (2024-04-27) → 'github:nixos/nixpkgs/af8b9db5c00f1a8e4b83578acc578ff7d823b786' (2024-05-12) --- src/x509-info/flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/x509-info/flake.lock b/src/x509-info/flake.lock index 89d56ee..c8c37af 100644 --- a/src/x509-info/flake.lock +++ b/src/x509-info/flake.lock @@ -8,11 +8,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1714285404, - "narHash": "sha256-MmoQIO+KRiH3UnH0myAp2Fgi84rmpROMfw9VIbqrjHA=", + "lastModified": 1715322226, + "narHash": "sha256-ezoe/FwfJpA7sskLoLP2iwfwkYnscEFCP6Vk5kPwh9k=", "owner": "nix-community", "repo": "fenix", - "rev": "94be183087845937b0fd77281c37d0796572b899", + "rev": "297c756ba6249d483c1dafe42378560458842173", "type": "github" }, "original": { @@ -128,11 +128,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1714245158, - "narHash": "sha256-9P2M0+tf1TE7Z5PwDVwhheuD2mFf6/phPr0Jvl7cxcc=", + "lastModified": 1715499532, + "narHash": "sha256-9UJLb8rdi2VokYcfOBQHUzP3iNxOPNWcbK++ENElpk0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2b1f64b358f2cab62617f26b3870fd0ee375d848", + "rev": "af8b9db5c00f1a8e4b83578acc578ff7d823b786", "type": "github" }, "original": { @@ -154,11 +154,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1714217560, - "narHash": "sha256-zttBYGaoHpZfqWHQ8OI5f9OkGHCHb8tDBMySwsYNa2U=", + "lastModified": 1715255944, + "narHash": "sha256-vLLgYpdtKBaGYTamNLg1rbRo1bPXp4Jgded/gnprPVw=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "f216be4a0746142c5f30835b254871256a7637b8", + "rev": "5bf2f85c8054d80424899fa581db1b192230efb5", "type": "github" }, "original": { -- cgit v1.2.3 From 77f03267bd0ab6fd4f1a41cec4a84b08191440b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 12:54:33 +0000 Subject: build(deps): bump rustls from 0.23.5 to 0.23.8 Bumps [rustls](https://github.com/rustls/rustls) from 0.23.5 to 0.23.8. - [Release notes](https://github.com/rustls/rustls/releases) - [Changelog](https://github.com/rustls/rustls/blob/main/CHANGELOG.md) - [Commits](https://github.com/rustls/rustls/compare/v/0.23.5...v/0.23.8) --- updated-dependencies: - dependency-name: rustls dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- src/x509-info/Cargo.lock | 12 ++++++------ src/x509-info/Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/x509-info/Cargo.lock b/src/x509-info/Cargo.lock index f8d3e27..fe00909 100644 --- a/src/x509-info/Cargo.lock +++ b/src/x509-info/Cargo.lock @@ -713,9 +713,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.5" +version = "0.23.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afabcee0551bd1aa3e18e5adbf2c0544722014b899adb31bd186ec638d3da97e" +checksum = "79adb16721f56eb2d843e67676896a61ce7a0fa622dc18d3e372477a029d2740" dependencies = [ "aws-lc-rs", "log", @@ -752,15 +752,15 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.5.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beb461507cee2c2ff151784c52762cf4d9ff6a61f3e80968600ed24fa837fa54" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" -version = "0.102.3" +version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3bce581c0dd41bce533ce695a1437fa16a7ab5ac3ccfa99fe1a620a7885eabf" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ "aws-lc-rs", "ring", diff --git a/src/x509-info/Cargo.toml b/src/x509-info/Cargo.toml index fb9e6ca..28f48c0 100644 --- a/src/x509-info/Cargo.toml +++ b/src/x509-info/Cargo.toml @@ -11,7 +11,7 @@ readme = "README.md" anyhow = "1.0.82" chrono = {version = "0.4.38", features = ["clock"], default-features = false } clap = {version = "4.5.4", features = ["derive", "cargo"]} -rustls = {version = "0.23.5", features = ["ring"]} +rustls = {version = "0.23.8", features = ["ring"]} rustls-native-certs = "0.7.0" webpki-roots = "0.26.1" x509-parser = "0.16" -- cgit v1.2.3 From b8c1e2aa1e38d44401e8bfaa575f347ece680ae6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 2 Jun 2024 05:31:18 +0000 Subject: chore: update flake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'fenix': 'github:nix-community/fenix/297c756ba6249d483c1dafe42378560458842173' (2024-05-10) → 'github:nix-community/fenix/9a025daf6799e3af80b677f0af57ef76432c3fcf' (2024-06-01) • Updated input 'fenix/rust-analyzer-src': 'github:rust-lang/rust-analyzer/5bf2f85c8054d80424899fa581db1b192230efb5' (2024-05-09) → 'github:rust-lang/rust-analyzer/d6d735e6f20ef78b16a79886fe28bd69cf059504' (2024-05-31) • Updated input 'naersk': 'github:nix-community/naersk/c5037590290c6c7dae2e42e7da1e247e54ed2d49' (2024-04-19) → 'github:nix-community/naersk/fa19d8c135e776dc97f4dcca08656a0eeb28d5c0' (2024-05-30) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/af8b9db5c00f1a8e4b83578acc578ff7d823b786' (2024-05-12) → 'github:nixos/nixpkgs/6132b0f6e344ce2fe34fc051b72fb46e34f668e0' (2024-05-30) --- src/x509-info/flake.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/x509-info/flake.lock b/src/x509-info/flake.lock index c8c37af..54d179a 100644 --- a/src/x509-info/flake.lock +++ b/src/x509-info/flake.lock @@ -8,11 +8,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1715322226, - "narHash": "sha256-ezoe/FwfJpA7sskLoLP2iwfwkYnscEFCP6Vk5kPwh9k=", + "lastModified": 1717223092, + "narHash": "sha256-ih8NPk3Jn5EAILOGQZ+KS5NLmu6QmwohJX+36MaTAQE=", "owner": "nix-community", "repo": "fenix", - "rev": "297c756ba6249d483c1dafe42378560458842173", + "rev": "9a025daf6799e3af80b677f0af57ef76432c3fcf", "type": "github" }, "original": { @@ -60,11 +60,11 @@ ] }, "locked": { - "lastModified": 1713520724, - "narHash": "sha256-CO8MmVDmqZX2FovL75pu5BvwhW+Vugc7Q6ze7Hj8heI=", + "lastModified": 1717067539, + "narHash": "sha256-oIs5EF+6VpHJRvvpVWuqCYJMMVW/6h59aYUv9lABLtY=", "owner": "nix-community", "repo": "naersk", - "rev": "c5037590290c6c7dae2e42e7da1e247e54ed2d49", + "rev": "fa19d8c135e776dc97f4dcca08656a0eeb28d5c0", "type": "github" }, "original": { @@ -128,11 +128,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1715499532, - "narHash": "sha256-9UJLb8rdi2VokYcfOBQHUzP3iNxOPNWcbK++ENElpk0=", + "lastModified": 1717112898, + "narHash": "sha256-7R2ZvOnvd9h8fDd65p0JnB7wXfUvreox3xFdYWd1BnY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "af8b9db5c00f1a8e4b83578acc578ff7d823b786", + "rev": "6132b0f6e344ce2fe34fc051b72fb46e34f668e0", "type": "github" }, "original": { @@ -154,11 +154,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1715255944, - "narHash": "sha256-vLLgYpdtKBaGYTamNLg1rbRo1bPXp4Jgded/gnprPVw=", + "lastModified": 1717169693, + "narHash": "sha256-qBruki5NHrSqIw5ulxtwFmVsb6W/aOKOMjsCJjfalA4=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "5bf2f85c8054d80424899fa581db1b192230efb5", + "rev": "d6d735e6f20ef78b16a79886fe28bd69cf059504", "type": "github" }, "original": { -- cgit v1.2.3 From 3b48f5c1cdf57997c674ad1542a7b929f758e679 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 23 Jun 2024 05:31:26 +0000 Subject: chore: update flake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'fenix': 'github:nix-community/fenix/9a025daf6799e3af80b677f0af57ef76432c3fcf' (2024-06-01) → 'github:nix-community/fenix/bedf55efd03d4796a3ddb267d7e081cc6b34483d' (2024-06-22) • Updated input 'fenix/rust-analyzer-src': 'github:rust-lang/rust-analyzer/d6d735e6f20ef78b16a79886fe28bd69cf059504' (2024-05-31) → 'github:rust-lang/rust-analyzer/c4681ea2cc1f2d1e1a0568ad03069c57bdcd7a88' (2024-06-21) • Updated input 'naersk': 'github:nix-community/naersk/fa19d8c135e776dc97f4dcca08656a0eeb28d5c0' (2024-05-30) → 'github:nix-community/naersk/941ce6dc38762a7cfb90b5add223d584feed299b' (2024-06-18) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/6132b0f6e344ce2fe34fc051b72fb46e34f668e0' (2024-05-30) → 'github:nixos/nixpkgs/90338afd6177fc683a04d934199d693708c85a3b' (2024-06-21) --- src/x509-info/flake.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/x509-info/flake.lock b/src/x509-info/flake.lock index 54d179a..db7ada2 100644 --- a/src/x509-info/flake.lock +++ b/src/x509-info/flake.lock @@ -8,11 +8,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1717223092, - "narHash": "sha256-ih8NPk3Jn5EAILOGQZ+KS5NLmu6QmwohJX+36MaTAQE=", + "lastModified": 1719037638, + "narHash": "sha256-+x7sc7OPYwi8OPebZ4Pqtzo9XyRcG5Sx7UZSGdj7HVs=", "owner": "nix-community", "repo": "fenix", - "rev": "9a025daf6799e3af80b677f0af57ef76432c3fcf", + "rev": "bedf55efd03d4796a3ddb267d7e081cc6b34483d", "type": "github" }, "original": { @@ -60,11 +60,11 @@ ] }, "locked": { - "lastModified": 1717067539, - "narHash": "sha256-oIs5EF+6VpHJRvvpVWuqCYJMMVW/6h59aYUv9lABLtY=", + "lastModified": 1718727675, + "narHash": "sha256-uFsCwWYI2pUpt0awahSBorDUrUfBhaAiyz+BPTS2MHk=", "owner": "nix-community", "repo": "naersk", - "rev": "fa19d8c135e776dc97f4dcca08656a0eeb28d5c0", + "rev": "941ce6dc38762a7cfb90b5add223d584feed299b", "type": "github" }, "original": { @@ -128,11 +128,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1717112898, - "narHash": "sha256-7R2ZvOnvd9h8fDd65p0JnB7wXfUvreox3xFdYWd1BnY=", + "lastModified": 1718983919, + "narHash": "sha256-+1xgeIow4gJeiwo4ETvMRvWoircnvb0JOt7NS9kUhoM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "6132b0f6e344ce2fe34fc051b72fb46e34f668e0", + "rev": "90338afd6177fc683a04d934199d693708c85a3b", "type": "github" }, "original": { @@ -154,11 +154,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1717169693, - "narHash": "sha256-qBruki5NHrSqIw5ulxtwFmVsb6W/aOKOMjsCJjfalA4=", + "lastModified": 1718992362, + "narHash": "sha256-Roaz1CckctannQVyhfwJ7sqmCGmU3hfTo/7Nmms06WM=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "d6d735e6f20ef78b16a79886fe28bd69cf059504", + "rev": "c4681ea2cc1f2d1e1a0568ad03069c57bdcd7a88", "type": "github" }, "original": { -- cgit v1.2.3 From a7e699eab23468da7c57a60b8db58e0b1896f092 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 13:07:25 +0000 Subject: build(deps): bump webpki-roots from 0.26.1 to 0.26.3 Bumps [webpki-roots](https://github.com/rustls/webpki-roots) from 0.26.1 to 0.26.3. - [Release notes](https://github.com/rustls/webpki-roots/releases) - [Commits](https://github.com/rustls/webpki-roots/compare/v/0.26.1...v/0.26.3) --- updated-dependencies: - dependency-name: webpki-roots dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- src/x509-info/Cargo.lock | 4 ++-- src/x509-info/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/x509-info/Cargo.lock b/src/x509-info/Cargo.lock index fe00909..1fcfad0 100644 --- a/src/x509-info/Cargo.lock +++ b/src/x509-info/Cargo.lock @@ -997,9 +997,9 @@ checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "webpki-roots" -version = "0.26.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" dependencies = [ "rustls-pki-types", ] diff --git a/src/x509-info/Cargo.toml b/src/x509-info/Cargo.toml index 28f48c0..d07f959 100644 --- a/src/x509-info/Cargo.toml +++ b/src/x509-info/Cargo.toml @@ -13,5 +13,5 @@ chrono = {version = "0.4.38", features = ["clock"], default-features = false } clap = {version = "4.5.4", features = ["derive", "cargo"]} rustls = {version = "0.23.8", features = ["ring"]} rustls-native-certs = "0.7.0" -webpki-roots = "0.26.1" +webpki-roots = "0.26.3" x509-parser = "0.16" -- cgit v1.2.3 From c24a17fdc0f1f673fdc96d3584eca4939f600d9b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 12:22:01 +0000 Subject: build(deps): bump clap from 4.5.4 to 4.5.8 Bumps [clap](https://github.com/clap-rs/clap) from 4.5.4 to 4.5.8. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.4...v4.5.8) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- src/x509-info/Cargo.lock | 12 ++++++------ src/x509-info/Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/x509-info/Cargo.lock b/src/x509-info/Cargo.lock index 1fcfad0..6e8a026 100644 --- a/src/x509-info/Cargo.lock +++ b/src/x509-info/Cargo.lock @@ -250,9 +250,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.4" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "84b3edb18336f4df585bc9aa31dd99c036dfa5dc5e9a2939a722a188f3a8970d" dependencies = [ "clap_builder", "clap_derive", @@ -260,9 +260,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "c1c09dd5ada6c6c78075d6fd0da3f90d8080651e2d6cc8eb2f1aaa4034ced708" dependencies = [ "anstream", "anstyle", @@ -272,9 +272,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.4" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" dependencies = [ "heck", "proc-macro2", diff --git a/src/x509-info/Cargo.toml b/src/x509-info/Cargo.toml index d07f959..24f0478 100644 --- a/src/x509-info/Cargo.toml +++ b/src/x509-info/Cargo.toml @@ -10,7 +10,7 @@ readme = "README.md" [dependencies] anyhow = "1.0.82" chrono = {version = "0.4.38", features = ["clock"], default-features = false } -clap = {version = "4.5.4", features = ["derive", "cargo"]} +clap = {version = "4.5.8", features = ["derive", "cargo"]} rustls = {version = "0.23.8", features = ["ring"]} rustls-native-certs = "0.7.0" webpki-roots = "0.26.3" -- cgit v1.2.3 From 8158f8f87b541d8f0eb36c9c6574e950157db860 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 12:47:38 +0000 Subject: build(deps): bump DeterminateSystems/update-flake-lock from 21 to 23 Bumps [DeterminateSystems/update-flake-lock](https://github.com/determinatesystems/update-flake-lock) from 21 to 23. - [Release notes](https://github.com/determinatesystems/update-flake-lock/releases) - [Commits](https://github.com/determinatesystems/update-flake-lock/compare/v21...v23) --- updated-dependencies: - dependency-name: DeterminateSystems/update-flake-lock dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- src/x509-info/.github/workflows/update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/x509-info/.github/workflows/update.yml b/src/x509-info/.github/workflows/update.yml index 788b88d..fab8d59 100644 --- a/src/x509-info/.github/workflows/update.yml +++ b/src/x509-info/.github/workflows/update.yml @@ -19,7 +19,7 @@ jobs: access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - name: Update flake.lock id: update-flake-lock - uses: DeterminateSystems/update-flake-lock@v21 + uses: DeterminateSystems/update-flake-lock@v23 with: pr-title: "Update flake.lock" commit-msg: "chore: update flake" -- cgit v1.2.3 From 1f1dd178db63068867520ece2530ecf20f34a6ed Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Fri, 29 Aug 2025 09:11:42 -0700 Subject: remove unused files --- src/x509-info/.envrc | 1 - src/x509-info/.github/dependabot.yml | 10 -- src/x509-info/.github/workflows/ci.yml | 47 -------- src/x509-info/.github/workflows/update.yml | 29 ----- src/x509-info/.gitignore | 3 - src/x509-info/LICENSE | 20 ---- src/x509-info/flake.lock | 174 ----------------------------- src/x509-info/flake.nix | 167 --------------------------- src/x509-info/nix/check.nix | 44 -------- src/x509-info/rust-toolchain.toml | 3 - src/x509-info/rustfmt.toml | 1 - 11 files changed, 499 deletions(-) delete mode 100644 src/x509-info/.envrc delete mode 100644 src/x509-info/.github/dependabot.yml delete mode 100644 src/x509-info/.github/workflows/ci.yml delete mode 100644 src/x509-info/.github/workflows/update.yml delete mode 100644 src/x509-info/.gitignore delete mode 100644 src/x509-info/LICENSE delete mode 100644 src/x509-info/flake.lock delete mode 100644 src/x509-info/flake.nix delete mode 100644 src/x509-info/nix/check.nix delete mode 100644 src/x509-info/rust-toolchain.toml delete mode 100644 src/x509-info/rustfmt.toml (limited to 'src') diff --git a/src/x509-info/.envrc b/src/x509-info/.envrc deleted file mode 100644 index a5dbbcb..0000000 --- a/src/x509-info/.envrc +++ /dev/null @@ -1 +0,0 @@ -use flake . diff --git a/src/x509-info/.github/dependabot.yml b/src/x509-info/.github/dependabot.yml deleted file mode 100644 index d062b44..0000000 --- a/src/x509-info/.github/dependabot.yml +++ /dev/null @@ -1,10 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - - package-ecosystem: "cargo" - directory: "/" - schedule: - interval: "weekly" diff --git a/src/x509-info/.github/workflows/ci.yml b/src/x509-info/.github/workflows/ci.yml deleted file mode 100644 index ba21a0a..0000000 --- a/src/x509-info/.github/workflows/ci.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: CI checks - -on: [push, pull_request] - -jobs: - test: - name: Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Run tests - run: cargo test - - name: Verify working directory is clean - run: git diff --exit-code - - build: - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - run: cargo fetch - - name: Build for target - run: cargo build --verbose - - bitrot: - name: Bitrot - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Check unused code - run: cargo check --all-targets --all-features - - clippy: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Check clippy - run: cargo clippy -- -Dwarnings - - fmt: - name: Rustfmt - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Check formatting - run: cargo fmt --all -- --check diff --git a/src/x509-info/.github/workflows/update.yml b/src/x509-info/.github/workflows/update.yml deleted file mode 100644 index fab8d59..0000000 --- a/src/x509-info/.github/workflows/update.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: 'Update flake.lock' -on: - workflow_dispatch: - schedule: - - cron: '30 5 * * 0' - -# you need to grant permissions to create PR: -# https://github.com/DeterminateSystems/update-flake-lock/issues/75 -jobs: - update-flake-lock: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install Nix - uses: cachix/install-nix-action@v26 - with: - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - name: Update flake.lock - id: update-flake-lock - uses: DeterminateSystems/update-flake-lock@v23 - with: - pr-title: "Update flake.lock" - commit-msg: "chore: update flake" - pr-assignees: fcuny - pr-labels: | - dependencies - automated diff --git a/src/x509-info/.gitignore b/src/x509-info/.gitignore deleted file mode 100644 index 53e2c1a..0000000 --- a/src/x509-info/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/target -/result -/.pre-commit-config.yaml diff --git a/src/x509-info/LICENSE b/src/x509-info/LICENSE deleted file mode 100644 index ac375e1..0000000 --- a/src/x509-info/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2022 Franck Cuny - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/x509-info/flake.lock b/src/x509-info/flake.lock deleted file mode 100644 index db7ada2..0000000 --- a/src/x509-info/flake.lock +++ /dev/null @@ -1,174 +0,0 @@ -{ - "nodes": { - "fenix": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ], - "rust-analyzer-src": "rust-analyzer-src" - }, - "locked": { - "lastModified": 1719037638, - "narHash": "sha256-+x7sc7OPYwi8OPebZ4Pqtzo9XyRcG5Sx7UZSGdj7HVs=", - "owner": "nix-community", - "repo": "fenix", - "rev": "bedf55efd03d4796a3ddb267d7e081cc6b34483d", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "fenix", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "lowdown-src": { - "flake": false, - "locked": { - "lastModified": 1633514407, - "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", - "owner": "kristapsdz", - "repo": "lowdown", - "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", - "type": "github" - }, - "original": { - "owner": "kristapsdz", - "repo": "lowdown", - "type": "github" - } - }, - "naersk": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1718727675, - "narHash": "sha256-uFsCwWYI2pUpt0awahSBorDUrUfBhaAiyz+BPTS2MHk=", - "owner": "nix-community", - "repo": "naersk", - "rev": "941ce6dc38762a7cfb90b5add223d584feed299b", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "naersk", - "type": "github" - } - }, - "nix": { - "inputs": { - "lowdown-src": "lowdown-src", - "nixpkgs": "nixpkgs", - "nixpkgs-regression": "nixpkgs-regression" - }, - "locked": { - "lastModified": 1674678482, - "narHash": "sha256-MtVatZVsV+dtjdD4AC4bztrnDFas+WZYHzQMt41FwzU=", - "owner": "nixos", - "repo": "nix", - "rev": "435a16b5556f4171b4204a3f65c9dedf215f168c", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "2.13.2", - "repo": "nix", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1670461440, - "narHash": "sha256-jy1LB8HOMKGJEGXgzFRLDU1CBGL0/LlkolgnqIsF0D8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "04a75b2eecc0acf6239acf9dd04485ff8d14f425", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-22.11-small", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-regression": { - "locked": { - "lastModified": 1643052045, - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1718983919, - "narHash": "sha256-+1xgeIow4gJeiwo4ETvMRvWoircnvb0JOt7NS9kUhoM=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "90338afd6177fc683a04d934199d693708c85a3b", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "fenix": "fenix", - "flake-compat": "flake-compat", - "naersk": "naersk", - "nix": "nix", - "nixpkgs": "nixpkgs_2" - } - }, - "rust-analyzer-src": { - "flake": false, - "locked": { - "lastModified": 1718992362, - "narHash": "sha256-Roaz1CckctannQVyhfwJ7sqmCGmU3hfTo/7Nmms06WM=", - "owner": "rust-lang", - "repo": "rust-analyzer", - "rev": "c4681ea2cc1f2d1e1a0568ad03069c57bdcd7a88", - "type": "github" - }, - "original": { - "owner": "rust-lang", - "ref": "nightly", - "repo": "rust-analyzer", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/src/x509-info/flake.nix b/src/x509-info/flake.nix deleted file mode 100644 index 4b95c2e..0000000 --- a/src/x509-info/flake.nix +++ /dev/null @@ -1,167 +0,0 @@ -{ - description = "A CLI to display information about x509 certificates."; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - - fenix = { - url = "github:nix-community/fenix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - naersk = { - url = "github:nix-community/naersk"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - nix = { - url = "github:nixos/nix/2.13.2"; - }; - - flake-compat = { url = "github:edolstra/flake-compat"; flake = false; }; - }; - - outputs = - { self - , nixpkgs - , fenix - , naersk - , nix - , ... - } @ inputs: - let - supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ]; - - forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: (forSystem system f)); - - forSystem = system: f: f rec { - inherit system; - pkgs = import nixpkgs { inherit system; overlays = [ self.overlays.default ]; }; - lib = pkgs.lib; - }; - - fenixToolchain = system: with fenix.packages.${system}; - combine ([ - stable.clippy - stable.rustc - stable.cargo - stable.rustfmt - stable.rust-src - ] ++ nixpkgs.lib.optionals (system == "x86_64-linux") [ - targets.x86_64-unknown-linux-musl.stable.rust-std - ]); - in - { - overlays.default = final: prev: - let - toolchain = fenixToolchain final.stdenv.system; - naerskLib = final.callPackage naersk { - cargo = toolchain; - rustc = toolchain; - }; - sharedAttrs = { - pname = "x509-info"; - version = "0.1.0"; - src = builtins.path { - name = "x509-info"; - path = self; - }; - - nativeBuildInputs = with final; [ ]; - buildInputs = with final; [ ] ++ lib.optionals (final.stdenv.isDarwin) (with final.darwin.apple_sdk.frameworks; [ - SystemConfiguration - ]); - - copyBins = true; - copyDocsToSeparateOutput = true; - - doCheck = true; - doDoc = true; - doDocFail = true; - cargoTestOptions = f: f ++ [ "--all" ]; - - override = { preBuild ? "", ... }: { - preBuild = preBuild + '' - # logRun "cargo clippy --all-targets --all-features -- -D warnings" - ''; - }; - }; - in - rec { - x509-info = naerskLib.buildPackage sharedAttrs; - } // nixpkgs.lib.optionalAttrs (prev.stdenv.system == "x86_64-linux") rec { - default = x509-info-static; - x509-info-static = naerskLib.buildPackage - (sharedAttrs // { - CARGO_BUILD_TARGET = "x86_64-unknown-linux-musl"; - }); - }; - - devShells = forAllSystems ({ system, pkgs, ... }: - let - toolchain = fenixToolchain system; - check = import ./nix/check.nix { inherit pkgs toolchain; }; - in - { - default = pkgs.mkShell { - name = "x509-info-shell"; - - RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library"; - - nativeBuildInputs = with pkgs; [ ]; - buildInputs = with pkgs; [ - toolchain - rust-analyzer - cargo-outdated - cacert - cargo-audit - nixpkgs-fmt - check.check-rustfmt - check.check-spelling - check.check-nixpkgs-fmt - check.check-semver - ] - ++ lib.optionals (pkgs.stdenv.isDarwin) (with pkgs; [ - libiconv - darwin.apple_sdk.frameworks.Security - ]) - ++ lib.optionals (pkgs.stdenv.isLinux) (with pkgs; [ - checkpolicy - ]); - }; - }); - - checks = forAllSystems ({ system, pkgs, ... }: - let - toolchain = fenixToolchain system; - check = import ./nix/check.nix { inherit pkgs toolchain; }; - in - { - check-rustfmt = pkgs.runCommand "check-rustfmt" { buildInputs = [ check.check-rustfmt ]; } '' - cd ${./.} - check-rustfmt - touch $out - ''; - check-spelling = pkgs.runCommand "check-spelling" { buildInputs = [ check.check-spelling ]; } '' - cd ${./.} - check-spelling - touch $out - ''; - check-nixpkgs-fmt = pkgs.runCommand "check-nixpkgs-fmt" { buildInputs = [ check.check-nixpkgs-fmt ]; } '' - cd ${./.} - check-nixpkgs-fmt - touch $out - ''; - }); - - packages = forAllSystems ({ system, pkgs, ... }: - { - inherit (pkgs) x509-info; - } // nixpkgs.lib.optionalAttrs (system == "x86_64-linux") { - inherit (pkgs) x509-info-static; - default = pkgs.x509-info-static; - } // nixpkgs.lib.optionalAttrs (pkgs.stdenv.isDarwin) { - default = pkgs.x509-info; - }); - }; -} diff --git a/src/x509-info/nix/check.nix b/src/x509-info/nix/check.nix deleted file mode 100644 index 4d7743c..0000000 --- a/src/x509-info/nix/check.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ pkgs, toolchain }: - -let - inherit (pkgs) writeShellApplication; -in -{ - - # Format - check-rustfmt = (writeShellApplication { - name = "check-rustfmt"; - runtimeInputs = [ toolchain ]; - text = "cargo fmt --check"; - }); - - # Spelling - check-spelling = (writeShellApplication { - name = "check-spelling"; - runtimeInputs = with pkgs; [ git codespell ]; - text = '' - codespell \ - --ignore-words-list="crate" \ - --skip="./target,.git" \ - . - ''; - }); - - # NixFormatting - check-nixpkgs-fmt = (writeShellApplication { - name = "check-nixpkgs-fmt"; - runtimeInputs = with pkgs; [ git nixpkgs-fmt findutils ]; - text = '' - nixpkgs-fmt --check . - ''; - }); - - # Semver - check-semver = (writeShellApplication { - name = "check-semver"; - runtimeInputs = with pkgs; [ cargo-semver-checks ]; - text = '' - cargo-semver-checks semver-checks check-release - ''; - }); -} diff --git a/src/x509-info/rust-toolchain.toml b/src/x509-info/rust-toolchain.toml deleted file mode 100644 index f4ebfd7..0000000 --- a/src/x509-info/rust-toolchain.toml +++ /dev/null @@ -1,3 +0,0 @@ -[toolchain] -channel = "stable" -components = [ "rustfmt", "clippy" ] diff --git a/src/x509-info/rustfmt.toml b/src/x509-info/rustfmt.toml deleted file mode 100644 index 3a26366..0000000 --- a/src/x509-info/rustfmt.toml +++ /dev/null @@ -1 +0,0 @@ -edition = "2021" -- cgit v1.2.3