From da776bc4cfb79fabff9045de17fd14ea1a17ac1b Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Tue, 29 Aug 2023 17:16:52 +0200 Subject: [PATCH] openpgp-card: rename AlgorithmInformation::filter_by_keytype -> for_keytype --- openpgp-card/src/card_do/algo_info.rs | 4 ++-- openpgp-card/src/keys.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openpgp-card/src/card_do/algo_info.rs b/openpgp-card/src/card_do/algo_info.rs index 1014172..f24f498 100644 --- a/openpgp-card/src/card_do/algo_info.rs +++ b/openpgp-card/src/card_do/algo_info.rs @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2021-2023 Heiko Schaefer // SPDX-License-Identifier: MIT OR Apache-2.0 -//! 4.4.3.11 Algorithm Information +//! Algorithm Information [Spec section 4.4.3.11] use std::convert::TryFrom; use std::fmt; @@ -15,7 +15,7 @@ use crate::card_do::{algo_attrs, complete}; use crate::KeyType; impl AlgorithmInformation { - pub fn filter_by_keytype(&self, kt: KeyType) -> Vec<&AlgorithmAttributes> { + pub fn for_keytype(&self, kt: KeyType) -> Vec<&AlgorithmAttributes> { self.0 .iter() .filter(|(k, _)| *k == kt) diff --git a/openpgp-card/src/keys.rs b/openpgp-card/src/keys.rs index de6be27..ee1e069 100644 --- a/openpgp-card/src/keys.rs +++ b/openpgp-card/src/keys.rs @@ -292,7 +292,7 @@ fn card_algo_rsa( // Find suitable algorithm parameters (from card's list of algorithms). // Get Algos for this keytype - let keytype_algos: Vec<_> = algo_info.filter_by_keytype(key_type); + let keytype_algos: Vec<_> = algo_info.for_keytype(key_type); // Get RSA algo attributes let rsa_algos: Vec<_> = keytype_algos .iter() @@ -334,7 +334,7 @@ fn check_card_algo_ecc( // Find suitable algorithm parameters (from card's list of algorithms). // Get Algos for this keytype - let keytype_algos: Vec<_> = algo_info.filter_by_keytype(key_type); + let keytype_algos: Vec<_> = algo_info.for_keytype(key_type); // Get attributes let ecc_algos: Vec<_> = keytype_algos