bech32 0.8

This commit is contained in:
Jack Grigg
2021-03-29 10:43:57 +13:00
parent 15081ac948
commit 50e4fee48c
4 changed files with 26 additions and 12 deletions
Generated
+8 -2
View File
@@ -31,7 +31,7 @@ version = "0.0.0"
source = "git+https://github.com/str4d/rage.git?rev=d8fd951e059d9f7116b2b9dd0d176798a11b49f3#d8fd951e059d9f7116b2b9dd0d176798a11b49f3"
dependencies = [
"age-core",
"bech32",
"bech32 0.7.3",
"chrono",
"secrecy",
]
@@ -42,7 +42,7 @@ version = "0.0.0"
dependencies = [
"age-core",
"age-plugin",
"bech32",
"bech32 0.8.0",
"console",
"elliptic-curve",
"gumdrop",
@@ -88,6 +88,12 @@ version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dabbe35f96fb9507f7330793dc490461b2962659ac5d427181e451a623751d1"
[[package]]
name = "bech32"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c7f7096bc256f5e5cb960f60dfc4f4ef979ca65abe7fb9d5a4f77150d3783d4"
[[package]]
name = "bitflags"
version = "1.2.1"
+1 -1
View File
@@ -13,7 +13,7 @@ edition = "2018"
[dependencies]
age-core = "0.5"
age-plugin = "0.0"
bech32 = "0.7.2"
bech32 = "0.8"
console = "0.14"
elliptic-curve = "0.8"
gumdrop = "0.8"
+8 -4
View File
@@ -1,4 +1,4 @@
use bech32::ToBase32;
use bech32::{ToBase32, Variant};
use elliptic_curve::sec1::EncodedPoint;
use p256::NistP256;
use sha2::{Digest, Sha256};
@@ -22,9 +22,13 @@ impl fmt::Debug for Recipient {
impl fmt::Display for Recipient {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(
bech32::encode(RECIPIENT_PREFIX, self.as_bytes().to_base32())
.expect("HRP is valid")
.as_str(),
bech32::encode(
RECIPIENT_PREFIX,
self.as_bytes().to_base32(),
Variant::Bech32,
)
.expect("HRP is valid")
.as_str(),
)
}
}
+9 -5
View File
@@ -1,6 +1,6 @@
//! Structs for handling YubiKeys.
use bech32::ToBase32;
use bech32::{ToBase32, Variant};
use std::fmt;
use std::thread::sleep;
use std::time::{Duration, SystemTime};
@@ -81,10 +81,14 @@ pub struct Stub {
impl fmt::Display for Stub {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(
bech32::encode(IDENTITY_PREFIX, self.to_bytes().to_base32())
.expect("HRP is valid")
.to_uppercase()
.as_str(),
bech32::encode(
IDENTITY_PREFIX,
self.to_bytes().to_base32(),
Variant::Bech32,
)
.expect("HRP is valid")
.to_uppercase()
.as_str(),
)
}
}