Migrate to latest revision of age-core and age-plugin
This commit is contained in:
Generated
+29
-15
@@ -30,15 +30,15 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "age-core"
|
name = "age-core"
|
||||||
version = "0.11.0"
|
version = "0.11.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/str4d/rage.git?rev=5e530a3a6aad9e189e26903bc8114e2da526b4b5#5e530a3a6aad9e189e26903bc8114e2da526b4b5"
|
||||||
checksum = "e2bf6a89c984ca9d850913ece2da39e1d200563b0a94b002b253beee4c5acf99"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.21.7",
|
"base64 0.22.1",
|
||||||
|
"bech32",
|
||||||
"chacha20poly1305",
|
"chacha20poly1305",
|
||||||
"cookie-factory",
|
"cookie-factory",
|
||||||
"hkdf",
|
"hkdf",
|
||||||
"io_tee",
|
"io_tee",
|
||||||
"nom",
|
"nom 8.0.0",
|
||||||
"rand",
|
"rand",
|
||||||
"secrecy 0.10.3",
|
"secrecy 0.10.3",
|
||||||
"sha2",
|
"sha2",
|
||||||
@@ -48,11 +48,10 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "age-plugin"
|
name = "age-plugin"
|
||||||
version = "0.6.1"
|
version = "0.6.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/str4d/rage.git?rev=5e530a3a6aad9e189e26903bc8114e2da526b4b5#5e530a3a6aad9e189e26903bc8114e2da526b4b5"
|
||||||
checksum = "f8a31f37914cf72cf36a1cd8ea9f24e5df20899e9348dd3d1c8273f4420ce493"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"age-core",
|
"age-core",
|
||||||
"base64 0.21.7",
|
"base64 0.22.1",
|
||||||
"bech32",
|
"bech32",
|
||||||
"chrono",
|
"chrono",
|
||||||
]
|
]
|
||||||
@@ -63,7 +62,7 @@ version = "0.5.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"age-core",
|
"age-core",
|
||||||
"age-plugin",
|
"age-plugin",
|
||||||
"base64 0.21.7",
|
"base64 0.22.1",
|
||||||
"bech32",
|
"bech32",
|
||||||
"console",
|
"console",
|
||||||
"dialoguer",
|
"dialoguer",
|
||||||
@@ -129,7 +128,7 @@ dependencies = [
|
|||||||
"asn1-rs-derive",
|
"asn1-rs-derive",
|
||||||
"asn1-rs-impl",
|
"asn1-rs-impl",
|
||||||
"displaydoc",
|
"displaydoc",
|
||||||
"nom",
|
"nom 7.1.3",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"rusticata-macros",
|
"rusticata-macros",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
@@ -198,6 +197,12 @@ version = "0.21.7"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
|
checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "base64"
|
||||||
|
version = "0.22.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "base64ct"
|
name = "base64ct"
|
||||||
version = "1.6.0"
|
version = "1.6.0"
|
||||||
@@ -215,9 +220,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bech32"
|
name = "bech32"
|
||||||
version = "0.9.1"
|
version = "0.11.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445"
|
checksum = "32637268377fc7b10a8c6d51de3e7fba1ce5dd371a96e342b34e6078db558e7f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "bitflags"
|
||||||
@@ -486,7 +491,7 @@ checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"asn1-rs",
|
"asn1-rs",
|
||||||
"displaydoc",
|
"displaydoc",
|
||||||
"nom",
|
"nom 7.1.3",
|
||||||
"num-bigint",
|
"num-bigint",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"rusticata-macros",
|
"rusticata-macros",
|
||||||
@@ -1358,6 +1363,15 @@ dependencies = [
|
|||||||
"minimal-lexical",
|
"minimal-lexical",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nom"
|
||||||
|
version = "8.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405"
|
||||||
|
dependencies = [
|
||||||
|
"memchr",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ntapi"
|
name = "ntapi"
|
||||||
version = "0.4.1"
|
version = "0.4.1"
|
||||||
@@ -2000,7 +2014,7 @@ version = "4.1.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632"
|
checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nom",
|
"nom 7.1.3",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -3006,7 +3020,7 @@ dependencies = [
|
|||||||
"data-encoding",
|
"data-encoding",
|
||||||
"der-parser",
|
"der-parser",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"nom",
|
"nom 7.1.3",
|
||||||
"oid-registry",
|
"oid-registry",
|
||||||
"rusticata-macros",
|
"rusticata-macros",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
@@ -3027,7 +3041,7 @@ dependencies = [
|
|||||||
"elliptic-curve",
|
"elliptic-curve",
|
||||||
"hmac",
|
"hmac",
|
||||||
"log",
|
"log",
|
||||||
"nom",
|
"nom 7.1.3",
|
||||||
"num-bigint-dig",
|
"num-bigint-dig",
|
||||||
"num-integer",
|
"num-integer",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
|
|||||||
+6
-2
@@ -24,8 +24,8 @@ assets = [
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
age-core = "0.11"
|
age-core = "0.11"
|
||||||
age-plugin = "0.6"
|
age-plugin = "0.6"
|
||||||
base64 = "0.21"
|
base64 = "0.22"
|
||||||
bech32 = "0.9"
|
bech32 = "0.11"
|
||||||
console = { version = "0.15", default-features = false }
|
console = { version = "0.15", default-features = false }
|
||||||
dialoguer = { version = "0.11", default-features = false, features = ["password"] }
|
dialoguer = { version = "0.11", default-features = false, features = ["password"] }
|
||||||
env_logger = "0.10"
|
env_logger = "0.10"
|
||||||
@@ -56,3 +56,7 @@ man = "0.3"
|
|||||||
tempfile = "3"
|
tempfile = "3"
|
||||||
test-with = "0.11"
|
test-with = "0.11"
|
||||||
which = "5"
|
which = "5"
|
||||||
|
|
||||||
|
[patch.crates-io]
|
||||||
|
age-core = { git = "https://github.com/str4d/rage.git", rev = "5e530a3a6aad9e189e26903bc8114e2da526b4b5" }
|
||||||
|
age-plugin = { git = "https://github.com/str4d/rage.git", rev = "5e530a3a6aad9e189e26903bc8114e2da526b4b5" }
|
||||||
|
|||||||
+4
-9
@@ -1,8 +1,8 @@
|
|||||||
//! Structs for handling YubiKeys.
|
//! Structs for handling YubiKeys.
|
||||||
|
|
||||||
|
use age_core::primitives::bech32_encode;
|
||||||
use age_core::secrecy::{ExposeSecret, SecretString};
|
use age_core::secrecy::{ExposeSecret, SecretString};
|
||||||
use age_plugin::{identity, Callbacks};
|
use age_plugin::{identity, Callbacks};
|
||||||
use bech32::{ToBase32, Variant};
|
|
||||||
use dialoguer::Password;
|
use dialoguer::Password;
|
||||||
use log::{debug, error, warn};
|
use log::{debug, error, warn};
|
||||||
use std::convert::Infallible;
|
use std::convert::Infallible;
|
||||||
@@ -422,14 +422,9 @@ pub struct Stub {
|
|||||||
impl fmt::Display for Stub {
|
impl fmt::Display for Stub {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.write_str(
|
f.write_str(
|
||||||
bech32::encode(
|
bech32_encode(IDENTITY_PREFIX, &self.to_bytes())
|
||||||
IDENTITY_PREFIX,
|
.to_uppercase()
|
||||||
self.to_bytes().to_base32(),
|
.as_str(),
|
||||||
Variant::Bech32,
|
|
||||||
)
|
|
||||||
.expect("HRP is valid")
|
|
||||||
.to_uppercase()
|
|
||||||
.as_str(),
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -28,7 +28,7 @@ use error::Error;
|
|||||||
|
|
||||||
const PLUGIN_NAME: &str = "yubikey";
|
const PLUGIN_NAME: &str = "yubikey";
|
||||||
const BINARY_NAME: &str = "age-plugin-yubikey";
|
const BINARY_NAME: &str = "age-plugin-yubikey";
|
||||||
const IDENTITY_PREFIX: &str = "age-plugin-yubikey-";
|
const IDENTITY_PREFIX: bech32::Hrp = bech32::Hrp::parse_unchecked("AGE-PLUGIN-YUBIKEY-");
|
||||||
|
|
||||||
const USABLE_SLOTS: [RetiredSlotId; 20] = [
|
const USABLE_SLOTS: [RetiredSlotId; 20] = [
|
||||||
RetiredSlotId::R1,
|
RetiredSlotId::R1,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use bech32::{ToBase32, Variant};
|
use age_core::primitives::bech32_encode_to_fmt;
|
||||||
use p256::elliptic_curve::sec1::{FromEncodedPoint, ToEncodedPoint};
|
use p256::elliptic_curve::sec1::{FromEncodedPoint, ToEncodedPoint};
|
||||||
use yubikey::{certificate::PublicKeyInfo, Certificate};
|
use yubikey::{certificate::PublicKeyInfo, Certificate};
|
||||||
|
|
||||||
@@ -6,7 +6,7 @@ use std::fmt;
|
|||||||
|
|
||||||
use crate::recipient::{static_tag, TAG_BYTES};
|
use crate::recipient::{static_tag, TAG_BYTES};
|
||||||
|
|
||||||
const RECIPIENT_PREFIX: &str = "age1yubikey";
|
const RECIPIENT_PREFIX: bech32::Hrp = bech32::Hrp::parse_unchecked("age1yubikey");
|
||||||
|
|
||||||
/// Wrapper around a compressed secp256r1 curve point.
|
/// Wrapper around a compressed secp256r1 curve point.
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
@@ -20,15 +20,7 @@ impl fmt::Debug for Recipient {
|
|||||||
|
|
||||||
impl fmt::Display for Recipient {
|
impl fmt::Display for Recipient {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.write_str(
|
bech32_encode_to_fmt(f, RECIPIENT_PREFIX, self.to_encoded().as_bytes())
|
||||||
bech32::encode(
|
|
||||||
RECIPIENT_PREFIX,
|
|
||||||
self.to_encoded().as_bytes().to_base32(),
|
|
||||||
Variant::Bech32,
|
|
||||||
)
|
|
||||||
.expect("HRP is valid")
|
|
||||||
.as_str(),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user