diff --git a/src/builder.rs b/src/builder.rs index f4aff2d..eab165b 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -12,7 +12,7 @@ use crate::{ p256::Recipient, util::POLICY_EXTENSION_OID, yubikey::{self, Stub}, - PLUGIN_NAME, USABLE_SLOTS, + BINARY_NAME, USABLE_SLOTS, }; const DEFAULT_PIN_POLICY: PinPolicy = PinPolicy::Once; @@ -129,7 +129,7 @@ impl IdentityBuilder { serial, None, &[ - RelativeDistinguishedName::organization(PLUGIN_NAME), + RelativeDistinguishedName::organization(BINARY_NAME), RelativeDistinguishedName::organizational_unit(env!("CARGO_PKG_VERSION")), RelativeDistinguishedName::common_name(&name), ], diff --git a/src/main.rs b/src/main.rs index a5fb74c..9d2069c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,7 +19,7 @@ mod yubikey; use error::Error; -const PLUGIN_NAME: &str = "age-plugin-yubikey"; +const BINARY_NAME: &str = "age-plugin-yubikey"; const RECIPIENT_PREFIX: &str = "age1yubikey"; const IDENTITY_PREFIX: &str = "age-plugin-yubikey-"; const STANZA_TAG: &str = "piv-p256"; @@ -157,7 +157,7 @@ fn identity(opts: PluginOptions) -> Result<(), Error> { .as_ref() .and_then(|cert| cert.subject().iter_organization().next()) { - Some(org) => org.as_str() == Ok(PLUGIN_NAME), + Some(org) => org.as_str() == Ok(BINARY_NAME), _ => false, } }); diff --git a/src/util.rs b/src/util.rs index 2f7c074..f4e8a82 100644 --- a/src/util.rs +++ b/src/util.rs @@ -5,7 +5,7 @@ use yubikey_piv::{ Key, YubiKey, }; -use crate::{error::Error, p256::Recipient, yubikey::Stub, PLUGIN_NAME, USABLE_SLOTS}; +use crate::{error::Error, p256::Recipient, yubikey::Stub, BINARY_NAME, USABLE_SLOTS}; pub(crate) const POLICY_EXTENSION_OID: &[u64] = &[1, 3, 6, 1, 4, 1, 41482, 3, 8]; @@ -63,7 +63,7 @@ pub(crate) fn touch_policy_to_str(policy: Option) -> &'static str { pub(crate) fn extract_name(cert: &X509Certificate, all: bool) -> Option<(String, bool)> { // Look at Subject Organization to determine if we created this. match cert.subject().iter_organization().next() { - Some(org) if org.as_str() == Ok(PLUGIN_NAME) => { + Some(org) if org.as_str() == Ok(BINARY_NAME) => { // We store the identity name as a Common Name attribute. let name = cert .subject()