diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4935334..fa7f1f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,6 +40,21 @@ jobs: run: rustup update nightly --no-self-update && rustup default nightly - run: cargo test --release + test-no-default-features: + name: cargo test (${{ matrix.os }}) --no-default-features + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - windows-latest + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - name: Install Rust + run: rustup update nightly --no-self-update && rustup default nightly + - run: cargo test --release --no-default-features + clippy: name: cargo clippy runs-on: ubuntu-latest @@ -58,11 +73,11 @@ jobs: run: rustup update stable - run: cargo fmt --all -- --check -# docs: -# name: cargo doc -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# - name: Install Rust -# run: rustup update nightly && rustup default nightly -# - run: RUSTDOCFLAGS="-D warnings --cfg docsrs" cargo doc -p openthread --no-deps --all-features + docs: + name: cargo doc + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Rust + run: rustup update nightly && rustup default nightly + - run: RUSTDOCFLAGS="-D warnings --cfg docsrs" cargo doc -p msecret --no-deps --all-features diff --git a/Cargo.toml b/Cargo.toml index e9a098f..5615540 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,16 +11,17 @@ documentation = "https://docs.rs/msecret" repository = "https://github.com/darconeous/msecret" readme = "README.md" categories = ["cryptography"] +rust-version = "1.70" edition = "2021" [features] -"default" = ["openssl", "share", "bin"] "share" = ["gf256", "crc"] "bin" = ["rpassword", "shellwords", "rustyline", "mnemonic", "clap" ] "longtest" = [] +"default" = ["openssl", "share", "bin"] [dependencies] -openssl = { version = "0.10", features = ["vendored"], optional = true } +openssl = { version = ">=0.10.55", features = ["vendored"], optional = true } gf256 = { version = "0.3", features = ["shamir", "thread-rng"], optional = true } crc = { version = "3", optional = true } diff --git a/README.md b/README.md index d6defe9..f1752cc 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,21 @@ -# MSecret — Experimental Key Derivation Utility # +MSecret — Experimental Key Derivation Utility +============================================= + +[![crates.io][crate-image]][crate-link] +[![Build Status][build-image]][build-link] +[![Documentation][doc-image]][doc-link] +[![dependency status][deps-image]][deps-link] +![MSRV][msrv-image] + +------- This project includes both: 1. A [specification][MSECRET] (with [test vectors][VECTORS]) for deterministically deriving various types of data (bytes, integers, primes, etc.) and cryptographic keys (RSA, ECC, etc.) from a symmetric master secret. -2. A reference implementation written in Rust, including a helpful - command-line utility and library. +2. A reference implementation written in Rust, including a [helpful + command-line utility](#command-line-tool) and [library][doc-link]. [MSECRET]: doc/MSECRET.md [VECTORS]: doc/TEST_VECTORS.md @@ -104,14 +113,10 @@ To update an existing installation, use rustup: $ rustup update ``` -Then you can check out a copy of the git repository, test, build, and -install: +Then you can grab the latest version of `msecretctl`: ```shell -$ git clone https://github.com/darconeous/msecret-rust -$ cd msecret-rust -$ cargo test --release -$ cargo install --path . +$ cargo install msecret ``` You should now be able to use the `msecretctl` tool. @@ -242,3 +247,17 @@ UIVkSB54IZGHuuQKkYwfCjT69zDGVRwt7A== # License Apache 2.0; see [`LICENSE`](LICENSE) for details. + +[//]: # (badges) + +[crate-image]: https://buildstats.info/crate/msecret +[crate-link]: https://crates.io/crates/msecret +[doc-image]: https://docs.rs/msecret/badge.svg +[doc-link]: https://docs.rs/msecret +[build-image]: https://github.com/darconeous/msecret-rust/workflows/CI/badge.svg +[build-link]: https://github.com/darconeous/msecret-rust/actions?query=workflow%3ACI+branch%3Amain +[msrv-image]: https://img.shields.io/badge/rustc-1.70+-blue.svg +[deps-image]: https://deps.rs/crate/msecret/0.1.1/status.svg +[deps-link]: https://deps.rs/crate/msecret/0.1.1 + +[//]: # (links) diff --git a/src/rsa.rs b/src/rsa.rs index cde310b..78f44b9 100644 --- a/src/rsa.rs +++ b/src/rsa.rs @@ -56,7 +56,7 @@ use zeroize::Zeroizing; /// The algorithm is largely based on the implementation /// from OpenSSL's `RSA_generate_key()` method, as seen here: /// -/// https://opensource.apple.com/source/OpenSSL097/OpenSSL097-16/openssl/crypto/rsa/rsa_gen.c +/// /// /// This is a straightforward algorithm that avoids doing the /// sorts of checks that are extremely unlikely to ever be diff --git a/src/secret.rs b/src/secret.rs index 8f4b71a..4f8d8a4 100644 --- a/src/secret.rs +++ b/src/secret.rs @@ -127,7 +127,7 @@ impl Secret { Ok(()) } - /// Recovers a secret from `k` of the shares previously split using [`split_shares()`]. + /// Recovers a secret from `k` of the shares previously split using [`Secret::split_shares()`]. pub fn try_from_shares>(shares: &[S]) -> Result { ensure!(!shares.is_empty(), "No shares given");