mirror of
https://github.com/librekeys/picoforge.git
synced 2026-07-28 08:01:19 -07:00
fix clippy warings in fido code
This commit is contained in:
@@ -1506,12 +1506,11 @@ impl HidTransport {
|
||||
// 4. For others, sign the subcommand byte followed by the CBOR-encoded SubCommandParams map.
|
||||
|
||||
let mut message = vec![sub_cmd];
|
||||
if let Some(params) = sub_params_bytes {
|
||||
if sub_cmd != CredentialMgmtSubCommand::GetCredsMetadata as u8
|
||||
&& sub_cmd != CredentialMgmtSubCommand::EnumerateRpsBegin as u8
|
||||
{
|
||||
message.extend(params);
|
||||
}
|
||||
if let Some(params) = sub_params_bytes
|
||||
&& sub_cmd != CredentialMgmtSubCommand::GetCredsMetadata as u8
|
||||
&& sub_cmd != CredentialMgmtSubCommand::EnumerateRpsBegin as u8
|
||||
{
|
||||
message.extend(params);
|
||||
}
|
||||
|
||||
log::debug!(
|
||||
|
||||
+11
-12
@@ -141,14 +141,13 @@ pub(crate) fn get_fido_info() -> Result<FidoDeviceInfo, String> {
|
||||
0x0A => {
|
||||
if let Value::Array(arr) = val {
|
||||
for v in arr {
|
||||
if let Value::Map(m) = v {
|
||||
if let Some(Value::Integer(alg_id)) = m.get(&Value::Text("alg".into()))
|
||||
{
|
||||
if let Some(alg) = CoseAlgorithm::from_i128(*alg_id) {
|
||||
algorithms.push(alg.to_string());
|
||||
} else {
|
||||
algorithms.push(format!("Unknown ({})", alg_id));
|
||||
}
|
||||
if let Value::Map(m) = v
|
||||
&& let Some(Value::Integer(alg_id)) = m.get(&Value::Text("alg".into()))
|
||||
{
|
||||
if let Some(alg) = CoseAlgorithm::from_i128(*alg_id) {
|
||||
algorithms.push(alg.to_string());
|
||||
} else {
|
||||
algorithms.push(format!("Unknown ({})", alg_id));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -429,10 +428,10 @@ pub(crate) fn get_credentials(pin: String) -> Result<Vec<StoredCredential>, Stri
|
||||
}
|
||||
|
||||
// Parse Credential ID Descriptor
|
||||
if let Value::Map(m) = &cred.credential_id {
|
||||
if let Some(Value::Bytes(b)) = m.get(&Value::Text("id".into())) {
|
||||
stored_cred.credential_id = hex::encode(b);
|
||||
}
|
||||
if let Value::Map(m) = &cred.credential_id
|
||||
&& let Some(Value::Bytes(b)) = m.get(&Value::Text("id".into()))
|
||||
{
|
||||
stored_cred.credential_id = hex::encode(b);
|
||||
}
|
||||
|
||||
all_credentials.push(stored_cred);
|
||||
|
||||
Reference in New Issue
Block a user