mirror of
https://github.com/trussed-dev/piv-authenticator.git
synced 2026-06-20 04:16:15 -07:00
Make application url and label configurable
This commit is contained in:
+2
-2
@@ -31,8 +31,8 @@ pub const PIV_AID: iso7816::Aid =
|
||||
|
||||
pub const DERIVED_PIV_AID: [u8; 11] = hex!("A000000308 00002000 0100");
|
||||
|
||||
pub const APPLICATION_LABEL: &[u8] = b"SoloKeys PIV";
|
||||
pub const APPLICATION_URL: &[u8] = b"https://github.com/solokeys/piv-authenticator";
|
||||
pub const NITROKEY_APPLICATION_LABEL: &[u8] = b"Nitrokey PIV";
|
||||
pub const NITROKEY_APPLICATION_URL: &[u8] = b"https://github.com/Nitrokey/piv-authenticator";
|
||||
|
||||
pub const YUBICO_DEFAULT_MANAGEMENT_KEY: &[u8; 24] = &hex!(
|
||||
"
|
||||
|
||||
+13
-3
@@ -46,19 +46,29 @@ use state::{AdministrationAlgorithm, CommandCache, KeyWithAlg, LoadedState, Stat
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct Options {
|
||||
storage: Location,
|
||||
label: &'static [u8],
|
||||
url: &'static [u8],
|
||||
}
|
||||
|
||||
impl Default for Options {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
storage: Location::External,
|
||||
label: NITROKEY_APPLICATION_LABEL,
|
||||
url: NITROKEY_APPLICATION_URL,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Options {
|
||||
pub fn storage(self, storage: Location) -> Self {
|
||||
Self { storage }
|
||||
Self { storage, ..self }
|
||||
}
|
||||
pub fn url(self, url: &'static [u8]) -> Self {
|
||||
Self { url, ..self }
|
||||
}
|
||||
pub fn label(self, label: &'static [u8]) -> Self {
|
||||
Self { label, ..self }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,8 +128,8 @@ where
|
||||
info!("selecting PIV maybe");
|
||||
|
||||
let application_property_template = piv_types::ApplicationPropertyTemplate::default()
|
||||
.with_application_label(APPLICATION_LABEL)
|
||||
.with_application_url(APPLICATION_URL)
|
||||
.with_application_label(self.options.label)
|
||||
.with_application_url(self.options.url)
|
||||
.with_supported_cryptographic_algorithms(&[
|
||||
Tdes, Aes256, P256, Ed25519, X25519, Rsa2048,
|
||||
]);
|
||||
|
||||
@@ -479,10 +479,10 @@ impl IoCmd {
|
||||
"
|
||||
61 66 // Card application property template
|
||||
4f 06 000010000100 // Application identifier
|
||||
50 0c 536f6c6f4b65797320504956 // Application label = b\"Solokeys PIV\"
|
||||
50 0c 4e6974726f6b657920504956 // Application label = b\"Nitrokey PIV\"
|
||||
|
||||
// URL = b\"https://github.com/solokeys/piv-authenticator\"
|
||||
5f50 2d 68747470733a2f2f6769746875622e636f6d2f736f6c6f6b6579732f7069762d61757468656e74696361746f72
|
||||
// URL = b\"https://github.com/Nitrokey/piv-authenticator\"
|
||||
5f50 2d 68747470733a2f2f6769746875622e636f6d2f4e6974726f6b65792f7069762d61757468656e74696361746f72
|
||||
|
||||
// Cryptographic Algorithm Identifier Template
|
||||
ac 15
|
||||
|
||||
Reference in New Issue
Block a user