From eac6a6be5cc6e5865dfebd5cf56c1060996163cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Oct 2023 11:13:47 +0000 Subject: [PATCH 1/3] build(deps): bump actions/checkout from 4.0.0 to 4.1.1 Bumps [actions/checkout](https://github.com/actions/checkout) from 4.0.0 to 4.1.1. - [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/v4.0.0...v4.1.1) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/build-release-binaries.yml | 2 +- .github/workflows/ci.yml | 12 ++++++------ .github/workflows/create-release.yml | 2 +- .github/workflows/draft-new-release.yml | 2 +- .github/workflows/preview-release.yml | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-release-binaries.yml b/.github/workflows/build-release-binaries.yml index 3db89051..21ed973b 100644 --- a/.github/workflows/build-release-binaries.yml +++ b/.github/workflows/build-release-binaries.yml @@ -45,7 +45,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout tagged commit - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.1 with: ref: ${{ github.event.release.target_commitish }} token: ${{ secrets.BOTTY_GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af335076..5ec81fcc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.1 - uses: dtolnay/rust-toolchain@master with: @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.1 - uses: Swatinem/rust-cache@v2.6.2 @@ -51,7 +51,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.1 - uses: Swatinem/rust-cache@v2.6.2 @@ -78,7 +78,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout sources - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.1 - uses: Swatinem/rust-cache@v2.6.2 @@ -118,7 +118,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout sources - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.1 - uses: Swatinem/rust-cache@v2.6.2 @@ -155,7 +155,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.1 - uses: Swatinem/rust-cache@v2.6.2 diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index c95f8d22..ac24fe3f 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -11,7 +11,7 @@ jobs: if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/') runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.1 - name: Extract version from branch name id: extract-version diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index 2e89fd6c..06bb9052 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -12,7 +12,7 @@ jobs: name: "Draft a new release" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.1 with: token: ${{ secrets.BOTTY_GITHUB_TOKEN }} diff --git a/.github/workflows/preview-release.yml b/.github/workflows/preview-release.yml index 6e557033..d27a645a 100644 --- a/.github/workflows/preview-release.yml +++ b/.github/workflows/preview-release.yml @@ -10,7 +10,7 @@ jobs: name: Create preview release runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.1 - name: Delete 'preview' release uses: larryjoelane/delete-release-action@v1.0.24 From dcf9f24b770a1c9b9898372c7e254d155ce7f7dd Mon Sep 17 00:00:00 2001 From: Byron Hambly Date: Mon, 23 Oct 2023 11:21:04 +0200 Subject: [PATCH 2/3] build(deps): bump pem to 3.0 replaces #1415 also fixes the `seed_from_pem_fails_for_long_seed` unit test, which was "passing" but not actually testing what it meant to. --- Cargo.lock | 7 ++++--- swap/Cargo.toml | 2 +- swap/src/seed.rs | 21 ++++++++++----------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e3619fce..d0e46b43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2823,11 +2823,12 @@ checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" [[package]] name = "pem" -version = "1.1.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +checksum = "3163d2912b7c3b52d651a055f2c7eec9ba5cd22d26ef75b8dd3a59980b185923" dependencies = [ - "base64 0.13.1", + "base64 0.21.2", + "serde", ] [[package]] diff --git a/swap/Cargo.toml b/swap/Cargo.toml index b2872469..102eff4f 100644 --- a/swap/Cargo.toml +++ b/swap/Cargo.toml @@ -34,7 +34,7 @@ itertools = "0.10" libp2p = { version = "0.42.2", default-features = false, features = [ "tcp-tokio", "yamux", "mplex", "dns-tokio", "noise", "request-response", "websocket", "ping", "rendezvous", "identify" ] } monero = { version = "0.12", features = [ "serde_support" ] } monero-rpc = { path = "../monero-rpc" } -pem = "1.1" +pem = "3.0" proptest = "1" qrcode = "0.12" rand = "0.8" diff --git a/swap/src/seed.rs b/swap/src/seed.rs index f89215b9..5ffe9124 100644 --- a/swap/src/seed.rs +++ b/swap/src/seed.rs @@ -106,11 +106,12 @@ impl Seed { } fn from_pem(pem: pem::Pem) -> Result { - if pem.contents.len() != SEED_LENGTH { - Err(Error::IncorrectLength(pem.contents.len())) + let contents = pem.contents(); + if contents.len() != SEED_LENGTH { + Err(Error::IncorrectLength(contents.len())) } else { let mut array = [0; SEED_LENGTH]; - for (i, b) in pem.contents.iter().enumerate() { + for (i, b) in contents.iter().enumerate() { array[i] = *b; } @@ -122,10 +123,7 @@ impl Seed { ensure_directory_exists(&seed_file)?; let data = self.bytes(); - let pem = Pem { - tag: String::from("SEED"), - contents: data.to_vec(), - }; + let pem = Pem::new("SEED", data); let pem_string = encode(&pem); @@ -224,19 +222,20 @@ VnZUNFZ4dlY= } #[test] - #[should_panic] fn seed_from_pem_fails_for_long_seed() { let long = "-----BEGIN SEED----- -mbKANv2qKGmNVg1qtquj6Hx1pFPelpqOfE2JaJJAMEg1FlFhNRNlFlE= -mbKANv2qKGmNVg1qtquj6Hx1pFPelpqOfE2JaJJAMEg1FlFhNRNlFlE= +MIIBPQIBAAJBAOsfi5AGYhdRs/x6q5H7kScxA0Kzzqe6WI6gf6+tc6IvKQJo5rQc +dWWSQ0nRGt2hOPDO+35NKhQEjBQxPh/v7n0CAwEAAQJBAOGaBAyuw0ICyENy5NsO -----END SEED----- "; let pem = pem::parse(long).unwrap(); + assert_eq!(pem.contents().len(), 96); + match Seed::from_pem(pem) { Ok(_) => panic!("should fail for long payload"), Err(e) => { match e { - Error::IncorrectLength(_) => {} // pass + Error::IncorrectLength(len) => assert_eq!(len, 96), // pass _ => panic!("should fail with IncorrectLength error"), } } From 9819f74c125510c77ed66fb558d896cf6e43164c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 11:25:08 +0000 Subject: [PATCH 3/3] build(deps): bump Swatinem/rust-cache from 2.6.2 to 2.7.1 Bumps [Swatinem/rust-cache](https://github.com/swatinem/rust-cache) from 2.6.2 to 2.7.1. - [Release notes](https://github.com/swatinem/rust-cache/releases) - [Changelog](https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md) - [Commits](https://github.com/swatinem/rust-cache/compare/v2.6.2...v2.7.1) --- updated-dependencies: - dependency-name: Swatinem/rust-cache dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/build-release-binaries.yml | 2 +- .github/workflows/ci.yml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-release-binaries.yml b/.github/workflows/build-release-binaries.yml index 21ed973b..62e25913 100644 --- a/.github/workflows/build-release-binaries.yml +++ b/.github/workflows/build-release-binaries.yml @@ -50,7 +50,7 @@ jobs: ref: ${{ github.event.release.target_commitish }} token: ${{ secrets.BOTTY_GITHUB_TOKEN }} - - uses: Swatinem/rust-cache@v2.6.2 + - uses: Swatinem/rust-cache@v2.7.1 - uses: dtolnay/rust-toolchain@master with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ec81fcc..d54fc558 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: toolchain: 1.67 components: clippy,rustfmt - - uses: Swatinem/rust-cache@v2.6.2 + - uses: Swatinem/rust-cache@v2.7.1 - name: Check formatting uses: dprint/check@v2.2 @@ -39,7 +39,7 @@ jobs: - name: Checkout sources uses: actions/checkout@v4.1.1 - - uses: Swatinem/rust-cache@v2.6.2 + - uses: Swatinem/rust-cache@v2.7.1 - name: Build swap run: cargo build --bin swap @@ -53,7 +53,7 @@ jobs: - name: Checkout sources uses: actions/checkout@v4.1.1 - - uses: Swatinem/rust-cache@v2.6.2 + - uses: Swatinem/rust-cache@v2.7.1 - name: Install sqlx-cli run: cargo install sqlx-cli --locked @@ -80,7 +80,7 @@ jobs: - name: Checkout sources uses: actions/checkout@v4.1.1 - - uses: Swatinem/rust-cache@v2.6.2 + - uses: Swatinem/rust-cache@v2.7.1 - uses: dtolnay/rust-toolchain@master with: @@ -120,7 +120,7 @@ jobs: - name: Checkout sources uses: actions/checkout@v4.1.1 - - uses: Swatinem/rust-cache@v2.6.2 + - uses: Swatinem/rust-cache@v2.7.1 - name: Build tests run: cargo build --tests --workspace --all-features @@ -157,7 +157,7 @@ jobs: - name: Checkout sources uses: actions/checkout@v4.1.1 - - uses: Swatinem/rust-cache@v2.6.2 + - uses: Swatinem/rust-cache@v2.7.1 - name: Run test ${{ matrix.test_name }} run: cargo test --package swap --all-features --test ${{ matrix.test_name }} -- --nocapture