openpgp: Do not fail hard if unknown algorithm is encountered and fix typo

This commit is contained in:
Jakub Jelen 2020-03-27 11:12:33 +01:00
parent 9bd139d1e4
commit 64b61a7556
1 changed files with 8 additions and 8 deletions

View File

@ -321,16 +321,16 @@ sc_pkcs15emu_openpgp_init(sc_pkcs15_card_t *p15card)
if((algorithm_info = sc_card_find_ec_alg(card, 0, &oid)))
prkey_info.field_length = algorithm_info->key_length;
else {
sc_log(ctx, "algorithim not found");
goto failed;
sc_log(ctx, "algorithm not found");
continue;
}
break;
case SC_OPENPGP_KEYALGO_EDDSA:
if ((algorithm_info = sc_card_find_eddsa_alg(card, 0, &oid)))
prkey_info.field_length = algorithm_info->key_length;
else {
sc_log(ctx, "algorithim not found");
goto failed;
sc_log(ctx, "algorithm not found");
continue;
}
break;
}
@ -429,16 +429,16 @@ sc_pkcs15emu_openpgp_init(sc_pkcs15_card_t *p15card)
if((algorithm_info = sc_card_find_ec_alg(card, 0, &oid)))
pubkey_info.field_length = algorithm_info->key_length;
else {
sc_log(ctx, "algorithim not found");
goto failed;
sc_log(ctx, "algorithm not found");
continue;
}
break;
case SC_OPENPGP_KEYALGO_EDDSA:
if ((algorithm_info = sc_card_find_eddsa_alg(card, 0, &oid)))
pubkey_info.field_length = algorithm_info->key_length;
else {
sc_log(ctx, "algorithim not found");
goto failed;
sc_log(ctx, "algorithm not found");
continue;
}
break;
}