diff --git a/card-functionality/src/cards.rs b/card-functionality/src/cards.rs index 64e90a8..4477488 100644 --- a/card-functionality/src/cards.rs +++ b/card-functionality/src/cards.rs @@ -101,7 +101,7 @@ impl TestCard { let mut ca = CardApp::from(card_client); // Set Card Capabilities (chaining, command length, ..) - let ard = ca.get_app_data()?; + let ard = ca.get_application_related_data()?; let app_id = ard.get_application_id()?; if app_id.ident().as_str() == ident { @@ -120,7 +120,7 @@ impl TestCard { let mut ca = CardApp::from(card_client); // Set Card Capabilities (chaining, command length, ..) - let ard = ca.get_app_data()?; + let ard = ca.get_application_related_data()?; ca.init_caps(&ard)?; // println!("opened scdc card {}", serial); diff --git a/card-functionality/src/tests.rs b/card-functionality/src/tests.rs index 7c89d21..9e3475a 100644 --- a/card-functionality/src/tests.rs +++ b/card-functionality/src/tests.rs @@ -96,7 +96,7 @@ fn check_key_upload_metadata( ca: &mut CardApp, meta: &[(String, KeyGenerationTime)], ) -> Result<()> { - let ard = ca.get_app_data()?; + let ard = ca.get_application_related_data()?; // check fingerprints let card_fp = ard.get_fingerprints()?; @@ -140,7 +140,7 @@ pub fn test_print_caps( ca: &mut CardApp, _param: &[&str], ) -> Result { - let ard = ca.get_app_data()?; + let ard = ca.get_application_related_data()?; let aid = ard.get_application_id()?; println!("aid: {:#x?}", aid); @@ -161,7 +161,7 @@ pub fn test_print_algo_info( ca: &mut CardApp, _param: &[&str], ) -> Result { - let ard = ca.get_app_data()?; + let ard = ca.get_application_related_data()?; let dec = ard.get_algorithm_attributes(KeyType::Decryption)?; println!("Current algorithm for the decrypt slot: {}", dec); @@ -250,7 +250,7 @@ pub fn test_get_pub( ca: &mut CardApp, _param: &[&str], ) -> Result { - let ard = ca.get_app_data()?; + let ard = ca.get_application_related_data()?; let key_gen = ard.get_key_generation_times()?; // -- @@ -442,7 +442,7 @@ pub fn test_pw_status( ) -> Result { let mut out = vec![]; - let ard = ca.get_app_data()?; + let ard = ca.get_application_related_data()?; let mut pws = ard.get_pw_status_bytes()?; println!("pws {:?}", pws); @@ -454,7 +454,7 @@ pub fn test_pw_status( ca.set_pw_status_bytes(&pws, false)?; - let ard = ca.get_app_data()?; + let ard = ca.get_application_related_data()?; let pws = ard.get_pw_status_bytes()?; println!("pws {:?}", pws); @@ -536,7 +536,7 @@ pub fn run_test( param: &[&str], ) -> Result { let mut ca = card.get_card_app()?; - let ard = ca.get_app_data()?; + let ard = ca.get_application_related_data()?; let _app_id = ard.get_application_id()?; t(&mut ca, param) diff --git a/openpgp-card-sequoia/src/decryptor.rs b/openpgp-card-sequoia/src/decryptor.rs index 61cd65e..90a6176 100644 --- a/openpgp-card-sequoia/src/decryptor.rs +++ b/openpgp-card-sequoia/src/decryptor.rs @@ -39,7 +39,7 @@ impl<'a> CardDecryptor<'a> { policy: &dyn Policy, ) -> Result, Error> { // Get the fingerprint for the decryption key from the card. - let ard = ca.get_app_data()?; + let ard = ca.get_application_related_data()?; let fps = ard.get_fingerprints()?; let fp = fps.decryption(); diff --git a/openpgp-card-sequoia/src/lib.rs b/openpgp-card-sequoia/src/lib.rs index cb3c167..4a5196f 100644 --- a/openpgp-card-sequoia/src/lib.rs +++ b/openpgp-card-sequoia/src/lib.rs @@ -583,7 +583,7 @@ impl CardBase { // read and cache "application related data" let mut card_app = CardApp::from(ccb); - let ard = card_app.get_app_data()?; + let ard = card_app.get_application_related_data()?; card_app.init_caps(&ard)?; @@ -597,7 +597,7 @@ impl CardBase { /// This is done once, after opening the OpenPGP card applet /// (the data is stored in the OpenPGPCard object). fn get_app_data(&mut self) -> Result { - self.card_app.get_app_data() + self.card_app.get_application_related_data() } pub fn get_application_id(&self) -> Result { diff --git a/openpgp-card-sequoia/src/main.rs b/openpgp-card-sequoia/src/main.rs index 6f4a3e8..4a633ca 100644 --- a/openpgp-card-sequoia/src/main.rs +++ b/openpgp-card-sequoia/src/main.rs @@ -242,7 +242,7 @@ fn main() -> Result<(), Box> { for c in cards { let mut ca = CardApp::from(c); - let ard = ca.get_app_data()?; + let ard = ca.get_application_related_data()?; let app_id = ard.get_application_id()?; let ident = app_id.ident(); diff --git a/openpgp-card-sequoia/src/signer.rs b/openpgp-card-sequoia/src/signer.rs index 6e249f3..34f52d5 100644 --- a/openpgp-card-sequoia/src/signer.rs +++ b/openpgp-card-sequoia/src/signer.rs @@ -34,7 +34,7 @@ impl<'a> CardSigner<'a> { policy: &dyn Policy, ) -> Result, Error> { // Get the fingerprint for the signing key from the card. - let ard = ca.get_app_data()?; + let ard = ca.get_application_related_data()?; let fps = ard.get_fingerprints()?; let fp = fps.signature(); diff --git a/openpgp-card/src/card_app.rs b/openpgp-card/src/card_app.rs index 44b6c30..f8f519c 100644 --- a/openpgp-card/src/card_app.rs +++ b/openpgp-card/src/card_app.rs @@ -105,7 +105,9 @@ impl CardApp { /// (This data should probably be cached in a higher layer. Some parts of /// it are needed regularly, and it does not usually change during /// normal use of a card.) - pub fn get_app_data(&mut self) -> Result { + pub fn get_application_related_data( + &mut self, + ) -> Result { let ad = commands::get_application_data(); let resp = apdu::send_command(&mut self.card_client, ad, true)?; let value = Value::from(resp.data()?, true)?; @@ -577,7 +579,7 @@ impl CardApp { algo: &Algo, ) -> Result { // FIXME: caching? - let ard = self.get_app_data()?; + let ard = self.get_application_related_data()?; // FIXME: Only write algo attributes to the card if "extended // capabilities" show that they are changeable! diff --git a/openpgp-card/src/keys.rs b/openpgp-card/src/keys.rs index 2bdb4bc..55fcf55 100644 --- a/openpgp-card/src/keys.rs +++ b/openpgp-card/src/keys.rs @@ -46,7 +46,7 @@ pub(crate) fn gen_key_with_metadata( } // algo - let ard = card_app.get_app_data()?; // no caching, here! + let ard = card_app.get_application_related_data()?; // no caching, here! let algo = ard.get_algorithm_attributes(key_type)?; // generate key @@ -137,7 +137,7 @@ pub(crate) fn get_pub_key( key_type: KeyType, ) -> Result { // algo - let ard = card_app.get_app_data()?; // FIXME: caching + let ard = card_app.get_application_related_data()?; // FIXME: caching let algo = ard.get_algorithm_attributes(key_type)?; // get public key @@ -181,7 +181,7 @@ pub(crate) fn key_import( // No -> Get the current algorithm attributes for key_type. // FIXME: caching? - let ard = card_app.get_app_data()?; + let ard = card_app.get_application_related_data()?; let algo = ard.get_algorithm_attributes(key_type)?; // Is the algorithm on the card currently set to RSA? diff --git a/pcsc/src/lib.rs b/pcsc/src/lib.rs index 9caae04..9e31c07 100644 --- a/pcsc/src/lib.rs +++ b/pcsc/src/lib.rs @@ -128,7 +128,7 @@ impl PcscClient { mut ca: CardApp, ident: &str, ) -> Result, Error> { - let ard = ca.get_app_data()?; + let ard = ca.get_application_related_data()?; let aid = ard.get_application_id()?; if aid.ident() == ident {