Hack for SmartPGP applet (use the last of the suitable algorithm variants from the Algorithm Information list).

This commit is contained in:
Heiko Schaefer 2021-09-20 20:36:37 +02:00
parent 56e3845ea4
commit c0088c4eae

View file

@ -320,7 +320,10 @@ fn get_card_algo_rsa(
// Did we find a suitable algorithm entry? // Did we find a suitable algorithm entry?
if !algo.is_empty() { if !algo.is_empty() {
Ok((*algo[0]).clone()) // HACK: The SmartPGP applet reports two variants of RSA (import
// format 1 and 3), but in fact only supports the second variant.
// Using the last option happens to work better, in that case.
Ok((**algo.last().unwrap()).clone())
} else { } else {
// RSA with this bit length is not in algo_list // RSA with this bit length is not in algo_list
return Err(anyhow!( return Err(anyhow!(