Skip to content

Commit

Permalink
Bump base32 from 0.4.0 to 0.5.1
Browse files Browse the repository at this point in the history
Bumps [base32](https://github.com/andreasots/base32) from 0.4.0 to 0.5.1.
- [Commits](andreasots/base32@v0.4.0...v0.5.1)

---
updated-dependencies:
- dependency-name: base32
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
  • Loading branch information
dependabot[bot] authored and d-e-s-o committed Oct 9, 2024
1 parent 849516c commit e7ad88e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Unreleased
- Adjusted program to use Rust Edition 2021
- Updated minimum supported Rust version to `1.56.0`
- Bumped `anyhow` dependency to `1.0.89`
- Bumped `base32` dependency to `0.5.1`
- Bumped `directories` dependency to `5.0.1`
- Bumped `libc` dependency to `0.2.159`
- Bumped `serde` dependency to `1.0.147`
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ incremental = false
version = "1.0"

[dependencies.base32]
version = "0.4.0"
version = "0.5.1"

[dependencies.directories]
version = "5"
Expand Down
6 changes: 4 additions & 2 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -887,8 +887,10 @@ fn prepare_ascii_secret(secret: &str) -> anyhow::Result<String> {
/// Prepare a base32 secret string for libnitrokey.
fn prepare_base32_secret(secret: &str) -> anyhow::Result<String> {
// Some sites display the base32 secret in groups separated by spaces, we want to ignore them.
let secret = secret.replace(' ', "");
base32::decode(base32::Alphabet::RFC4648 { padding: false }, &secret)
let mut secret = secret.replace(' ', "");
let () = secret.make_ascii_lowercase();

base32::decode(base32::Alphabet::Rfc4648Lower { padding: false }, &secret)
.map(|vec| format_bytes(&vec))
.context("Failed to parse base32 secret")
}
Expand Down

0 comments on commit e7ad88e

Please sign in to comment.