Compare commits

..

22 commits

Author SHA1 Message Date
Carson McManus
96a30c6150
setup: debug print full authenticator status when verification fails (#396) 2024-07-16 20:32:18 -04:00
Carson McManus
dd153a617c
fix a potential panic when querying authenticator status (#395) 2024-07-16 20:13:39 -04:00
Carson McManus
28c7a797cf
fix new lints (#397) 2024-07-16 20:07:33 -04:00
Carson McManus
c2a72fee6c update PKGBUILD 2024-06-02 18:21:36 -04:00
mp
602acc6641
PKGBUILD: disabled link time optimization to avoid build errors (#385)
This solves build errors for me described in
https://aur.archlinux.org/packages/steamguard-cli-git#comment-884235 and
also reproduced in
https://github.com/dyc3/steamguard-cli/actions/runs/9340294638/job/25705683797

```
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/usr/lib64/rustlib/x86_64-unknown-linux-gnu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustcWfC4he/symbols.o" "/var/ab/.cache/yay/steamguard-cli-git/src/steamguard-cli/target/release/deps/steamguard-22c99af53504a9e5.steamguard.7abfd362c63e99bf-cgu.13.rcgu.o" "-Wl,--as-needed" "-L" "/var/ab/.cache/yay/steamguard-cli-git/src/steamguard-cli/target/release/deps" "-L" "/var/ab/.cache/yay/steamguard-cli-git/src/steamguard-cli/target/release/build/ring-0dc12641040c6e8f/out" "-L" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/tmp/rustcWfC4he/libring-949bba2bc6e40fcb.rlib" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-3ce9c50abe6de474.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/var/ab/.cache/yay/steamguard-cli-git/src/steamguard-cli/target/release/deps/steamguard-22c99af53504a9e5" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-debug" "-nodefaultlibs"
  = note: /usr/sbin/ld: /var/ab/.cache/yay/steamguard-cli-git/src/steamguard-cli/target/release/deps/steamguard-22c99af53504a9e5.steamguard.7abfd362c63e99bf-cgu.13.rcgu.o: in function `ring::aead::aes_gcm::aes_gcm_seal':
          steamguard.7abfd362c63e99bf-cgu.13:(.text._ZN4ring4aead7aes_gcm12aes_gcm_seal17hdce0b4a4f2d32350E+0xa9): undefined reference to `ring_core_0_17_8_OPENSSL_ia32cap_P'
```
2024-06-02 21:59:36 +00:00
Carson McManus
b4564b7d5e Release steamguard v0.14.0, steamguard-cli v0.14.0 2024-06-02 14:12:44 -04:00
Carson McManus
d30ba017c9 Bump steamguard v0.14.0, steamguard-cli v0.14.0 2024-06-02 14:12:19 -04:00
Carson McManus
37ae7c76a6 Release steamguard v0.14.0, steamguard-cli v0.14.0 2024-06-02 14:10:37 -04:00
Carson McManus
ef72bd898c Bump steamguard v0.14.0, steamguard-cli v0.14.0, safety bump steamguard-cli v0.14.0 2024-06-02 14:02:38 -04:00
Carson McManus
52044c95bb
upgrade more misc dependencies (#384)
- upgrade uuid to 1.8
- remove scraper from deps
- upgrade cookie to 0.18
- upgrade reqwest to 0.12
- upgrade qrcode to 0.14
- upgrade dirs to 5.0.1
2024-06-02 17:56:05 +00:00
Carson McManus
b24a7415f6
upgrade misc deps, set rust edition to 2021 (#383) 2024-06-02 16:26:00 +00:00
Carson McManus
8d54a1254a
upgrade to clap v4 (#382) 2024-06-02 14:59:25 +00:00
Carson McManus
ab5cb00ee3
qr-login: add a --image argument for providing an image to scan for the QR code (#381)
closes #380
2024-06-01 18:47:24 -04:00
dependabot[bot]
c7fefc1452
Bump rustls from 0.21.2 to 0.21.11 (#379)
Bumps [rustls](https://github.com/rustls/rustls) from 0.21.2 to 0.21.11.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7b8d1dbc1e"><code>7b8d1db</code></a>
Prepare 0.21.11</li>
<li><a
href="ebcb4782f2"><code>ebcb478</code></a>
complete_io: bail out if progress is impossible</li>
<li><a
href="20f35dfb6d"><code>20f35df</code></a>
Regression test for <code>complete_io</code> infinite loop bug</li>
<li><a
href="2f2aae15a4"><code>2f2aae1</code></a>
Don't specially handle unauthenticated close_notify alerts</li>
<li><a
href="e163587b98"><code>e163587</code></a>
Don't deny warnings from nightly clippy</li>
<li><a
href="9f864874cf"><code>9f86487</code></a>
server::handy: fix new nightly clippy lint</li>
<li><a
href="7e0e8ab599"><code>7e0e8ab</code></a>
Correct assorted clippy warnings in test code</li>
<li><a
href="3587d98f4e"><code>3587d98</code></a>
Apply clippy suggestions from Rust 1.72</li>
<li><a
href="d082e837b3"><code>d082e83</code></a>
Address <code>clippy::redundant_static_lifetimes</code></li>
<li><a
href="5e7a06ca45"><code>5e7a06c</code></a>
Address <code>clippy::slow_vector_initialization</code></li>
<li>Additional commits viewable in <a
href="https://github.com/rustls/rustls/compare/v/0.21.2...v/0.21.11">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rustls&package-manager=cargo&previous-version=0.21.2&new-version=0.21.11)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/dyc3/steamguard-cli/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-20 10:22:37 -04:00
dependabot[bot]
a64f7d4134
Bump h2 from 0.3.24 to 0.3.26 (#377)
Bumps [h2](https://github.com/hyperium/h2) from 0.3.24 to 0.3.26.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/hyperium/h2/releases">h2's
releases</a>.</em></p>
<blockquote>
<h2>v0.3.26</h2>
<h2>What's Changed</h2>
<ul>
<li>Limit number of CONTINUATION frames for misbehaving
connections.</li>
</ul>
<p>See <a
href="https://seanmonstar.com/blog/hyper-http2-continuation-flood/">https://seanmonstar.com/blog/hyper-http2-continuation-flood/</a>
for more info.</p>
<h2>v0.3.25</h2>
<h2>What's Changed</h2>
<ul>
<li>perf: optimize header list size calculations by <a
href="https://github.com/Noah-Kennedy"><code>@​Noah-Kennedy</code></a>
in <a
href="https://redirect.github.com/hyperium/h2/pull/750">hyperium/h2#750</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/hyperium/h2/compare/v0.3.24...v0.3.25">https://github.com/hyperium/h2/compare/v0.3.24...v0.3.25</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/hyperium/h2/blob/v0.3.26/CHANGELOG.md">h2's
changelog</a>.</em></p>
<blockquote>
<h1>0.3.26 (April 3, 2024)</h1>
<ul>
<li>Limit number of CONTINUATION frames for misbehaving
connections.</li>
</ul>
<h1>0.3.25 (March 15, 2024)</h1>
<ul>
<li>Improve performance decoding many headers.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="357127e279"><code>357127e</code></a>
v0.3.26</li>
<li><a
href="1a357aaefc"><code>1a357aa</code></a>
fix: limit number of CONTINUATION frames allowed</li>
<li><a
href="5b6c9e0da0"><code>5b6c9e0</code></a>
refactor: cleanup new unused warnings (<a
href="https://redirect.github.com/hyperium/h2/issues/757">#757</a>)</li>
<li><a
href="3a79832721"><code>3a79832</code></a>
v0.3.25</li>
<li><a
href="94e80b1c72"><code>94e80b1</code></a>
perf: optimize header list size calculations (<a
href="https://redirect.github.com/hyperium/h2/issues/750">#750</a>)</li>
<li>See full diff in <a
href="https://github.com/hyperium/h2/compare/v0.3.24...v0.3.26">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=h2&package-manager=cargo&previous-version=0.3.24&new-version=0.3.26)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/dyc3/steamguard-cli/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-05 13:07:58 -04:00
Carson McManus
0a41e8b042 Release steamguard v0.13.0, steamguard-cli v0.13.0 2024-03-04 17:23:00 -05:00
Carson McManus
d3c1dfb3d5 Bump steamguard v0.13.0, steamguard-cli v0.13.0, safety bump steamguard-cli v0.13.0 2024-03-04 17:18:59 -05:00
Carson McManus
a8d3f3fc99 update release script 2024-03-04 17:17:38 -05:00
dependabot[bot]
5e24031719
Bump mio from 0.8.8 to 0.8.11 (#372)
Bumps [mio](https://github.com/tokio-rs/mio) from 0.8.8 to 0.8.11.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md">mio's
changelog</a>.</em></p>
<blockquote>
<h1>0.8.11</h1>
<ul>
<li>Fix receiving IOCP events after deregistering a Windows named pipe
(<a
href="https://redirect.github.com/tokio-rs/mio/pull/1760">tokio-rs/mio#1760</a>,
backport pr:
<a
href="https://redirect.github.com/tokio-rs/mio/pull/1761">tokio-rs/mio#1761</a>).</li>
</ul>
<h1>0.8.10</h1>
<h2>Added</h2>
<ul>
<li>Solaris support
(<a
href="https://redirect.github.com/tokio-rs/mio/pull/1724">tokio-rs/mio#1724</a>).</li>
</ul>
<h1>0.8.9</h1>
<h2>Added</h2>
<ul>
<li>ESP-IDF framework support
(<a
href="https://redirect.github.com/tokio-rs/mio/pull/1692">tokio-rs/mio#1692</a>).</li>
<li>AIX operating system support
(<a
href="https://redirect.github.com/tokio-rs/mio/pull/1704">tokio-rs/mio#1704</a>).</li>
<li>Vita support
(<a
href="https://redirect.github.com/tokio-rs/mio/pull/1721">tokio-rs/mio#1721</a>).</li>
<li><code>{UnixListener,UnixStream}:bind_addr</code>
(<a
href="https://redirect.github.com/tokio-rs/mio/pull/1630">tokio-rs/mio#1630</a>).</li>
<li><code>mio_unsupported_force_poll_poll</code> and
<code>mio_unsupported_force_waker_pipe</code>
<strong>unsupported</strong> configuration flags to force a specific
poll or waker
implementation
(<a
href="https://redirect.github.com/tokio-rs/mio/pull/1684">tokio-rs/mio#1684</a>,
<a
href="https://redirect.github.com/tokio-rs/mio/pull/1685">tokio-rs/mio#1685</a>,
<a
href="https://redirect.github.com/tokio-rs/mio/pull/1692">tokio-rs/mio#1692</a>).</li>
</ul>
<h2>Fixed</h2>
<ul>
<li>The <code>pipe(2)</code> based waker (swapped file descriptors)
(<a
href="https://redirect.github.com/tokio-rs/mio/pull/1722">tokio-rs/mio#1722</a>).</li>
<li>The duplicate waker check to work correctly with cloned
<code>Registry</code>s.
(<a
href="https://redirect.github.com/tokio-rs/mio/pull/1706">tokio-rs/mio#1706</a>).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="0328bdef90"><code>0328bde</code></a>
Release v0.8.11</li>
<li><a
href="7084498512"><code>7084498</code></a>
Fix warnings</li>
<li><a
href="90d4fe00df"><code>90d4fe0</code></a>
named-pipes: fix receiving IOCP events after deregister</li>
<li><a
href="c710a307f8"><code>c710a30</code></a>
Add v0.8.x to the CI</li>
<li><a
href="c29e21c244"><code>c29e21c</code></a>
Release v0.8.10</li>
<li><a
href="f6a20da1c8"><code>f6a20da</code></a>
Add Solaris operating system support (<a
href="https://redirect.github.com/tokio-rs/mio/issues/1724">#1724</a>)</li>
<li><a
href="e80c3b21b5"><code>e80c3b2</code></a>
Release v0.8.9</li>
<li><a
href="862786bbbf"><code>862786b</code></a>
Fix importing of IoSourceState</li>
<li><a
href="40348728e4"><code>4034872</code></a>
Add support for vita target</li>
<li><a
href="8eb4010a92"><code>8eb4010</code></a>
Fix receiver and sender fd in pipe based waker</li>
<li>Additional commits viewable in <a
href="https://github.com/tokio-rs/mio/compare/v0.8.8...v0.8.11">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mio&package-manager=cargo&previous-version=0.8.8&new-version=0.8.11)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/dyc3/steamguard-cli/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-04 21:55:03 +00:00
Carson McManus
d67e925a47
ci: add workflow_dispatch trigger to aur-checker (#371) 2024-03-04 07:20:18 -05:00
Carson McManus
4c9f494ed3
chore: update CI to use node 20 actions (#369) 2024-03-04 07:05:23 -05:00
Carson McManus
46a1c2ed04
rename trade subcommand to confirm and deprecate trade subcommand (#368) 2024-03-04 06:56:48 -05:00
19 changed files with 1099 additions and 971 deletions

View file

@ -5,12 +5,13 @@ on:
- cron: "32 5 */3 * *" - cron: "32 5 */3 * *"
push: push:
branches: [ master, main ] branches: [ master, main ]
workflow_dispatch:
jobs: jobs:
test-install: test-install:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: Install AUR package - name: Install AUR package
run: ./scripts/check-aur.sh run: ./scripts/check-aur.sh

View file

@ -15,9 +15,9 @@ jobs:
steps: steps:
- run: rustup component add clippy rustfmt - run: rustup component add clippy rustfmt
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Rust Cache - name: Rust Cache
uses: Swatinem/rust-cache@v2.5.0 uses: Swatinem/rust-cache@v2
- name: Check format - name: Check format
run: cargo fmt --all -- --check run: cargo fmt --all -- --check
- name: Check - name: Check
@ -34,13 +34,13 @@ jobs:
matrix: matrix:
target: [x86_64-unknown-linux-musl, x86_64-pc-windows-gnu] target: [x86_64-unknown-linux-musl, x86_64-pc-windows-gnu]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Rust Cache - name: Rust Cache
uses: Swatinem/rust-cache@v2.5.0 uses: Swatinem/rust-cache@v2
with: with:
prefix-key: v0-rust-${{ matrix.target }} prefix-key: v0-rust-${{ matrix.target }}
- name: Install Cross - name: Install Cross
uses: baptiste0928/cargo-install@v1 uses: baptiste0928/cargo-install@v2
with: with:
crate: cross crate: cross
- name: Check - name: Check

1849
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -4,9 +4,9 @@ members = ["steamguard"]
[package] [package]
name = "steamguard-cli" name = "steamguard-cli"
version = "0.12.6" version = "0.14.0"
authors = ["dyc3 (Carson McManus) <carson.mcmanus1@gmail.com>"] authors = ["dyc3 (Carson McManus) <carson.mcmanus1@gmail.com>"]
edition = "2018" edition = "2021"
description = "A command line utility to generate Steam 2FA codes and respond to confirmations." description = "A command line utility to generate Steam 2FA codes and respond to confirmations."
keywords = ["steam", "2fa", "steamguard", "authentication", "cli"] keywords = ["steam", "2fa", "steamguard", "authentication", "cli"]
categories = ["command-line-utilities"] categories = ["command-line-utilities"]
@ -29,10 +29,10 @@ path = "src/main.rs"
[dependencies] [dependencies]
anyhow = "^1.0" anyhow = "^1.0"
base64 = "0.21.2" base64 = "0.22.1"
text_io = "0.1.8" text_io = "0.1.8"
rpassword = "7.2.0" rpassword = "7.2.0"
reqwest = { version = "0.11", default-features = false, features = [ reqwest = { version = "0.12", default-features = false, features = [
"blocking", "blocking",
"json", "json",
"cookies", "cookies",
@ -43,21 +43,20 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
rsa = "0.9.2" rsa = "0.9.2"
rand = "0.8.5" rand = "0.8.5"
standback = "0.2.17" # required to fix a compilation error on a transient dependency clap = { version = "4.5.4", features = ["derive", "cargo", "env"] }
clap = { version = "3.1.18", features = ["derive", "cargo", "env"] } clap_complete = "4.5.2"
clap_complete = "3.2.1"
log = "0.4.19" log = "0.4.19"
stderrlog = "0.6" stderrlog = "0.6"
cookie = "0.14" cookie = "0.18"
regex = "1" regex = "1"
lazy_static = "1.4.0" lazy_static = "1.4.0"
uuid = { version = "0.8", features = ["v4"] } uuid = { version = "1.8", features = ["v4"] }
steamguard = { version = "^0.12.6", path = "./steamguard" } steamguard = { version = "^0.14.0", path = "./steamguard" }
dirs = "3.0.2" dirs = "5.0.1"
aes = { version = "0.8.3", features = ["zeroize"] } aes = { version = "0.8.3", features = ["zeroize"] }
thiserror = "1.0.26" thiserror = "1.0.61"
crossterm = { version = "0.23.2", features = ["event-stream"] } crossterm = { version = "0.23.2", features = ["event-stream"] }
qrcode = { version = "0.12.0", optional = true } qrcode = { version = "0.14.0", optional = true }
gethostname = "0.4.3" gethostname = "0.4.3"
secrecy = { version = "0.8", features = ["serde"] } secrecy = { version = "0.8", features = ["serde"] }
zeroize = { version = "^1.6.0", features = ["std", "zeroize_derive"] } zeroize = { version = "^1.6.0", features = ["std", "zeroize_derive"] }
@ -73,6 +72,8 @@ argon2 = { version = "0.5.0", features = ["std", "zeroize"] }
pbkdf2 = { version = "0.12.1", features = ["parallel"] } pbkdf2 = { version = "0.12.1", features = ["parallel"] }
sha1 = "0.10.5" sha1 = "0.10.5"
rayon = "1.7.0" rayon = "1.7.0"
rqrr = "0.7.1"
image = "0.25"
[dev-dependencies] [dev-dependencies]
tempfile = "3" tempfile = "3"

View file

@ -3,7 +3,7 @@
_pkgname=steamguard-cli _pkgname=steamguard-cli
pkgname=${_pkgname}-git pkgname=${_pkgname}-git
pkgver=0.8.1.r1.fe0d6e9a pkgver=0.14.0.r1.602acc66
pkgrel=1 pkgrel=1
pkgdesc="A command line utility to generate Steam 2FA codes and respond to confirmations." pkgdesc="A command line utility to generate Steam 2FA codes and respond to confirmations."
arch=('i686' 'x86_64' 'armv6h' 'armv7h') arch=('i686' 'x86_64' 'armv6h' 'armv7h')
@ -12,6 +12,7 @@ license=('GPL3')
makedepends=('rust' 'cargo' 'git') makedepends=('rust' 'cargo' 'git')
source=("git+https://github.com/dyc3/steamguard-cli.git") source=("git+https://github.com/dyc3/steamguard-cli.git")
sha256sums=('SKIP') sha256sums=('SKIP')
options=(!lto)
pkgver() { pkgver() {
cd "${srcdir}/${_pkgname}" cd "${srcdir}/${_pkgname}"

View file

@ -3,7 +3,7 @@
[![Lint, Build, Test](https://github.com/dyc3/steamguard-cli/actions/workflows/rust.yml/badge.svg)](https://github.com/dyc3/steamguard-cli/actions/workflows/rust.yml) [![Lint, Build, Test](https://github.com/dyc3/steamguard-cli/actions/workflows/rust.yml/badge.svg)](https://github.com/dyc3/steamguard-cli/actions/workflows/rust.yml)
[![AUR Tester](https://github.com/dyc3/steamguard-cli/actions/workflows/aur-checker.yml/badge.svg)](https://github.com/dyc3/steamguard-cli/actions/workflows/aur-checker.yml) [![AUR Tester](https://github.com/dyc3/steamguard-cli/actions/workflows/aur-checker.yml/badge.svg)](https://github.com/dyc3/steamguard-cli/actions/workflows/aur-checker.yml)
A command line utility for setting up and using Steam Mobile Authenticator (AKA Steam 2FA). It can also be used to respond to trade and market confirmations. A command line utility for setting up and using Steam Mobile Authenticator (AKA Steam 2FA). It can also be used to respond to trade, market, and any other steam mobile confirmations that you would normally get in the app.
**The only legitimate place to download steamguard-cli binaries is through this repo's releases, or by any package manager that is linked in this document.** **The only legitimate place to download steamguard-cli binaries is through this repo's releases, or by any package manager that is linked in this document.**

View file

@ -54,20 +54,7 @@ This will do everything needed to release a new version:
""" """
echo "Previewing changes..." echo "Previewing changes..."
cargo smart-release --update-crates-index --no-changelog --no-tag --no-push --no-publish
if [ "$DRY_RUN" = true ]; then
echo "This is a dry run, nothing will be done. Artifacts will be built, but not published. Use --execute to do it for real."
else
echo "This is not a dry run. This is the real deal!"
fi
echo "Press any key to continue..."
read -n 1 -s -r
params=() params=()
if [[ $DRY_RUN == false ]]; then
params+=(--execute)
fi
if [[ $BUMP != "" ]]; then if [[ $BUMP != "" ]]; then
params+=(--bump "$BUMP") params+=(--bump "$BUMP")
params+=(--bump-dependencies "$BUMP") params+=(--bump-dependencies "$BUMP")
@ -80,6 +67,20 @@ if [[ $ALLOW_DIRTY == true ]]; then
fi fi
cargo smart-release --update-crates-index --no-changelog --no-tag --no-push --no-publish "${params[@]}" cargo smart-release --update-crates-index --no-changelog --no-tag --no-push --no-publish "${params[@]}"
if [ "$DRY_RUN" = true ]; then
echo "This is a dry run, nothing will be done. Artifacts will be built, but not published. Use --execute to do it for real."
else
echo "This is not a dry run. This is the real deal!"
fi
echo "Press any key to continue..."
read -n 1 -s -r
if [[ $DRY_RUN == false ]]; then
params+=(--execute)
fi
cargo smart-release --update-crates-index --no-changelog --no-tag --no-push --no-publish "${params[@]}"
#echo "Verify that the publish succeeded, and Press any key to continue..." #echo "Verify that the publish succeeded, and Press any key to continue..."
# read -n 1 -s -r # read -n 1 -s -r

View file

@ -339,8 +339,9 @@ impl AccountManager {
debug!("Adding missing account names"); debug!("Adding missing account names");
for i in 0..self.manifest.entries.len() { for i in 0..self.manifest.entries.len() {
let account = self.load_account_by_entry(&self.manifest.entries[i].clone())?; let account = self.load_account_by_entry(&self.manifest.entries[i].clone())?;
self.manifest.entries[i].account_name = self.manifest.entries[i]
account.lock().unwrap().account_name.clone(); .account_name
.clone_from(&account.lock().unwrap().account_name);
} }
upgraded = true; upgraded = true;
} }

View file

@ -1,6 +1,6 @@
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use clap::{clap_derive::ArgEnum, Parser}; use clap::{Parser, Subcommand, ValueEnum};
use clap_complete::Shell; use clap_complete::Shell;
use secrecy::SecretString; use secrecy::SecretString;
use std::str::FromStr; use std::str::FromStr;
@ -10,6 +10,7 @@ use crate::AccountManager;
pub mod code; pub mod code;
pub mod completions; pub mod completions;
pub mod confirm;
pub mod debug; pub mod debug;
pub mod decrypt; pub mod decrypt;
pub mod encrypt; pub mod encrypt;
@ -19,10 +20,10 @@ pub mod qr;
pub mod qr_login; pub mod qr_login;
pub mod remove; pub mod remove;
pub mod setup; pub mod setup;
pub mod trade;
pub use code::CodeCommand; pub use code::CodeCommand;
pub use completions::CompletionsCommand; pub use completions::CompletionsCommand;
pub use confirm::ConfirmCommand;
pub use debug::DebugCommand; pub use debug::DebugCommand;
pub use decrypt::DecryptCommand; pub use decrypt::DecryptCommand;
pub use encrypt::EncryptCommand; pub use encrypt::EncryptCommand;
@ -32,7 +33,6 @@ pub use qr::QrCommand;
pub use qr_login::QrLoginCommand; pub use qr_login::QrLoginCommand;
pub use remove::RemoveCommand; pub use remove::RemoveCommand;
pub use setup::SetupCommand; pub use setup::SetupCommand;
pub use trade::TradeCommand;
/// A command that does not operate on the manifest or individual accounts. /// A command that does not operate on the manifest or individual accounts.
pub(crate) trait ConstCommand { pub(crate) trait ConstCommand {
@ -127,7 +127,7 @@ pub(crate) struct GlobalArgs {
help = "Specify your encryption passkey." help = "Specify your encryption passkey."
)] )]
pub passkey: Option<SecretString>, pub passkey: Option<SecretString>,
#[clap(short, long, arg_enum, default_value_t=Verbosity::Info, help = "Set the log level. Be warned, trace is capable of printing sensitive data.")] #[clap(short, long, value_enum, default_value_t=Verbosity::Info, help = "Set the log level. Be warned, trace is capable of printing sensitive data.")]
pub verbosity: Verbosity, pub verbosity: Verbosity,
#[cfg(feature = "updater")] #[cfg(feature = "updater")]
@ -160,13 +160,14 @@ pub(crate) struct GlobalArgs {
pub danger_accept_invalid_certs: bool, pub danger_accept_invalid_certs: bool,
} }
#[derive(Debug, Clone, Parser)] #[derive(Debug, Clone, Subcommand)]
pub(crate) enum Subcommands { pub(crate) enum Subcommands {
Debug(DebugCommand), Debug(DebugCommand),
Completion(CompletionsCommand), Completion(CompletionsCommand),
Setup(SetupCommand), Setup(SetupCommand),
Import(ImportCommand), Import(ImportCommand),
Trade(TradeCommand), #[clap(alias = "trade")]
Confirm(ConfirmCommand),
Remove(RemoveCommand), Remove(RemoveCommand),
Encrypt(EncryptCommand), Encrypt(EncryptCommand),
Decrypt(DecryptCommand), Decrypt(DecryptCommand),
@ -176,7 +177,7 @@ pub(crate) enum Subcommands {
QrLogin(QrLoginCommand), QrLogin(QrLoginCommand),
} }
#[derive(Debug, Clone, Copy, ArgEnum)] #[derive(Debug, Clone, Copy, ValueEnum)]
pub(crate) enum Verbosity { pub(crate) enum Verbosity {
Error = 0, Error = 0,
Warn = 1, Warn = 1,
@ -222,3 +223,14 @@ impl From<Args> for CodeCommand {
args.code args.code
} }
} }
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn verify_cli() {
use clap::CommandFactory;
Args::command().debug_assert()
}
}

View file

@ -5,7 +5,12 @@ use super::*;
#[derive(Debug, Clone, Parser)] #[derive(Debug, Clone, Parser)]
#[clap(about = "Generate shell completions")] #[clap(about = "Generate shell completions")]
pub struct CompletionsCommand { pub struct CompletionsCommand {
#[clap(short, long, arg_enum, help = "The shell to generate completions for.")] #[clap(
short,
long,
value_enum,
help = "The shell to generate completions for."
)]
pub shell: Shell, pub shell: Shell,
} }

View file

@ -9,12 +9,12 @@ use crate::{tui, AccountManager};
use super::*; use super::*;
#[derive(Debug, Clone, Parser)] #[derive(Debug, Clone, Parser)]
#[clap(about = "Interactive interface for trade confirmations")] #[clap(about = "Interactive interface for steam mobile confirmations")]
pub struct TradeCommand { pub struct ConfirmCommand {
#[clap( #[clap(
short, short,
long, long,
help = "Accept all open trade confirmations. Does not open interactive interface." help = "Accept all open mobile confirmations. Does not open interactive interface."
)] )]
pub accept_all: bool, pub accept_all: bool,
#[clap( #[clap(
@ -25,7 +25,7 @@ pub struct TradeCommand {
pub fail_fast: bool, pub fail_fast: bool,
} }
impl<T> AccountCommand<T> for TradeCommand impl<T> AccountCommand<T> for ConfirmCommand
where where
T: Transport + Clone, T: Transport + Clone,
{ {
@ -44,12 +44,12 @@ where
crate::do_login(transport.clone(), &mut account, args.password.clone())?; crate::do_login(transport.clone(), &mut account, args.password.clone())?;
} }
info!("{}: Checking for trade confirmations", account.account_name); info!("{}: Checking for confirmations", account.account_name);
let confirmations: Vec<Confirmation>; let confirmations: Vec<Confirmation>;
loop { loop {
let confirmer = Confirmer::new(transport.clone(), &account); let confirmer = Confirmer::new(transport.clone(), &account);
match confirmer.get_trade_confirmations() { match confirmer.get_confirmations() {
Ok(confs) => { Ok(confs) => {
confirmations = confs; confirmations = confs;
break; break;
@ -59,7 +59,7 @@ where
crate::do_login(transport.clone(), &mut account, args.password.clone())?; crate::do_login(transport.clone(), &mut account, args.password.clone())?;
} }
Err(err) => { Err(err) => {
error!("Failed to get trade confirmations: {}", err); error!("Failed to get confirmations: {}", err);
return Err(err.into()); return Err(err.into());
} }
} }

View file

@ -1,6 +1,10 @@
use std::sync::{Arc, Mutex}; use std::{
path::{Path, PathBuf},
sync::{Arc, Mutex},
};
use log::*; use log::*;
use rqrr::PreparedImage;
use steamguard::{QrApprover, QrApproverError}; use steamguard::{QrApprover, QrApproverError};
use crate::AccountManager; use crate::AccountManager;
@ -10,11 +14,8 @@ use super::*;
#[derive(Debug, Clone, Parser)] #[derive(Debug, Clone, Parser)]
#[clap(about = "Log in to Steam on another device using the QR code that it's displaying.")] #[clap(about = "Log in to Steam on another device using the QR code that it's displaying.")]
pub struct QrLoginCommand { pub struct QrLoginCommand {
#[clap( #[clap(flatten)]
long, login_url_source: LoginUrlSource,
help = "The URL that would normally open in the Steam app. This is the URL that the QR code is displaying. It should start with \"https://s.team/...\""
)]
pub url: String,
} }
impl<T> AccountCommand<T> for QrLoginCommand impl<T> AccountCommand<T> for QrLoginCommand
@ -41,6 +42,8 @@ where
crate::do_login(transport.clone(), &mut account, args.password.clone())?; crate::do_login(transport.clone(), &mut account, args.password.clone())?;
} }
let url = self.login_url_source.url()?;
debug!("Using login URL to approve: {}", url);
loop { loop {
let Some(tokens) = account.tokens.as_ref() else { let Some(tokens) = account.tokens.as_ref() else {
error!( error!(
@ -51,7 +54,7 @@ where
}; };
let mut approver = QrApprover::new(transport.clone(), tokens); let mut approver = QrApprover::new(transport.clone(), tokens);
match approver.approve(&account, &self.url) { match approver.approve(&account, url.to_owned()) {
Ok(_) => { Ok(_) => {
info!("Login approved."); info!("Login approved.");
break; break;
@ -70,3 +73,56 @@ where
Ok(()) Ok(())
} }
} }
#[derive(Debug, Clone, clap::Args)]
#[group(required = true, multiple = false)]
pub struct LoginUrlSource {
/// The URL that would normally open in the Steam app. This is the URL that the QR code is displaying. It should start with \"https://s.team/...\"
#[clap(long)]
url: Option<String>,
/// Path to an image file containing the QR code. The QR code will be scanned from this image.
#[clap(long)]
image: Option<PathBuf>,
}
impl LoginUrlSource {
fn url(&self) -> anyhow::Result<String> {
match self {
Self { url: Some(url), .. } => Ok(url.clone()),
Self {
image: Some(path), ..
} => read_qr_image(path),
_ => Err(anyhow!(
"You must provide either a URL with --url or an image file with --image."
)),
}
}
}
fn read_qr_image(path: &Path) -> anyhow::Result<String> {
use image::io::Reader as ImageReader;
let image = ImageReader::open(path)?.decode()?.to_luma8();
let mut img = PreparedImage::prepare(image);
let grids = img.detect_grids();
for grid in grids {
let (_meta, text) = grid.decode()?;
// a rough validation that the QR code is a Steam login code
if text.contains("s.team") {
return Ok(text);
}
}
Err(anyhow!("No Steam login url found in the QR code"))
}
#[cfg(test)]
mod tests {
use super::*;
use std::path::Path;
#[test]
fn test_read_qr_image() {
let path = Path::new("src/fixtures/qr-codes/login-qr.png");
let url = read_qr_image(path).unwrap();
assert_eq!(url, "https://s.team/q/1/2372462679780599330");
}
}

View file

@ -193,6 +193,7 @@ impl SetupCommand {
"authenticator state: {} -- did not actually finalize", "authenticator state: {} -- did not actually finalize",
status.state() status.state()
); );
debug!("full status: {:#?}", status);
manager.remove_account(&account_name); manager.remove_account(&account_name);
manager.save()?; manager.save()?;
bail!("Authenticator finalization was unsuccessful. You may have entered the wrong confirm code in the previous step. Try again."); bail!("Authenticator finalization was unsuccessful. You may have entered the wrong confirm code in the previous step. Try again.");

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -86,7 +86,7 @@ fn run(args: commands::Args) -> anyhow::Result<()> {
Subcommands::Import(args) => CommandType::Manifest(Box::new(args)), Subcommands::Import(args) => CommandType::Manifest(Box::new(args)),
Subcommands::Encrypt(args) => CommandType::Manifest(Box::new(args)), Subcommands::Encrypt(args) => CommandType::Manifest(Box::new(args)),
Subcommands::Decrypt(args) => CommandType::Manifest(Box::new(args)), Subcommands::Decrypt(args) => CommandType::Manifest(Box::new(args)),
Subcommands::Trade(args) => CommandType::Account(Box::new(args)), Subcommands::Confirm(args) => CommandType::Account(Box::new(args)),
Subcommands::Remove(args) => CommandType::Account(Box::new(args)), Subcommands::Remove(args) => CommandType::Account(Box::new(args)),
Subcommands::Code(args) => CommandType::Account(Box::new(args)), Subcommands::Code(args) => CommandType::Account(Box::new(args)),
#[cfg(feature = "qr")] #[cfg(feature = "qr")]

View file

@ -1,8 +1,8 @@
[package] [package]
name = "steamguard" name = "steamguard"
version = "0.12.6" version = "0.14.0"
authors = ["Carson McManus <carson.mcmanus1@gmail.com>"] authors = ["Carson McManus <carson.mcmanus1@gmail.com>"]
edition = "2018" edition = "2021"
description = "Library for generating 2fa codes for Steam and responding to mobile confirmations." description = "Library for generating 2fa codes for Steam and responding to mobile confirmations."
keywords = ["steam", "2fa", "steamguard", "authentication"] keywords = ["steam", "2fa", "steamguard", "authentication"]
repository = "https://github.com/dyc3/steamguard-cli/tree/master/steamguard" repository = "https://github.com/dyc3/steamguard-cli/tree/master/steamguard"
@ -11,8 +11,8 @@ license = "MIT OR Apache-2.0"
[dependencies] [dependencies]
anyhow = "^1.0" anyhow = "^1.0"
sha1 = "^0.10" sha1 = "^0.10"
base64 = "^0.21" base64 = "^0.22.1"
reqwest = { version = "0.11", default-features = false, features = [ reqwest = { version = "0.12", default-features = false, features = [
"blocking", "blocking",
"json", "json",
"cookies", "cookies",
@ -24,13 +24,11 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
rsa = "0.9.2" rsa = "0.9.2"
rand = "0.8.4" rand = "0.8.4"
standback = "0.2.17" # required to fix a compilation error on a transient dependency cookie = "0.18"
cookie = "0.14"
regex = "1" regex = "1"
lazy_static = "1.4.0" lazy_static = "1.4.0"
uuid = { version = "0.8", features = ["v4"] } uuid = { version = "1.8", features = ["v4"] }
log = "0.4.19" log = "0.4.19"
scraper = "0.12.0"
maplit = "1.0.2" maplit = "1.0.2"
thiserror = "1.0.26" thiserror = "1.0.26"
secrecy = { version = "0.8", features = ["serde"] } secrecy = { version = "0.8", features = ["serde"] }

View file

@ -137,10 +137,7 @@ where
let mut req = CTwoFactor_Status_Request::new(); let mut req = CTwoFactor_Status_Request::new();
req.set_steamid(account.steam_id); req.set_steamid(account.steam_id);
let resp = self let resp = self.client.query_status(req, self.tokens.access_token())?;
.client
.query_status(req, self.tokens.access_token())
.unwrap();
Ok(resp.into_response_data()) Ok(resp.into_response_data())
} }

View file

@ -1,6 +1,7 @@
use serde::Deserialize; use serde::Deserialize;
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize)]
#[allow(dead_code)]
pub struct OAuthData { pub struct OAuthData {
pub oauth_token: String, pub oauth_token: String,
pub steamid: String, pub steamid: String,

View file

@ -82,7 +82,7 @@ where
cookies cookies
} }
pub fn get_trade_confirmations(&self) -> Result<Vec<Confirmation>, ConfirmerError> { pub fn get_confirmations(&self) -> Result<Vec<Confirmation>, ConfirmerError> {
let cookies = self.build_cookie_jar(); let cookies = self.build_cookie_jar();
let client = self.transport.innner_http_client()?; let client = self.transport.innner_http_client()?;