Rename crate::format to crate::piv_p256

This commit is contained in:
Jack Grigg
2025-12-08 01:53:59 +00:00
parent 144d3088b6
commit 1f1f257ede
4 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -21,8 +21,8 @@ use yubikey::{
use crate::{ use crate::{
error::Error, error::Error,
fl, fl,
format::RecipientLine,
p256::{Recipient, TAG_BYTES}, p256::{Recipient, TAG_BYTES},
piv_p256,
util::{otp_serial_prefix, Metadata}, util::{otp_serial_prefix, Metadata},
IDENTITY_PREFIX, IDENTITY_PREFIX,
}; };
@@ -476,7 +476,7 @@ impl Stub {
bytes bytes
} }
pub(crate) fn matches(&self, line: &RecipientLine) -> bool { pub(crate) fn matches(&self, line: &piv_p256::RecipientLine) -> bool {
self.tag == line.tag self.tag == line.tag
} }
+1 -1
View File
@@ -16,9 +16,9 @@ use yubikey::{piv::RetiredSlotId, reader::Context, PinPolicy, Serial, TouchPolic
mod builder; mod builder;
mod error; mod error;
mod format;
mod key; mod key;
mod p256; mod p256;
mod piv_p256;
mod plugin; mod plugin;
mod util; mod util;
View File
+4 -4
View File
@@ -7,7 +7,7 @@ use age_plugin::{
use std::collections::{HashMap, HashSet}; use std::collections::{HashMap, HashSet};
use std::io; use std::io;
use crate::{fl, format, key, p256::Recipient, PLUGIN_NAME}; use crate::{fl, key, p256::Recipient, piv_p256, PLUGIN_NAME};
pub(crate) struct Handler; pub(crate) struct Handler;
@@ -114,7 +114,7 @@ impl RecipientPluginV1 for RecipientPlugin {
self.recipients self.recipients
.iter() .iter()
.chain(yk_recipients.iter()) .chain(yk_recipients.iter())
.map(|pk| format::RecipientLine::wrap_file_key(&file_key, pk).into()) .map(|pk| piv_p256::RecipientLine::wrap_file_key(&file_key, pk).into())
.collect() .collect()
}) })
.collect()) .collect())
@@ -159,7 +159,7 @@ impl IdentityPluginV1 for IdentityPlugin {
let mut file_keys = HashMap::with_capacity(files.len()); let mut file_keys = HashMap::with_capacity(files.len());
// Filter to files / stanzas for which we have matching YubiKeys // Filter to files / stanzas for which we have matching YubiKeys
let mut candidate_stanzas: Vec<(&key::Stub, HashMap<usize, Vec<format::RecipientLine>>)> = let mut candidate_stanzas: Vec<(&key::Stub, HashMap<usize, Vec<piv_p256::RecipientLine>>)> =
self.yubikeys self.yubikeys
.iter() .iter()
.map(|stub| (stub, HashMap::new())) .map(|stub| (stub, HashMap::new()))
@@ -168,7 +168,7 @@ impl IdentityPluginV1 for IdentityPlugin {
for (file, stanzas) in files.iter().enumerate() { for (file, stanzas) in files.iter().enumerate() {
for (stanza_index, stanza) in stanzas.iter().enumerate() { for (stanza_index, stanza) in stanzas.iter().enumerate() {
match ( match (
format::RecipientLine::from_stanza(stanza).map(|res| { piv_p256::RecipientLine::from_stanza(stanza).map(|res| {
res.map_err(|_| identity::Error::Stanza { res.map_err(|_| identity::Error::Stanza {
file_index: file, file_index: file,
stanza_index, stanza_index,