From 99be1fb7da1aac8248fdf196e1e9ef376de30f30 Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Sun, 8 Aug 2021 09:38:46 +0200 Subject: [PATCH] Cleanup field naming in EccAttrs: t->ecc_type. --- openpgp-card/src/card_app.rs | 2 +- openpgp-card/src/keys.rs | 2 +- openpgp-card/src/parse/algo_attrs.rs | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/openpgp-card/src/card_app.rs b/openpgp-card/src/card_app.rs index 19479ab..dca0367 100644 --- a/openpgp-card/src/card_app.rs +++ b/openpgp-card/src/card_app.rs @@ -573,7 +573,7 @@ impl CardApp { let data = match algo { Algo::Rsa(rsa) => Self::rsa_algo_attrs(rsa)?, - Algo::Ecc(ecc) => Self::ecc_algo_attrs(&ecc.oid, ecc.t), + Algo::Ecc(ecc) => Self::ecc_algo_attrs(&ecc.oid, ecc.ecc_type), _ => unimplemented!(), }; diff --git a/openpgp-card/src/keys.rs b/openpgp-card/src/keys.rs index 522566a..0b68c81 100644 --- a/openpgp-card/src/keys.rs +++ b/openpgp-card/src/keys.rs @@ -191,7 +191,7 @@ pub(crate) fn upload_key( // } let algo = Algo::Ecc(EccAttrs { - t: ecc_key.get_type(), + ecc_type: ecc_key.get_type(), oid: ecc_key.get_oid().to_vec(), import_format: None, }); diff --git a/openpgp-card/src/parse/algo_attrs.rs b/openpgp-card/src/parse/algo_attrs.rs index cca4a64..df56226 100644 --- a/openpgp-card/src/parse/algo_attrs.rs +++ b/openpgp-card/src/parse/algo_attrs.rs @@ -27,15 +27,19 @@ pub struct RsaAttrs { #[derive(Debug, Clone, Eq, PartialEq)] pub struct EccAttrs { - pub t: EccType, + pub ecc_type: EccType, pub oid: Vec, pub import_format: Option, } impl EccAttrs { - pub fn new(t: EccType, curve: Curve, import_format: Option) -> Self { + pub fn new( + ecc_type: EccType, + curve: Curve, + import_format: Option, + ) -> Self { Self { - t, + ecc_type, oid: curve.oid().to_vec(), import_format, }